use of com.adobe.acs.commons.workflow.synthetic.impl.cq.exceptions.SyntheticCompleteWorkflowException in project acs-aem-commons by Adobe-Consulting-Services.
the class SyntheticWorkflowRunnerImpl method runCqWorkflowProcess.
private void runCqWorkflowProcess(Session session, SyntheticWorkflow workflow, SyntheticMetaDataMap workflowProcessMetaDataMap, SyntheticWorkflowProcess workflowProcess) throws WorkflowException {
final WorkflowSession workflowSession = this.getCqWorkflowSession(session);
// Each Workflow Process Step gets its own workItem whose life starts and ends w the WF Process
final SyntheticWorkItem workItem = new SyntheticWorkItem(workflow.getWorkflowData());
workItem.setWorkflow(workflow);
log.trace("Executing CQ synthetic workflow process [ {} ] on [ {} ]", workflowProcess.getProcessId(), workflow.getWorkflowData().getPayload());
// Execute the Workflow Process
try {
workflowProcess.getCqWorkflowProcess().execute(workItem, workflowSession, workflowProcessMetaDataMap);
workItem.setTimeEnded(new Date());
} catch (SyntheticCompleteWorkflowException ex) {
// Workitem force-completed via a call to workflowSession.complete(..)
workItem.setTimeEnded(new Date());
log.trace(ex.getMessage());
} catch (SyntheticTerminateWorkflowException ex) {
workItem.setTimeEnded(new Date());
log.trace(ex.getMessage());
throw ex;
}
}
Aggregations