1. | | | <?xml version="1.0" encoding="UTF-8"?> |
2. | | | <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.omg.org/bpmn20" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_ptfzEANVEeK2lJvWBPLVRg" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" targetNamespace="http://www.omg.org/bpmn20"> |
3. | | | <bpmn2:process id="salesOrder.SalesOrderProcess" drools:packageName="salesOrder" name="SalesOrderProcess" isExecutable="true"> |
4. | | | <bpmn2:startEvent id="_104129D7-29A0-49E8-A790-226F714A41CD" drools:bgcolor="#9acd32" name=""> |
5. | | | <bpmn2:outgoing>_824C0C53-4A42-4D52-9114-B033A8CAFC81</bpmn2:outgoing> |
6. | | | </bpmn2:startEvent> |
7. | | | <bpmn2:scriptTask id="_60A5093D-5DE3-4077-8F5F-AF569A60B626" drools:bgcolor="#fafad2" drools:taskName="PlaceOrder" name="PlaceOrder" scriptFormat="http://www.java.com/java"> |
8. | | | <bpmn2:incoming>_824C0C53-4A42-4D52-9114-B033A8CAFC81</bpmn2:incoming> |
9. | | | <bpmn2:outgoing>_8A2D3B8A-B1F9-4993-B112-84458270EFAF</bpmn2:outgoing> |
10. | | | <bpmn2:ioSpecification id="_ptfzEQNVEeK2lJvWBPLVRg"> |
11. | | | <bpmn2:dataInput id="_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput" name="TaskName"/> |
12. | | | <bpmn2:inputSet id="_ptgaIANVEeK2lJvWBPLVRg"/> |
13. | | | <bpmn2:outputSet id="_ptgaIQNVEeK2lJvWBPLVRg"/> |
14. | | | </bpmn2:ioSpecification> |
15. | | | <bpmn2:dataInputAssociation id="_ptgaIgNVEeK2lJvWBPLVRg"> |
16. | | | <bpmn2:targetRef>_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput</bpmn2:targetRef> |
17. | | | <bpmn2:assignment id="_ptgaIwNVEeK2lJvWBPLVRg"> |
18. | | | <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="_ptgaJANVEeK2lJvWBPLVRg">PlaceOrder</bpmn2:from> |
19. | | | <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaJQNVEeK2lJvWBPLVRg">_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput</bpmn2:to> |
20. | | | </bpmn2:assignment> |
21. | | | </bpmn2:dataInputAssociation> |
22. | | | <bpmn2:script><![CDATA[System.out.println("Hello Ramesh"); Customer c = new Customer(); c.setName("Ramesh Verala"); c.setIsRegistered(true); Product p = new Product();p.setName("apparel"); Order o = new Order(); o.setProduct(p); o.setCustomer(c); o.setIsMoneyPaid(false); org.drools.event.AgendaEventListener lis = new org.drools.event.AgendaEventListener(){ public void activationCancelled(org.drools.event.ActivationCancelledEvent arg0, org.drools.WorkingMemory arg1) { } public void activationCreated(org.drools.event.ActivationCreatedEvent arg0, org.drools.WorkingMemory arg1) { } public void afterActivationFired( org.drools.event.AfterActivationFiredEvent arg0, org.drools.WorkingMemory arg1) { } public void afterRuleFlowGroupActivated( org.drools.event.RuleFlowGroupActivatedEvent arg0, org.drools.WorkingMemory arg1) { System.out.println("firing all rules"); arg1.fireAllRules(); } public void afterRuleFlowGroupDeactivated( org.drools.event.RuleFlowGroupDeactivatedEvent arg0, org.drools.WorkingMemory arg1) { } public void agendaGroupPopped(org.drools.event.AgendaGroupPoppedEvent arg0, org.drools.WorkingMemory arg1) { } public void agendaGroupPushed(org.drools.event.AgendaGroupPushedEvent arg0, org.drools.WorkingMemory arg1) { } public void beforeActivationFired( org.drools.event.BeforeActivationFiredEvent arg0, org.drools.WorkingMemory arg1) { } public void beforeRuleFlowGroupActivated( org.drools.event.RuleFlowGroupActivatedEvent arg0, org.drools.WorkingMemory arg1) { } public void beforeRuleFlowGroupDeactivated( org.drools.event.RuleFlowGroupDeactivatedEvent arg0, org.drools.WorkingMemory arg1) { } }; System.out.println("casting.."); org.drools.runtime.StatefulKnowledgeSession ksession = (org.drools.runtime.StatefulKnowledgeSession) kcontext.getKnowledgeRuntime(); try{ org.drools.impl.StatefulKnowledgeSessionImpl s = (org.drools.impl.StatefulKnowledgeSessionImpl)ksession; s.session.addEventListener(lis) ; System.out.println("listener is added"); } catch(Exception ex) { System.out.println("================================================================================================================"); System.out.println(ex.getMessage()); } ksession.insert(c);ksession.insert(o);]]></bpmn2:script> |
23. | | | </bpmn2:scriptTask> |
24. | | | <bpmn2:businessRuleTask id="_0172EE3A-F4D5-4FBE-B796-F703A4877671" drools:bgcolor="#fafad2" drools:taskName="CreditApproved" drools:ruleFlowGroup="salesOrder.SalesOrderRuleFlowId" name="CreditApproved"> |
25. | | | <bpmn2:incoming>_8A2D3B8A-B1F9-4993-B112-84458270EFAF</bpmn2:incoming> |
26. | | | <bpmn2:outgoing>_70594D97-F29D-4D84-B0DC-86312DFCB533</bpmn2:outgoing> |
27. | | | <bpmn2:ioSpecification id="_ptgaJgNVEeK2lJvWBPLVRg"> |
28. | | | <bpmn2:dataInput id="_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput" name="TaskName"/> |
29. | | | <bpmn2:inputSet id="_ptgaJwNVEeK2lJvWBPLVRg"/> |
30. | | | <bpmn2:outputSet id="_ptgaKANVEeK2lJvWBPLVRg"/> |
31. | | | </bpmn2:ioSpecification> |
32. | | | <bpmn2:dataInputAssociation id="_ptgaKQNVEeK2lJvWBPLVRg"> |
33. | | | <bpmn2:targetRef>_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput</bpmn2:targetRef> |
34. | | | <bpmn2:assignment id="_ptgaKgNVEeK2lJvWBPLVRg"> |
35. | | | <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="_ptgaKwNVEeK2lJvWBPLVRg">CreditApproved</bpmn2:from> |
36. | | | <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaLANVEeK2lJvWBPLVRg">_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput</bpmn2:to> |
37. | | | </bpmn2:assignment> |
38. | | | </bpmn2:dataInputAssociation> |
39. | | | </bpmn2:businessRuleTask> |
40. | | | <bpmn2:endEvent id="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6" drools:bgcolor="#ff6347" name=""> |
41. | | | <bpmn2:incoming>_70594D97-F29D-4D84-B0DC-86312DFCB533</bpmn2:incoming> |
42. | | | </bpmn2:endEvent> |
43. | | | <bpmn2:sequenceFlow id="_824C0C53-4A42-4D52-9114-B033A8CAFC81" sourceRef="_104129D7-29A0-49E8-A790-226F714A41CD" targetRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626"/> |
44. | | | <bpmn2:sequenceFlow id="_8A2D3B8A-B1F9-4993-B112-84458270EFAF" sourceRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626" targetRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671"/> |
45. | | | <bpmn2:sequenceFlow id="_70594D97-F29D-4D84-B0DC-86312DFCB533" sourceRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671" targetRef="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"/> |
46. | | | </bpmn2:process> |
47. | | | <bpmndi:BPMNDiagram id="_ptgaLQNVEeK2lJvWBPLVRg"> |
48. | | | <bpmndi:BPMNPlane id="_ptgaLgNVEeK2lJvWBPLVRg" bpmnElement="salesOrder.SalesOrderProcess"> |
49. | | | <bpmndi:BPMNShape id="_ptgaLwNVEeK2lJvWBPLVRg" bpmnElement="_104129D7-29A0-49E8-A790-226F714A41CD"> |
50. | | | <dc:Bounds height="30.0" width="30.0" x="75.0" y="115.0"/> |
51. | | | </bpmndi:BPMNShape> |
52. | | | <bpmndi:BPMNShape id="_ptgaMANVEeK2lJvWBPLVRg" bpmnElement="_60A5093D-5DE3-4077-8F5F-AF569A60B626"> |
53. | | | <dc:Bounds height="80.0" width="100.0" x="165.0" y="75.0"/> |
54. | | | </bpmndi:BPMNShape> |
55. | | | <bpmndi:BPMNShape id="_ptgaMQNVEeK2lJvWBPLVRg" bpmnElement="_0172EE3A-F4D5-4FBE-B796-F703A4877671"> |
56. | | | <dc:Bounds height="80.0" width="100.0" x="345.0" y="90.0"/> |
57. | | | </bpmndi:BPMNShape> |
58. | | | <bpmndi:BPMNShape id="_ptgaMgNVEeK2lJvWBPLVRg" bpmnElement="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"> |
59. | | | <dc:Bounds height="28.0" width="28.0" x="789.0" y="95.0"/> |
60. | | | </bpmndi:BPMNShape> |
61. | | | <bpmndi:BPMNEdge id="_ptgaMwNVEeK2lJvWBPLVRg" bpmnElement="_824C0C53-4A42-4D52-9114-B033A8CAFC81"> |
62. | | | <di:waypoint xsi:type="dc:Point" x="90.0" y="130.0"/> |
63. | | | <di:waypoint xsi:type="dc:Point" x="135.0" y="130.0"/> |
64. | | | <di:waypoint xsi:type="dc:Point" x="135.0" y="115.0"/> |
65. | | | <di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/> |
66. | | | </bpmndi:BPMNEdge> |
67. | | | <bpmndi:BPMNEdge id="_ptgaNANVEeK2lJvWBPLVRg" bpmnElement="_8A2D3B8A-B1F9-4993-B112-84458270EFAF"> |
68. | | | <di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/> |
69. | | | <di:waypoint xsi:type="dc:Point" x="305.0" y="115.0"/> |
70. | | | <di:waypoint xsi:type="dc:Point" x="305.0" y="130.0"/> |
71. | | | <di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/> |
72. | | | </bpmndi:BPMNEdge> |
73. | | | <bpmndi:BPMNEdge id="_ptgaNQNVEeK2lJvWBPLVRg" bpmnElement="_70594D97-F29D-4D84-B0DC-86312DFCB533"> |
74. | | | <di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/> |
75. | | | <di:waypoint xsi:type="dc:Point" x="618.0" y="130.0"/> |
76. | | | <di:waypoint xsi:type="dc:Point" x="618.0" y="111.0"/> |
77. | | | <di:waypoint xsi:type="dc:Point" x="803.0" y="109.0"/> |
78. | | | </bpmndi:BPMNEdge> |
79. | | | </bpmndi:BPMNPlane> |
80. | | | </bpmndi:BPMNDiagram> |
81. | | | </bpmn2:definitions> |