06-16-2012 08:25 PM
<process id="ccaProcess" name="ccaProcess">
<startEvent id="startevent1" name="Start"></startEvent>
<serviceTask id="servicetask1" name="Build-1" activiti:class="com.mycomp.step.cca.bpm.CcaDelegate"></serviceTask>
<serviceTask id="servicetask2" name="Build-2" activiti:class="com.mycomp.step.cca.bpm.CcaDelegate"></serviceTask>
<parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow4" name="" sourceRef="servicetask1" targetRef="parallelgateway2"></sequenceFlow>
<sequenceFlow id="flow5" name="" sourceRef="servicetask2" targetRef="parallelgateway2"></sequenceFlow>
<sequenceFlow id="flow6" name="" sourceRef="parallelgateway2" targetRef="endevent1"></sequenceFlow>
<parallelGateway id="parallelgateway3" name="Parallel Gateway"></parallelGateway>
<sequenceFlow id="flow8" name="" sourceRef="parallelgateway3" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow9" name="" sourceRef="parallelgateway3" targetRef="servicetask2"></sequenceFlow>
<sequenceFlow id="flow10" name="" sourceRef="startevent1" targetRef="parallelgateway3"></sequenceFlow>
</process>
runtimeService.startProcessInstanceByKey("ccaProcess");
06-18-2012 04:02 AM
06-20-2012 02:28 AM
06-20-2012 03:04 AM
06-22-2012 02:00 AM
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn" targetNamespace="Examples">
<process id="cca-workflow-process" name="cca-workflow-process">
<documentation>Place documentation for the 'mtrose-bpm-workflow'
process here.</documentation>
<startEvent id="startevent1" name="Start"></startEvent>
<parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
<serviceTask id="build" name="build"
activiti:class="com.cisco.step.cca.engine.delegate.BuildTaskDelegate" activiti:async="true"></serviceTask>
<parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
<serviceTask id="hss_sanity_c4" name="hss_sanity_c4"
activiti:class="com.cisco.step.cca.engine.delegate.SanityTaskDelegate"></serviceTask>
<serviceTask id="sa" name="sa"
activiti:class="com.cisco.step.cca.engine.delegate.StaticAnalysisTaskDelegate"></serviceTask>
<serviceTask id="cr" name="cr"
activiti:class="com.cisco.step.cca.engine.delegate.CodeReviewTaskDelegate" activiti:async="true"></serviceTask>
<serviceTask id="ut" name="ut"
activiti:class="com.cisco.step.cca.engine.delegate.UnitTestTaskDelegate" activiti:async="true"></serviceTask>
<sequenceFlow id="flow1" name="" sourceRef="startevent1"
targetRef="parallelgateway1"></sequenceFlow>
<parallelGateway id="parallelgateway3" name="Parallel Gateway"></parallelGateway>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow5" name="" sourceRef="build"
targetRef="parallelgateway2"></sequenceFlow>
<sequenceFlow id="flow6" name="" sourceRef="parallelgateway2"
targetRef="hss_sanity_c4"></sequenceFlow>
<sequenceFlow id="flow7" name="" sourceRef="parallelgateway2"
targetRef="sa"></sequenceFlow>
<parallelGateway id="parallelgateway4" name="Parallel Gateway"></parallelGateway>
<sequenceFlow id="flow10" name="" sourceRef="parallelgateway3"
targetRef="parallelgateway4"></sequenceFlow>
<sequenceFlow id="flow11" name="" sourceRef="cr"
targetRef="parallelgateway4"></sequenceFlow>
<sequenceFlow id="flow12" name="" sourceRef="ut"
targetRef="parallelgateway4"></sequenceFlow>
<sequenceFlow id="flow13" name="" sourceRef="parallelgateway4"
targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow14" name="" sourceRef="parallelgateway1"
targetRef="build"></sequenceFlow>
<sequenceFlow id="flow15" name="" sourceRef="parallelgateway1"
targetRef="cr"></sequenceFlow>
<sequenceFlow id="flow16" name="" sourceRef="parallelgateway1"
targetRef="ut"></sequenceFlow>
<receiveTask id="sanity_response" name="sanity_response" activiti:class="com.cisco.step.cca.engine.delegate.SanityStatusTaskDelegate"></receiveTask>
<sequenceFlow id="flow17" name="" sourceRef="hss_sanity_c4"
targetRef="sanity_response"></sequenceFlow>
<sequenceFlow id="flow18" name="" sourceRef="sanity_response"
targetRef="parallelgateway3"></sequenceFlow>
<sequenceFlow id="flow19" name="" sourceRef="sa"
targetRef="parallelgateway3"></sequenceFlow>
</process>
</definitions>
public class BuildTaskDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
System.out.println("before…");
Process process=Runtime.getRuntime().exec("sleep 10");
System.out.println("after…");
}
}
06-22-2012 02:35 AM
06-22-2012 02:45 AM
06-22-2012 02:49 AM
This background thread is the activiti job executor (actually a thread pool) which periodically polls the database for jobs. So behind the scenes, when we reach the "generate invoice" task, we are creating a job "message" for activiti to continue the process later and persisting it into the database. This job is then picked up by the job executor and executed. We are also giving the local job executor a little hint that there is a new job, to improve performance.
06-26-2012 02:07 AM
06-26-2012 03:12 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.