10-31-2012 09:08 AM
<subProcess id="PerDomainSubProcess" name="PerDomainSubProcess" activiti:async="true">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="domainIds.list" activiti:elementVariable="domainId"></multiInstanceLoopCharacteristics>
<startEvent …..
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="process1" name="process1">
<startEvent id="startevent1" name="Start" activiti:initiator="initiator"></startEvent>
<userTask id="usertask1" name="Data Inputs" activiti:assignee="${initiator}">
<extensionElements>
<activiti:formProperty id="ids"></activiti:formProperty>
</extensionElements>
</userTask>
<scriptTask id="scripttask1" name="variableList" scriptFormat="groovy">
<script><![CDATA[def ids = execution.getVariable("ids");
def idsList = ids.tokenize(",");
execution.setVariable("ids.list", idsList);]]></script>
</scriptTask>
<subProcess id="subprocess1" name="Sub Process" activiti:async="true">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="ids.list" activiti:elementVariable="identifier"></multiInstanceLoopCharacteristics>
<startEvent id="startevent2" name="Start"></startEvent>
<scriptTask id="scripttask2" name="simple printout" scriptFormat="groovy">
<script><![CDATA[for (idxVar in 0..100000) {
println(execution.getVariable("identifier")+"_"+idxVar);
}]]></script>
</scriptTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow4" name="" sourceRef="startevent2" targetRef="scripttask2"></sequenceFlow>
<sequenceFlow id="flow5" name="" sourceRef="scripttask2" targetRef="endevent1"></sequenceFlow>
</subProcess>
<endEvent id="endevent2" name="End"></endEvent>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="scripttask1"></sequenceFlow>
<sequenceFlow id="flow3" name="" sourceRef="scripttask1" targetRef="subprocess1"></sequenceFlow>
<sequenceFlow id="flow6" name="" sourceRef="subprocess1" targetRef="endevent2"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_process1">
<bpmndi:BPMNPlane bpmnElement="process1" id="BPMNPlane_process1">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35" width="35" x="90" y="150"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55" width="105" x="170" y="140"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="scripttask1" id="BPMNShape_scripttask1">
<omgdc:Bounds height="55" width="105" x="330" y="140"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="subprocess1" id="BPMNShape_subprocess1" isExpanded="true">
<omgdc:Bounds height="205" width="381" x="510" y="65"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="startevent2" id="BPMNShape_startevent2">
<omgdc:Bounds height="35" width="35" x="550" y="152"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="scripttask2" id="BPMNShape_scripttask2">
<omgdc:Bounds height="55" width="105" x="630" y="142"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35" width="35" x="790" y="152"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="585" y="169"></omgdi:waypoint>
<omgdi:waypoint x="630" y="169"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="735" y="169"></omgdi:waypoint>
<omgdi:waypoint x="790" y="169"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
<omgdc:Bounds height="35" width="35" x="940" y="150"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="125" y="167"></omgdi:waypoint>
<omgdi:waypoint x="170" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="275" y="167"></omgdi:waypoint>
<omgdi:waypoint x="330" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="435" y="167"></omgdi:waypoint>
<omgdi:waypoint x="510" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="891" y="167"></omgdi:waypoint>
<omgdi:waypoint x="940" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
11-02-2012 04:41 AM
11-02-2012 06:54 AM
First of all, did you read http://activiti.org/faq.html#WhatIsTheDifferenceBetweenProcessConcurrencyAndJavaConcurrency ?Yes I read the FAQ before to write the process; but it seem a bit outdated or I didn't read correctly?
So yes, your subprocesses will be executed sequentially in the engine.
However, the difference with 'isSequential='true'' is that now all your subprocesses are created at once. In the 'true' case, one subprocess will be created, and when that is finished, the second one will be created.
<scriptTask id="scripttask2" name="simple printout" activiti:async="true" activiti:exclusive="false" scriptFormat="groovy"> …
org.activiti.engine.ActivitiOptimisticLockingException: ExecutionEntity[7713] was updated by another transaction concurrently
11-05-2012 02:54 AM
In this way I'm obtaining some kind of concurrency, is this a correct way to obtain concurrency? but seem to be limited in number of thread used (3). Can this value be changed?
I'm obtaining also some exceptions:
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.