A workflow has a task where parameters (process variables) for the further workflow steps should be set. When the actor has defined all parameters, it will end the task.
Wanted: Check that the parameters are really correct before leaving (ending the task instance)
At the moment I have a CheckAction on end-task events that will throw an IllegalStateException. At first I thought that this would stop jBPM from ending the task: The client who called endTask gets the exception, the task instance is kept un-ended. But it seems that the jBPM just got confused: workflow execution continues (next task is started) but old task is not ended (even when task is blocking).
I know that I could put an decision node after the tasknode and loop back to the task but it would be nice when the caller could get an exception immediately when trying to (illegally) end the task (endTask, exception, reportError) instead of endTask, sleep, getTaskList, findTaskWithSameExecutionTokenAsBefore, reportError