We have a simple content approval workflow where authors can trigger the workflow once done with the changes. Now approvers group gets the notification and they can go and approve the content and complete the workflow that publishes the pages right away.
We got the requirement from the approvers that they want to have an option to schedule the publication. So basically, what they are looking for is that they can complete/approve the workflow but don't want to publish the pages right away. They want to complete/approve the workflow with schedule publication. So if approved, those pages should be published at the scheduled date and time.
Is there any OOTB functionality of workflow that we utilize to achieve this? Or is there any other way we can achieve this?
Thank you!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @webdev91
This can be possible using following steps in the workflow.
1. Dialog Participant Step
2. Capture Scheduled date/time (Process Step):
Code Snippet for Reference:
Resource resource = resourceResolver.getResource(contentPagePath + "/jcr:content");
ValueMap valueMap = resource.getValueMap();
Calendar calendar = (Calendar)valueMap.get("scheduleddate", Calendar.class);
item.getWorkflowData().getMetaDataMap().put("absoluteTime", Long.valueOf(calendar.getTimeInMillis()));
3. Waiting for Activation (Participant Step):
4. Activate Page (Process Step):
Hope this help!
Hi @webdev91
This can be possible using following steps in the workflow.
1. Dialog Participant Step
2. Capture Scheduled date/time (Process Step):
Code Snippet for Reference:
Resource resource = resourceResolver.getResource(contentPagePath + "/jcr:content");
ValueMap valueMap = resource.getValueMap();
Calendar calendar = (Calendar)valueMap.get("scheduleddate", Calendar.class);
item.getWorkflowData().getMetaDataMap().put("absoluteTime", Long.valueOf(calendar.getTimeInMillis()));
3. Waiting for Activation (Participant Step):
4. Activate Page (Process Step):
Hope this help!
Thanks for your quick response.
Would you please provide the complete code for the second step?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies