Dear community fellows,
I am now creating a workflow with scheduling activation function and I mainly refered to these:
accoding to the reference above, I added three processes/steps on my workflow:
1. Dialog Participant Step (this is to introduce in datepicker and set activation date on payload page)
2. Process Step which captures the date value and sets it to workflow instance metadata property (absoluteTime)
3. Participant Step (Waiting for activation) set timeout "Immediate" and Timeout handler "Absolute Time Auto Advancer",
so the step will wait until the scheduled time is reached and proceed to the next step.
1 and 2 worked fine and I did set the absoluteTime on my workflow instance metadata:
However, the workflow keeps running without getting into step 3.
Take OOTB scheduled_activation workflow as an example,
after triggering, the workitem node shows the current step is "Waiting for activation"
But there is nothing under my workitems, means the workflow didn't proceed to "Waiting for activation" step.
Should I re-arrange workflow processes/steps or can I programmatically make the step proceed?
Any thoughts are welcome
Solved! Go to Solution.
@manjunathdj Thanks for the reply
I did add "absoluteTime" successfully to the workflow metadata (code snippet below), but it did not proceed to participant step (waiting for activation). it seems there is a breach between my Process Step (sets absoluteTime property) and Participant Step (waiting for activation).
I tried swapping Waiting for activation and Approve content like you suggested, but it didn't work.
The reason I put Approve content under Waiting for activation is that I hope the approver see the content only when schedule date is due.
ResourceResolver resolver = workflowSession.adaptTo(ResourceResolver.class); Resource payloadResource = resolver.getResource(payloadPath + "/jcr:content"); ValueMap resourceValueMap = payloadResource.getValueMap(); Calendar calendar = (Calendar) resourceValueMap.get("scheduleddate",Calendar.class); workItem.getWorkflowData().getMetaDataMap().put("absoluteTime",Long.valueOf(calendar.getTimeInMillis()));