05-16-2016 12:28 PM
public static void main(String[] args) {
// TODO Auto-generated method stub
ProcessEngine processEngine = null;
ProcessEngineConfiguration processConfig= null;
//Create Activiti process engine
processConfig = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration();
processEngine = processConfig.buildProcessEngine();
//Get Activiti services
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
//Deploy the process definition
repositoryService.createDeployment()
.addClasspathResource("diagrams/FinancialReportProcess.bpmn20.xml")
.deploy();
//Start a process instance
runtimeService.startProcessInstanceByKey("financialReport");
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
targetNamespace="http://activiti.org/bpmn20"
xmlns:activiti="http://activiti.org/bpmn"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process id="financialReport" name="Monthly financial report reminder process">
<startEvent id="theStart" />
<sequenceFlow id='flow1' sourceRef='theStart' targetRef='writeReportTask' />
<userTask id="writeReportTask" name="Write monthly financial report" >
<documentation>
Write monthly financial report for publication to shareholders.
</documentation>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>accountancy</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<sequenceFlow id='flow2' sourceRef='writeReportTask' targetRef='verifyReportTask' />
<userTask id="verifyReportTask" name="Verify monthly financial report" >
<documentation>
Verify monthly financial report composed by the accountancy department.
This financial report is going to be sent to all the company shareholders.
</documentation>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>management</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<sequenceFlow id='flow3' sourceRef='verifyReportTask' targetRef='theEnd' />
<endEvent id="theEnd" />
</process>
</definitions>
05-17-2016 03:21 AM
05-17-2016 05:34 AM
05-18-2016 03:51 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.