I want to terminate the child workflow and parent when option is selected from child workflow.
I can terminate child workflow with below syntax
var workflowData = workItem.getWorkflowData();
if (workflowData.getPayloadType() == "JCR_PATH") {
var workflow = workflowSession.getWorkflow(workItem.getWorkflow().getId());
workflowSession.terminateWorkflow(workflow);
}
With this child gets terminated but it doesn't return back to parent or terminate the parent it gets stuck in that instance.
at this location (/var/workflow/instances/server0/2018-09-03_1/workflow) I can see the parent instance id, can anybody help me with the syntax to get this value from workflowdata and terminate it as well or any other better way of terminating parent workflow ?
Any help would be appreciated.
Thank you in advance.