06-24-2014 05:57 AM
Jun 24, 2014 3:22:26 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
java.lang.NullPointerException
at org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.leave(ParallelMultiInstanceBehavior.java:104)
at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:49)
<signal id="approvalsignal" name="approvalsignal"></signal>
<process id="EventLoopProcess" name="My process" isExecutable="true" xmlns:drools="http://www.jboss.org/drools" drools:version="1" drools:packageName="defaultPackage" drools:adHoc="false">
<startEvent id="startevent1" name="Start"></startEvent>
<scriptTask id="scripttask1" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script>System.out.println("script task 1");</script>
</scriptTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="scripttask1"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow2" sourceRef="scripttask2" targetRef="endevent1"></sequenceFlow>
<subProcess id="subprocess1" name="Sub Process">
<startEvent id="startevent2" name="Start"></startEvent>
<serviceTask id="servicetask2" name="Service Task" activiti:class="com.jato.activititest.HelloServiceTaskEvent">
<multiInstanceLoopCharacteristics isSequential="false">
<loopCardinality>3</loopCardinality>
</multiInstanceLoopCharacteristics>
</serviceTask>
<sequenceFlow id="flow3" sourceRef="startevent2" targetRef="servicetask2"></sequenceFlow>
<endEvent id="endevent3" name="End"></endEvent>
<sequenceFlow id="flow4" sourceRef="servicetask2" targetRef="endevent3"></sequenceFlow>
</subProcess>
<sequenceFlow id="flow5" sourceRef="scripttask1" targetRef="subprocess1"></sequenceFlow>
<scriptTask id="scripttask2" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script>System.out.println("after subprocess");</script>
</scriptTask>
<sequenceFlow id="flow6" sourceRef="subprocess1" targetRef="scripttask2"></sequenceFlow>
<boundaryEvent id="boundarysignal1" name="Signal" attachedToRef="subprocess1" cancelActivity="true">
<signalEventDefinition signalRef="approvalsignal"></signalEventDefinition>
</boundaryEvent>
<scriptTask id="scripttask3" name="Script Task" scriptFormat="groovy" activiti:autoStoreVariables="false">
<script>System.out.println("interrupted");</script>
</scriptTask>
<sequenceFlow id="flow7" sourceRef="boundarysignal1" targetRef="scripttask3"></sequenceFlow>
<sequenceFlow id="flow8" sourceRef="scripttask3" targetRef="endevent1"></sequenceFlow>
</process>
@Override
public void execute(DelegateExecution execution) throws Exception {
System.out.println("executing HelloServiceTaskEvent");
execution.setVariable("user1approved", "true");
RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
if(!userApproved()){
System.out.println("creating signal");
runtimeService.signalEventReceived("approvalsignal");
}
}
06-25-2014 03:12 AM
A multi-instance activity ends when all instances are finished. However, it is possible to specify an expression that is evaluated every time one instance ends. When this expression evaluates to true, all remaining instances are destroyed and the multi-instance activity ends, continuing the process. Such an expression must be defined in the completionCondition child element.
06-25-2014 04:18 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.