12-14-2014 09:25 AM
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess");
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
String f;
Deployment deployment = null;
try {
deployment = repositoryService.createDeployment()
.addInputStream("TestProcess", new FileInputStream(new File("bp/TestProcess.bpmn")))
.deploy();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="deploymentResources" value="*/bp/*bpmn*" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
</beans>
<?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:xsd="http://www.w3.org/2001/XMLSchema" 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">
<message id="gettingPhotoByEMailMessage" name="gettingPhotoByEMailMessage"></message>
<message id="LimitRequestMessage" name="LimitRequestMessage"></message>
<process id="testProcess" name="testProcess" isExecutable="true">
<startEvent id="startEvent" name="StartProcess"></startEvent>
<exclusiveGateway id="checkClientPhoto" name="Check availability client's photos"></exclusiveGateway>
<sequenceFlow id="flow1" sourceRef="startEvent" targetRef="checkClientPhoto"></sequenceFlow>
<userTask id="check" name="Check">
<documentation>Check client's photos task</documentation>
</userTask>
<userTask id="decide" name="Decide">
<documentation>Decide </documentation>
</userTask>
<sequenceFlow id="flow2" sourceRef="checkClientPhoto" targetRef="decide"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="checkClientPhoto" targetRef="check"></sequenceFlow>
<exclusiveGateway id="existIncorrectPhoto" name="ExistIncorrectPhoto"></exclusiveGateway>
<exclusiveGateway id="limitIncreaseApproved" name="CheckLimitSolution">
<documentation>Check operators's solution</documentation>
</exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="check" targetRef="existIncorrectPhoto"></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="existIncorrectPhoto" targetRef="decide"></sequenceFlow>
<sequenceFlow id="flow7" sourceRef="decide" targetRef="limitIncreaseApproved"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<serviceTask id="servicetask1" name="Service Task" activiti:class="src.main.java.com.improveit.smsfinanceserver.ToUppercase"></serviceTask>
<sequenceFlow id="flow9" sourceRef="limitIncreaseApproved" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow10" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
<serviceTask id="servicetask2" name="Service Task" activiti:class="src.main.java.com.improveit.smsfinanceserver.AcmeMoneyTask"></serviceTask>
<sequenceFlow id="flow11" sourceRef="existIncorrectPhoto" targetRef="servicetask2"></sequenceFlow>
<sequenceFlow id="flow12" sourceRef="servicetask2" targetRef="endevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_testProcess">
<bpmndi:BPMNPlane bpmnElement="testProcess" id="BPMNPlane_testProcess">
<bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent">
<omgdc:Bounds height="35.0" width="35.0" x="360.0" y="10.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="checkClientPhoto" id="BPMNShape_checkClientPhoto">
<omgdc:Bounds height="40.0" width="40.0" x="357.0" y="100.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="check" id="BPMNShape_check">
<omgdc:Bounds height="55.0" width="171.0" x="137.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decide" id="BPMNShape_decide">
<omgdc:Bounds height="55.0" width="121.0" x="482.0" y="170.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="existIncorrectPhoto" id="BPMNShape_existIncorrectPhoto">
<omgdc:Bounds height="40.0" width="40.0" x="202.0" y="290.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="limitIncreaseApproved" id="BPMNShape_limitIncreaseApproved">
<omgdc:Bounds height="40.0" width="40.0" x="522.0" y="290.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="386.0" y="420.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
<omgdc:Bounds height="55.0" width="105.0" x="610.0" y="366.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="servicetask2" id="BPMNShape_servicetask2">
<omgdc:Bounds height="55.0" width="105.0" x="50.0" y="350.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="377.0" y="45.0"></omgdi:waypoint>
<omgdi:waypoint x="377.0" y="100.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="397.0" y="120.0"></omgdi:waypoint>
<omgdi:waypoint x="542.0" y="120.0"></omgdi:waypoint>
<omgdi:waypoint x="542.0" y="170.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="357.0" y="120.0"></omgdi:waypoint>
<omgdi:waypoint x="222.0" y="120.0"></omgdi:waypoint>
<omgdi:waypoint x="222.0" y="170.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="222.0" y="225.0"></omgdi:waypoint>
<omgdi:waypoint x="222.0" y="290.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="242.0" y="310.0"></omgdi:waypoint>
<omgdi:waypoint x="345.0" y="309.0"></omgdi:waypoint>
<omgdi:waypoint x="345.0" y="197.0"></omgdi:waypoint>
<omgdi:waypoint x="482.0" y="197.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="542.0" y="225.0"></omgdi:waypoint>
<omgdi:waypoint x="542.0" y="290.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="562.0" y="310.0"></omgdi:waypoint>
<omgdi:waypoint x="662.0" y="310.0"></omgdi:waypoint>
<omgdi:waypoint x="662.0" y="366.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="662.0" y="421.0"></omgdi:waypoint>
<omgdi:waypoint x="661.0" y="437.0"></omgdi:waypoint>
<omgdi:waypoint x="421.0" y="437.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="202.0" y="310.0"></omgdi:waypoint>
<omgdi:waypoint x="102.0" y="310.0"></omgdi:waypoint>
<omgdi:waypoint x="102.0" y="350.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="102.0" y="405.0"></omgdi:waypoint>
<omgdi:waypoint x="102.0" y="437.0"></omgdi:waypoint>
<omgdi:waypoint x="386.0" y="437.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
12-18-2014 02:45 AM
org.activiti.spring.test.autodeployment.SpringAutoDeployTest12-21-2014 06:31 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.