Terminate a workflow using the payload(type: JCR_PATH) in code implementation?
I could find the below code while searching:
Workflow workflow = wfSession.getWorkflow(workItem.getWorkflow().getId());
wfSession.terminateWorkflow(workflow);
Is the above implementation correct to achieve the goal?
How should the definition for wfSession and workItem objects look like?
Where/How do i use the payload, to fetch the instance id of the workflow?