use of edu.harvard.iq.dataverse.workflow.step.WorkflowStepData in project dataverse by IQSS.
the class WorkflowServiceBean method doResume.
private void doResume(PendingWorkflowInvocation pending, String body) {
Workflow wf = pending.getWorkflow();
List<WorkflowStepData> stepsLeft = wf.getSteps().subList(pending.getPendingStepIdx(), wf.getSteps().size());
WorkflowStep pendingStep = createStep(stepsLeft.get(0));
final WorkflowContext ctxt = pending.reCreateContext(roleAssignees);
WorkflowStepResult res = pendingStep.resume(ctxt, pending.getLocalData(), body);
if (res instanceof Failure) {
rollback(wf, ctxt, (Failure) res, pending.getPendingStepIdx() - 1);
} else if (res instanceof Pending) {
pauseAndAwait(wf, ctxt, (Pending) res, pending.getPendingStepIdx());
} else {
executeSteps(wf, ctxt, pending.getPendingStepIdx() + 1);
}
}
Aggregations