Saturday, April 25, 2009

Enabling Workflow to existing WCM items

Problem
After enabling Workflow to different WCM item types, the Administrator realized that the Workflow had been assigned only to items created after the change. The Workflow was not added to any of the items that existed prior to enabling Workflow.

Resolving the problem
First, if you haven’t done it already, you need to enable the Workflow to your items.

The WCMConfigService.properties file can be edited to enable workflows for different items.


1. Edit the file /wcm/shared/app/config/wcmservices/WCMConfigService.properties

2. Add com.aptrix.pluto.workflow.WorkflowControl to any of the control.itemtype settings. For example:

# control properties
control.Style=com.aptrix.pluto.workflow.WorkflowControl
control.Template=com.aptrix.pluto.workflow.WorkflowControl
control.Site=com.aptrix.pluto.workflow.WorkflowControl
control.SiteArea=com.aptrix.pluto.workflow.WorkflowControl
control.Cmpnt=com.aptrix.pluto.workflow.WorkflowControl


3. Save and close it

4. Restart WS Portal

At this point, you will be able to select Workflows to new items only.

Run the URL below in order to enable the Workflow to all existing items:

http://[HOST]:[PORT]/wps/wcm/connect?MOD=WorkflowEnablement&workflow=workflowName&library=libraryName&fix=true

Where, workflowName should be replaced by your Workflow name and libraryName must be replaced by your WCM library name.

You must always specify a workflow name in the URL. Any existing items will have this workflow applied to them. You cannot specify different workflows for different items. If you have further workflows to apply to items, you will need to add them manually.

If you want to restrict the workflow enablement to a specific item type, use the &restrictOn= option:

- Content - &restrictOn=Content
- Presentation templates - &restrictOn=Style
- Authoring templates - &restrictOn=Template
- Taxonomy - &restrictOn=Taxonomy
- Category - &restrictOn=Category
- Site - &restrictOn=Site
- Site area - &restrictOn=SiteArea
- Workflow - &restrictOn=Workflow
- Workflow stage - &restrictOn=WorkflowStage
- Workflow action - &restrictOn=WorkflowAction
- Library components - &restrictOn=Cmpnt


Multiple item types can be selected as follows:

&restrictOn=Content,Style,Cmpnt

Example: Enable Workflow to all existing Site and Site Area items:

http://[HOST]:[PORT]/wps/wcm/connect?MOD=WorkflowEnablement&workflow=workflowname&library=libraryName&fix=true&restrictOn=Site,SiteArea