When I call workflowSession.suspend() from any step, the workflow gets suspended after completing the whole step(I expected it to suspend right at the point when I called suspend method) and I am not able to resume it again using worfsess.resume(). It stays as it was earlier. When I resume it from console, the status changes to "Running"but it doesnt proceed any further.
Solved! Go to Solution.
Views
Replies
Total Likes
You will need to call workflowsession.complete to take the workflow to the next step. Resuming the workflow doesn't automatically take the workflow to next step. I know that's the weird behavior but that's how workflow resume option behaves.
Also there is a catch here, if somebody resumes the workflow from UI there it is stuck because when you trigger resume from UI it just doesn't call complete and take workflow to next step, it keeps the workflow on same step with workflow step status as complete. You can validate that from history option of workflow instance.
- Runal
Views
Replies
Total Likes
did you check the logs what happens when you resume the workflow ?
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Nothing... It just doesnt proceed to next step
Views
Replies
Total Likes
You can either of the following:
session.complete(item, (session.getRoutes(item)).get(0)); session.suspendWorkflow(item.getWorkflow());
session.resumeWorkflow(item.getWorkflow()); session.complete(item, (session.getRoutes(item)).get(0));
choose the one that suits your use-case.
Views
Replies
Total Likes
You will need to call workflowsession.complete to take the workflow to the next step. Resuming the workflow doesn't automatically take the workflow to next step. I know that's the weird behavior but that's how workflow resume option behaves.
Also there is a catch here, if somebody resumes the workflow from UI there it is stuck because when you trigger resume from UI it just doesn't call complete and take workflow to next step, it keeps the workflow on same step with workflow step status as complete. You can validate that from history option of workflow instance.
- Runal
Views
Replies
Total Likes
Are you passing the correct Workflow instance to the resumeWorkflow method? Are there any expections being thrown in the code?
Views
Replies
Total Likes
Views
Replies
Total Likes
That's how it even works from UI workflow console, the step at which you suspend the workflow always gets completed, it won't suspend the current step and re-execute on resume.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies