In this scenario, we will add a simple publish action to the default Content Template Catalog (CTC) workflow, the effect of which will be that when an event is published by the workflow, a message will appear on Heather Reeds' connections profile as per the Social Network Configuration document created in the previous article.
In the earlier section, we created a credential vault slot called socialWorkflowUser, which contains an administrative user with rights to edit access to all content that will be posted to Connections.
To achieve this configuration, we will:
- Create custom workflow actions to post and delete
- Add those workflow actions to a workflow
The WCM workflow that we will customize is shown in the flowchart below.
Creating custom workflow actions
To customize this workflow, we require one custom workflow action:
To do this we need to select the library in which we want to create the custom workflow action. Follow these steps:
1. Go to CTC Demo
WCM library, select New -> Workflow Actions -> Custom Action
2. In the form that appears, click Select Action
and choose the desired social media publisher action. The custom workflow actions are installed by the Social Media Publisher and several basic actions are supplied:
- Delete - deletes a linked post from the specified social network (where supported)
- Delete All - deletes a linked post from all configured social networks (where supported)
- Next Stage - not used
- Post - creates a linked post in the specified social network
- Post All - creates a linked post in all configured social networks (where supported)
- Untrack - removes the link between the WCM content item and the social network post for the specified social network
- Untrack All - removes the link between the WCM content item and the social network post for all configured social networks
3. For our custom workflow action, we opted the following values.
Post to social networks - We use Post All
The action "date type" must be set correctly, too. The value should be Custom Action Date
so that custom logic in the workflow action executes to post to the social networks shortly after the content is published.
4. Once completed, click Save and Close
Adding custom workflow action to a workflow stage
Adding the custom workflow action to a workflow stage is straightforward and can be achieved by opening the desired workflow stage and adding the custom workflow action to the configuration.
Follow these steps to add custom workflow action to a workflow stage:
1. Add the action we created above to the stage Publish Stage
in the "CTC Process" library. To do this, we open the stage and click Edit
, which results in the form shown below.
2. To add the custom workflow action to the stage, select Add Workflow Actions
in the Run on Entering Stage section. If you have recently worked with the custom action, it may appear in the drop-down menu on the form. Otherwise, click the Add Workflow Actions
link and select the custom action in the resulting dialog as shown below.
This results in the workflow action being added to the bottom of the list of actions to execute, as shown below.
This order should be retained, so that the "Post to all social networks" action executes on the published content. If the social networks action is before the published action, the content will still be draft when the social media publisher fires. For draft content items to be posted, the Enable Posting for Draft Documents
check box must be selected in the Social Network Configuration document.
3. Save and close the workflow stage.