Hi, I'm referring to the wf4 exercise included into the development distribution virtual machine (.ova).
it is related to an invoice approval workflow
Code: Select all<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="invoiceWorkflow">
<swimlane name="initiator"></swimlane>
<start-state name="start-state">
<task swimlane="initiator"></task>
<transition to="decision"></transition>
</start-state>
<decision name="decision">
<handler class="com.openkm.workflow.decision.InvoiceDecision"></handler>
<transition to="revisor" name="review"></transition>
<transition to="approver" name="approve"></transition>
</decision>
<task-node name="revisor">
<task name="revisor">
<assignment actor-id="fcurcio"></assignment>
</task>
<transition to="approver" name="reviewed"></transition>
<transition to="user" name="userReview"></transition>
<transition to="cancel" name="cancel"></transition>
</task-node>
<task-node name="approver">
<task name="approver">
<assignment actor-id="rcurcio"></assignment>
</task>
<transition to="revisor" name="review"></transition>
<transition to="end-state" name="aproved"></transition>
<transition to="cancel" name="cancel"></transition>
</task-node>
<node name="cancel">
<action class="com.openkm.workflow.action.InvoiceCancelationAction"></action>
<transition to="end-state"></transition>
</node>
<task-node name="user">
<task name="user" swimlane="initiator"></task>
<transition to="revisor" name="review"></transition>
</task-node>
<end-state name="end-state"></end-state>
</process-definition>
the invoice cancelation action is the following:
Code: Select allpackage com.openkm.workflow.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
public class InvoiceCancelationAction implements ActionHandler {
private static final long serialVersionUID = 1L;
@Override
public void execute(ExecutionContext executionContext) throws Exception {
System.out.println("Invoice has been canceled");
}
}
when the approver or the revisor click on the cancel button, the workflow goes into the "cancel" node and stays there. Does not proceed to the end-state.
Therefore, for example, it is not possible to delete that document because it is still locked by the running workflow.
How can I stop the workflow when a user cancel it ?