Description of problem: Boundary event should not be attached to Service Task in BPMN2 Diagram Editor. Version-Release number of selected component (if applicable): JBPM 6.0.2 JBDS 7.1.1 How reproducible: Attach a boundary event to a service task Steps to Reproduce: 1. Create a script task 2. Attach a boundary event timer to the script task 3. You can see the following error in console, but there is no error in JBDS. ---- java.lang.IllegalArgumentException: Boundary events are supported only on StateBasedNode, found node: org.jbpm.workflow.core.node.ActionNode [ScriptTask_3] ---- Actual results: We can attach the boundary event timer to the script task. Expected results: We can NOT attach the boundary event timer to the script task. Additional info: Bug 994408 - jBPM engine does not support boundary event on Service Task
Note that the description refers to Service Task in some cases, but the issue is about the Script Task, not the Service Task.
Does this mean that Script tasks are NEVER expected to cause a timeout?
Sorry for being unclear...what I wanted to say was: I don't understand why timer events are not supported by jBPM on Script Tasks - isn't it possible that a script MAY time out? If so, wouldn't it be necessary to have a timer event that can handle that timeout?
Correct (at least in the current situation). Script tasks are executed using the engine thread. They should not quick and immediate. Otherwise they will block the engine. Also, even if a timer would fire it would be prevented from triggering as another thread (executing the script) would still be active. It would be much better to model long-running scripts using a service task and using async execution for the script, in which timers could be used as well.
Fixed in 1.2.3 (Mars) and 1.3.0 (Luna) versions of BPMN2 Modeler. User is prevented from adding a Timer Boundary Event to a Script Task. Also, a Timer Event Definition can not be added to an existing Boundary Event attached to a Script Task.
I have verified this as also fixed in BPMN2 Modeler versions for Luna: 1.1.6.CR1-v20160318-1403-B1303 Mars: 1.2.4.CR1-v20160318-1302-B107 Neon: 1.3.0.Beta1-v20160318-1302-B41
Verified on: jbds-9.1.0.CR1_jbdsis-9.0.0.CR1 jbtis-4.3.0.CR1 BPMN2 Modeler - 1.2.4.Final-v20160330-1625-B110