05-05-2011 06:44 AM
09-28-2011 10:04 AM
int numOfExecutions = 1000;
for (int i = 0; i < numOfExecutions; i++) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("continue", false);
ProcessInstance pi = runtimeService.startProcessInstanceByKey(
"loopProcess", variables);
}
The process:<serviceTask id="javaServiceDoNothingLotOfTimes" name="Read voltage"
activiti:class="com.bigcompany.wfe.activiti.delegate.ServiceDelegate">
<extensionElements>
<activiti:field name="serviceName">
<activiti:string>DO_NOTHING_LOT_OF_TIMES</activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
<sequenceFlow sourceRef="javaServiceDoNothingLotOfTimes"
targetRef="javaServiceDoNothingLotOfTimes">
<conditionExpression>${!continue}</conditionExpression>
</sequenceFlow>
<sequenceFlow sourceRef="javaServiceDoNothingLotOfTimes"
targetRef="endEvent">
<conditionExpression>${continue}</conditionExpression>
</sequenceFlow>
public void execute(DelegateExecution execution) throws Exception {
String serviceNameString = "";
…
} else if (serviceNameString.equals("DO_NOTHING_LOT_OF_TIMES")){
if(counter < 100){
counter++;
} else {
execution.setVariable("continue", true);
}
…
At my PC it took 10s to execute, thats 10ms per loop (with each has 100 calls/decisions). I think this is very impressive and a hint to a very lean implementation.09-28-2011 11:38 AM
At my PC it took 10s to execute, thats 10ms per loop (with each has 100 calls/decisions). I think this is very impressive and a hint to a very lean implementation.
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.