All,
Is there a way to determine programmatically on when the workflow is complete so that i could do something, say clear an arraylist, once it is complete?
Regards,
Nicole
Solved! Go to Solution.
Views
Replies
Total Likes
You know the payload. Adopt it to WorkflowStatus. Then from WorkflowStatus can find it is completed or not.
http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/workflow/status/WorkflowStatus.html
Views
Replies
Total Likes
I suppose you could use this to find when the workflow was completed:
I'm not sure what it returns when it is not yet complete (hopefully null or "")
scott
Views
Replies
Total Likes
What is exact use case? Why can;t you do clean up as last step in your workflow.
Views
Replies
Total Likes
My Use case is on rollout trigger a workflow, which picks the payload paths as chapters, one specifies while creating a livecopy.
Now on Initial rollout, i managed to generate an xliff by getting each payload path in the execute method(multiple calls for execute method) putting the payload paths in an arraylist, and then calling the Query Builder rest service to retrieve the nodes with required resourceTypes.
Now when i try to create a livecopy2, selecting chapters, my arraylist gets appended with old values plus the recent. I want to clear the arraylist probably on workflow complete.
Please let me know.
public void execute(WorkItem item, WorkflowSession session, MetaDataMap args)
throws WorkflowException {
// TODO Auto-generated method stub
WorkflowData workflowData = item.getWorkflowData();
System.out.println(workflowData.getPayload().toString());
String path = workflowData.getPayload().toString();
arrList.add(path); // Arraylist that i would like to clear once workflow is complete.
generateXLIFF -> method that accepts arrList as parameter. ->
}
Views
Replies
Total Likes
You know the payload. Adopt it to WorkflowStatus. Then from WorkflowStatus can find it is completed or not.
http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/workflow/status/WorkflowStatus.html
Views
Replies
Total Likes