I'd like to cancel the operation on a taskInstance and expect the following (intuitive?) behavior:
task variable values should not be submitted to the process variables
the taskInstance should not be marked as finished
no transistion should be taken (because at least one taskInstance was not finished and we have still unfinished tasks)
Unfortunately, jBPM behaves completely different :-(
Maybe, because I have a completely different intuition?
Here a little code snippet:
Collection tasks = taskMgmtInstance.getUnfinishedTasks(processInstance.getRootToken()); TaskInstance task; for(Iterator iter=tasks.iterator(); iter.hasNext();) { task = (TaskInstance) iter.next(); task.setVariable("newFeature", true); task.cancel(); }
<task-node name="Do evaluate initial request"> <task name="Change request?" swimlane="project manager" blocking="true"> <controller> <variable name="newFeature" access="read,write,required"></variable> </controller> </task> <transition name="" to="New feature?"></transition> </task-node>