Changeset 42:df228627fb75

Updated drools and bpmn
author unexist
date Mon, 19 Jul 2021 16:08:57 +0200
parents a43b92261966
children 9f8533bda171
files todo-service-kogito/src/main/resources/dev/unexist/showcase/todo/todo.bpmn todo-service-kogito/src/main/resources/dev/unexist/showcase/todo/todo.drl todo-service-kogito/src/main/resources/todo.bpmn todo-service-kogito/src/main/resources/todo.drl
diffstat 4 files changed, 131 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/todo-service-kogito/src/main/resources/dev/unexist/showcase/todo/todo.bpmn	Mon Jul 19 16:08:57 2021 +0200
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" 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" xmlns:tns="http://www.omg.org/bpmn20" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:yaoqiang="http://bpmn.sourceforge.net" exporter="jBPM Process Modeler" exporterVersion="2.0" expressionLanguage="http://www.w3.org/1999/XPath" id="_mGGv0MqpEDmRcreZekfVGQ" name="" targetNamespace="http://www.omg.org/bpmn20" typeLanguage="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://bpmn.sourceforge.net/schemas/BPMN20.xsd">
+  <bpmn2:itemDefinition id="_todoItem" isCollection="false" itemKind="Information" structureRef="dev.unexist.showcase.todo.domain.todo.TodoBase"/>
+  <bpmn2:itemDefinition id="__984584B6-A60A-4717-9DBD-B7C688B72566_namespaceInputXItem" isCollection="false" itemKind="Information" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="__984584B6-A60A-4717-9DBD-B7C688B72566_modelInputXItem" isCollection="false" itemKind="Information" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="__984584B6-A60A-4717-9DBD-B7C688B72566_decisionInputXItem" isCollection="false" itemKind="Information" structureRef="java.lang.String"/>
+  <bpmn2:itemDefinition id="__984584B6-A60A-4717-9DBD-B7C688B72566_todoInputXItem" isCollection="false" itemKind="Information" structureRef="dev.unexist.showcase.todo.domain.todo.TodoBase"/>
+  <bpmn2:itemDefinition id="__984584B6-A60A-4717-9DBD-B7C688B72566_todoOutputXItem" isCollection="false" itemKind="Information" structureRef="dev.unexist.showcase.todo.domain.todo.TodoBase"/>
+  <bpmn2:process drools:adHoc="false" drools:packageName="dev.unexist.showcase.todo" drools:version="1.0" id="todos" isClosed="false" isExecutable="true" name="Todo Process" processType="Public">
+    <bpmn2:extensionElements>
+      <yaoqiang:description/>
+      <yaoqiang:pageFormat height="841.8897637795276" imageableHeight="831.8897637795276" imageableWidth="588.1102362204724" imageableX="5.0" imageableY="5.0" orientation="0" width="598.1102362204724"/>
+      <yaoqiang:page background="#FFFFFF" horizontalCount="2" verticalCount="1"/>
+    </bpmn2:extensionElements>
+    <bpmn2:property id="todo" itemSubjectRef="_todoItem" name="todo"/>
+    <bpmn2:sequenceFlow id="_6164E4B2-6B78-4C93-A193-D0B49B239EC5" sourceRef="_984584B6-A60A-4717-9DBD-B7C688B72566" targetRef="_6C77E5F5-C02C-44CC-B3FA-D591838B5142"/>
+    <bpmn2:sequenceFlow id="_58A609D9-BCA1-4698-A4CA-06F24DE55600" sourceRef="_79F12952-8985-4241-884E-CC014F83BBD2" targetRef="_984584B6-A60A-4717-9DBD-B7C688B72566"/>
+    <bpmn2:endEvent id="_6C77E5F5-C02C-44CC-B3FA-D591838B5142" name="Todo Done">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <metaData>
+            <drools:metaValue>
+              <metaValue>
+                <![CDATA[Todo Done]]>
+              </metaValue>
+            </drools:metaValue>
+          </metaData>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>_6164E4B2-6B78-4C93-A193-D0B49B239EC5</bpmn2:incoming>
+      <bpmn2:inputSet/>
+    </bpmn2:endEvent>
+    <bpmn2:businessRuleTask completionQuantity="1" drools:ruleFlowGroup="todo" id="_984584B6-A60A-4717-9DBD-B7C688B72566" implementation="http://www.jboss.org/drools/rule" isForCompensation="false" name="Check Todo" startQuantity="1">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <metaData>
+            <drools:metaValue>
+              <metaValue>
+                <![CDATA[Check Todo]]>
+              </metaValue>
+            </drools:metaValue>
+          </metaData>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>_58A609D9-BCA1-4698-A4CA-06F24DE55600</bpmn2:incoming>
+      <bpmn2:outgoing>_6164E4B2-6B78-4C93-A193-D0B49B239EC5</bpmn2:outgoing>
+      <bpmn2:ioSpecification>
+        <bpmn2:dataInput drools:dtype="dev.unexist.showcase.todo.domain.todo.TodoBase" id="_984584B6-A60A-4717-9DBD-B7C688B72566_todoInputX" isCollection="false" itemSubjectRef="__984584B6-A60A-4717-9DBD-B7C688B72566_todoInputXItem" name="todo"/>
+        <bpmn2:dataOutput drools:dtype="dev.unexist.showcase.todo.domain.todo.TodoBase" id="_984584B6-A60A-4717-9DBD-B7C688B72566_todoOutputX" isCollection="false" itemSubjectRef="__984584B6-A60A-4717-9DBD-B7C688B72566_todoOutputXItem" name="todo"/>
+        <bpmn2:inputSet>
+          <bpmn2:dataInputRefs>_984584B6-A60A-4717-9DBD-B7C688B72566_todoInputX</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+        <bpmn2:outputSet>
+          <bpmn2:dataOutputRefs>_984584B6-A60A-4717-9DBD-B7C688B72566_todoOutputX</bpmn2:dataOutputRefs>
+        </bpmn2:outputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation id="DIA_984584B6-A60A-4717-9DBD-B7C688B72566_1">
+        <bpmn2:sourceRef>todo</bpmn2:sourceRef>
+        <bpmn2:targetRef>_984584B6-A60A-4717-9DBD-B7C688B72566_todoInputX</bpmn2:targetRef>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataOutputAssociation id="DOA_984584B6-A60A-4717-9DBD-B7C688B72566_1">
+        <bpmn2:sourceRef>_984584B6-A60A-4717-9DBD-B7C688B72566_todoOutputX</bpmn2:sourceRef>
+        <bpmn2:targetRef>todo</bpmn2:targetRef>
+      </bpmn2:dataOutputAssociation>
+    </bpmn2:businessRuleTask>
+    <bpmn2:startEvent id="_79F12952-8985-4241-884E-CC014F83BBD2" isInterrupting="true" name="Todo Retrieved" parallelMultiple="false">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <metaData>
+            <drools:metaValue>
+              <metaValue>
+                <![CDATA[Todo Retrieved]]>
+              </metaValue>
+            </drools:metaValue>
+          </metaData>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:outgoing>_58A609D9-BCA1-4698-A4CA-06F24DE55600</bpmn2:outgoing>
+      <bpmn2:outputSet/>
+    </bpmn2:startEvent>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram id="Yaoqiang_Diagram-todos" name="Untitled Diagram" resolution="96.0">
+    <bpmndi:BPMNPlane bpmnElement="todos">
+      <bpmndi:BPMNShape bpmnElement="_79F12952-8985-4241-884E-CC014F83BBD2" id="Yaoqiang-_79F12952-8985-4241-884E-CC014F83BBD2">
+        <dc:Bounds height="32.0" width="32.0" x="830.0" y="287.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="18.96" width="87.0" x="802.5" y="327.52"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="_984584B6-A60A-4717-9DBD-B7C688B72566" id="Yaoqiang-_984584B6-A60A-4717-9DBD-B7C688B72566">
+        <dc:Bounds height="98.0" width="151.0" x="1019.5" y="266.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="18.96" width="70.0" x="1060.0" y="307.52"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="_6C77E5F5-C02C-44CC-B3FA-D591838B5142" id="Yaoqiang-_6C77E5F5-C02C-44CC-B3FA-D591838B5142">
+        <dc:Bounds height="32.0" width="32.0" x="1304.0" y="287.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="18.96" width="65.0" x="1287.5" y="327.52"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="_58A609D9-BCA1-4698-A4CA-06F24DE55600" id="Yaoqiang-_58A609D9-BCA1-4698-A4CA-06F24DE55600">
+        <di:waypoint x="862.0" y="303.0"/>
+        <di:waypoint x="1020.0" y="315.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="18.96" width="6.0" x="937.75" y="299.77"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="_6164E4B2-6B78-4C93-A193-D0B49B239EC5" id="Yaoqiang-_6164E4B2-6B78-4C93-A193-D0B49B239EC5">
+        <di:waypoint x="1171.0" y="315.0"/>
+        <di:waypoint x="1304.0" y="303.0"/>
+        <bpmndi:BPMNLabel>
+          <dc:Bounds height="18.96" width="6.0" x="1234.25" y="299.27"/>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/todo-service-kogito/src/main/resources/dev/unexist/showcase/todo/todo.drl	Mon Jul 19 16:08:57 2021 +0200
@@ -0,0 +1,13 @@
+package dev.unexist.showcase.todo.adapter;
+dialect  "mvel"
+
+import dev.unexist.showcase.todo.domain.todo.TodoBase;
+
+rule "isDone" ruleflow-group "todo"
+    when
+        $todo: TodoBase(done != true)
+    then
+        modify($todo) {
+            setDone(true)
+        }
+end
--- a/todo-service-kogito/src/main/resources/todo.bpmn	Mon Jul 19 16:08:32 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0aui0ws" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1">
-  <bpmn:process id="todo" name="Todo" isExecutable="true" camunda:versionTag="0.1">
-    <bpmn:startEvent id="StartEvent_1" name="Todo Retrieved">
-      <bpmn:outgoing>SequenceFlow_1p2szow</bpmn:outgoing>
-    </bpmn:startEvent>
-    <bpmn:serviceTask id="Task_19pt1nu" name="Tally Todo " camunda:class="dev.unexist.showcase.todo.adapter.tasks.CamundaTodoTallyTask">
-      <bpmn:incoming>SequenceFlow_04u8b2b</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1axd8hr</bpmn:outgoing>
-    </bpmn:serviceTask>
-    <bpmn:endEvent id="EndEvent_1oyw02k" name="Todo Done">
-      <bpmn:incoming>SequenceFlow_1axd8hr</bpmn:incoming>
-    </bpmn:endEvent>
-    <bpmn:sequenceFlow id="SequenceFlow_1axd8hr" sourceRef="Task_19pt1nu" targetRef="EndEvent_1oyw02k" />
-    <bpmn:serviceTask id="Task_0q4zvgp" name="Check Todo" camunda:delegateExpression="${camundaTodoCheckTask}">
-      <bpmn:incoming>SequenceFlow_1p2szow</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_04u8b2b</bpmn:outgoing>
-    </bpmn:serviceTask>
-    <bpmn:sequenceFlow id="SequenceFlow_1p2szow" sourceRef="StartEvent_1" targetRef="Task_0q4zvgp" />
-    <bpmn:sequenceFlow id="SequenceFlow_04u8b2b" sourceRef="Task_0q4zvgp" targetRef="Task_19pt1nu" />
-  </bpmn:process>
-  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
-    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="todo">
-      <bpmndi:BPMNEdge id="SequenceFlow_04u8b2b_di" bpmnElement="SequenceFlow_04u8b2b">
-        <di:waypoint x="410" y="119" />
-        <di:waypoint x="480" y="119" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1p2szow_di" bpmnElement="SequenceFlow_1p2szow">
-        <di:waypoint x="200" y="119" />
-        <di:waypoint x="310" y="119" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1axd8hr_di" bpmnElement="SequenceFlow_1axd8hr">
-        <di:waypoint x="580" y="119" />
-        <di:waypoint x="662" y="119" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="345.5" y="98.5" width="90" height="13" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
-        <dc:Bounds x="164" y="101" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="145" y="137" width="74" height="14" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_17yjgnl_di" bpmnElement="Task_19pt1nu">
-        <dc:Bounds x="480" y="79" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="EndEvent_1oyw02k_di" bpmnElement="EndEvent_1oyw02k">
-        <dc:Bounds x="662" y="101" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="654" y="147" width="54" height="14" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_1m8bv3v_di" bpmnElement="Task_0q4zvgp">
-        <dc:Bounds x="310" y="79" width="100" height="80" />
-      </bpmndi:BPMNShape>
-    </bpmndi:BPMNPlane>
-  </bpmndi:BPMNDiagram>
-</bpmn:definitions>
--- a/todo-service-kogito/src/main/resources/todo.drl	Mon Jul 19 16:08:32 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package dev.unexist.showcase.todo.adapter;
-dialect  "mvel"
-
-import dev.unexist.showcase.todo.domain.todo.TodoBase;
-
-rule "isDone" ruleflow-group "todo"
-    when
-        $todo: TodoBase(2 > 1)
-    then
-        modify($todo) {
-            setDone(true)
-        }
-end