• Workflow CANCEL Button

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #47382  by f4569
 
Hi, I'm testing the Invoice approval workflow included into the development distribution.
When the "revisor" or the "approver" press the Cancel Button, the workflow goes into cancel node state and stops there but still "running".
How is possible to force the workflow to the END state and quit ?
 #47397  by f4569
 
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 all
package 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 ?
 #47418  by jllort
 
Cancel jump to "state" node or "task node" ? Share with me and screenshot.
 #47527  by f4569
 
I Jllort, I solved by jumping directly to final end state instead of passing trough the intermediate cancel state. Now it works.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.