Skip to content

Commit

Permalink
Step-3: deploy and invoke BPMN process
Browse files Browse the repository at this point in the history
  • Loading branch information
sdorokhova authored and ci.cambpm committed Apr 8, 2024
1 parent 1760b38 commit 2ae290a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
Expand Up @@ -16,14 +16,28 @@
*/
package org.camunda.bpm.getstarted.loanapproval;

import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.spring.boot.starter.annotation.EnableProcessApplication;
import org.camunda.bpm.spring.boot.starter.event.PostDeployEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.event.EventListener;

@SpringBootApplication
@EnableProcessApplication
public class WebappExampleProcessApplication {

@Autowired
private RuntimeService runtimeService;

public static void main(String... args) {
SpringApplication.run(WebappExampleProcessApplication.class, args);
}

@EventListener
public void processPostDeploy(PostDeployEvent event) {
runtimeService.startProcessInstanceByKey("loanApproval");
}

}
Empty file.
50 changes: 50 additions & 0 deletions src/main/resources/loanApproval.bpmn
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_DdZocL47EeOQo_IRkjDF6w" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="loanApproval" name="Loan Approval" isExecutable="true" camunda:historyTimeToLive="P180D">
<bpmn2:startEvent id="StartEvent_1" name="Loan Request&#10;Received">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="Task_0dfv74n" />
<bpmn2:endEvent id="EndEvent_1" name="Loan Request&#10;Processed">
<bpmn2:incoming>SequenceFlow_0oy9c54</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:userTask id="Task_0dfv74n" name="Check the request" camunda:assignee="demo">
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0oy9c54</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="SequenceFlow_0oy9c54" sourceRef="Task_0dfv74n" targetRef="EndEvent_1" />
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="loanApproval">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_3" bpmnElement="StartEvent_1">
<dc:Bounds x="170" y="104" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="154" y="140" width="70" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_3" targetElement="UserTask_0k9otqc_di">
<di:waypoint x="206" y="122" />
<di:waypoint x="264" y="122" />
<bpmndi:BPMNLabel>
<dc:Bounds x="240" y="157" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_3" bpmnElement="EndEvent_1">
<dc:Bounds x="419" y="104" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="403" y="140" width="70" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0k9otqc_di" bpmnElement="Task_0dfv74n">
<dc:Bounds x="264" y="82" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0oy9c54_di" bpmnElement="SequenceFlow_0oy9c54">
<di:waypoint x="364" y="122" />
<di:waypoint x="419" y="122" />
<bpmndi:BPMNLabel>
<dc:Bounds x="441.5" y="161" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
Expand Down

0 comments on commit 2ae290a

Please sign in to comment.