@5minds/node-red-contrib-processcube 0.15.0 → 1.0.0-feature-b9c700-lz1po3cl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/Dockerfile +2 -0
  2. package/endevent-finished-listener.html +50 -0
  3. package/endevent-finished-listener.js +52 -0
  4. package/examples/Definition-Query-Sample.json +215 -0
  5. package/examples/External-Task-Sample.json +142 -1
  6. package/examples/Instance-Query-Sample.json +110 -0
  7. package/examples/User-Task-Sample.json +231 -0
  8. package/externaltask-error.html +11 -11
  9. package/externaltask-input.html +12 -12
  10. package/externaltask-input.js +10 -5
  11. package/externaltask-output.html +7 -7
  12. package/message-event-trigger.html +14 -2
  13. package/message-event-trigger.js +10 -9
  14. package/nodered/node-red-contrib-processcube-flows.json +364 -20
  15. package/nodered/settings.js +2 -1
  16. package/nodered/static/ProcessCube_Logo.svg +53 -0
  17. package/package.json +2 -1
  18. package/process-start.html +16 -13
  19. package/process-start.js +13 -8
  20. package/processcube-engine-config.html +16 -0
  21. package/processcube-engine-config.js +9 -13
  22. package/processdefinition-query.html +16 -2
  23. package/processdefinition-query.js +10 -21
  24. package/processes/User-Task-Sample.bpmn +57 -0
  25. package/processinstance-query.html +13 -2
  26. package/processinstance-query.js +9 -23
  27. package/signal-event-trigger.html +14 -2
  28. package/signal-event-trigger.js +9 -8
  29. package/usertask-finished-listener.html +15 -14
  30. package/usertask-finished-listener.js +16 -22
  31. package/usertask-input.html +15 -2
  32. package/usertask-input.js +18 -41
  33. package/usertask-new-listener.html +15 -14
  34. package/usertask-new-listener.js +18 -24
  35. package/usertask-output.html +13 -2
  36. package/usertask-output.js +10 -19
  37. package/processes/GetProcessModels.bpmn +0 -58
  38. package/processes/HelloWorld.bpmn +0 -124
@@ -1,25 +1,7 @@
1
- const process = require('process');
2
- const EventEmitter = require('node:events');
3
-
4
- const engine_client = require('@5minds/processcube_engine_client');
5
-
6
1
  module.exports = function (RED) {
7
2
  function UserTaskOutput(config) {
8
3
  RED.nodes.createNode(this, config);
9
-
10
4
  var node = this;
11
- var flowContext = node.context().flow;
12
-
13
- this.engine = this.server = RED.nodes.getNode(config.engine);
14
-
15
- const client = this.engine.getEngineClient();
16
-
17
- var eventEmitter = flowContext.get('emitter');
18
-
19
- if (!eventEmitter) {
20
- flowContext.set('emitter', new EventEmitter());
21
- eventEmitter = flowContext.get('emitter');
22
- }
23
5
 
24
6
  node.on('input', function (msg) {
25
7
  if (msg.payload.userTask) {
@@ -27,8 +9,17 @@ module.exports = function (RED) {
27
9
 
28
10
  const userTaskResult = RED.util.evaluateNodeProperty(config.result, config.result_type, node, msg);
29
11
 
12
+ const engine = RED.nodes.getNode(config.engine);
13
+
14
+ const client = engine.engineClient;
15
+
16
+ if (!client) {
17
+ node.error('No engine configured.');
18
+ return;
19
+ }
20
+
30
21
  client.userTasks
31
- .finishUserTask(flowNodeInstanceId, userTaskResult, node.server.identity)
22
+ .finishUserTask(flowNodeInstanceId, userTaskResult, engine.identity)
32
23
  .then(() => {
33
24
  node.send(msg);
34
25
  })
@@ -1,58 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <bpmn:definitions xmlns:bpmn="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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="GetProcessModels_Definition" targetNamespace="http://bpmn.io/schema/bpmn" exporter="5Minds Studio" exporterVersion="1">
3
- <bpmn:collaboration id="Collaboration_1cidyxu" name="">
4
- <bpmn:participant id="Participant_0px403d" name="GetProcessModels" processRef="GetProcessModels_Process" />
5
- </bpmn:collaboration>
6
- <bpmn:process id="GetProcessModels_Process" name="GetProcessModels" isExecutable="true">
7
- <bpmn:laneSet>
8
- <bpmn:lane id="Lane_1xzf0d3" name="Lane">
9
- <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
10
- <bpmn:flowNodeRef>Event_1g0ul5l</bpmn:flowNodeRef>
11
- <bpmn:flowNodeRef>Activity_1p86o1j</bpmn:flowNodeRef>
12
- </bpmn:lane>
13
- </bpmn:laneSet>
14
- <bpmn:startEvent id="StartEvent_1" name="Start">
15
- <bpmn:outgoing>Flow_19aohpj</bpmn:outgoing>
16
- </bpmn:startEvent>
17
- <bpmn:sequenceFlow id="Flow_19aohpj" sourceRef="StartEvent_1" targetRef="Activity_1p86o1j" />
18
- <bpmn:sequenceFlow id="Flow_1in3mpt" sourceRef="Activity_1p86o1j" targetRef="Event_1g0ul5l" />
19
- <bpmn:endEvent id="Event_1g0ul5l">
20
- <bpmn:incoming>Flow_1in3mpt</bpmn:incoming>
21
- </bpmn:endEvent>
22
- <bpmn:serviceTask id="Activity_1p86o1j" name="get processmodels" camunda:type="external" camunda:topic="processmodels">
23
- <bpmn:incoming>Flow_19aohpj</bpmn:incoming>
24
- <bpmn:outgoing>Flow_1in3mpt</bpmn:outgoing>
25
- </bpmn:serviceTask>
26
- </bpmn:process>
27
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
28
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
29
- <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
30
- <dc:Bounds x="5" y="4" width="885" height="346" />
31
- </bpmndi:BPMNShape>
32
- <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
33
- <dc:Bounds x="35" y="4" width="855" height="346" />
34
- </bpmndi:BPMNShape>
35
- <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
36
- <dc:Bounds x="92" y="152" width="36" height="36" />
37
- <bpmndi:BPMNLabel>
38
- <dc:Bounds x="98" y="195" width="24" height="14" />
39
- </bpmndi:BPMNLabel>
40
- </bpmndi:BPMNShape>
41
- <bpmndi:BPMNShape id="Event_1g0ul5l_di" bpmnElement="Event_1g0ul5l">
42
- <dc:Bounds x="672" y="152" width="36" height="36" />
43
- </bpmndi:BPMNShape>
44
- <bpmndi:BPMNShape id="Activity_0o89lb3_di" bpmnElement="Activity_1p86o1j">
45
- <dc:Bounds x="360" y="130" width="100" height="80" />
46
- <bpmndi:BPMNLabel />
47
- </bpmndi:BPMNShape>
48
- <bpmndi:BPMNEdge id="Flow_19aohpj_di" bpmnElement="Flow_19aohpj">
49
- <di:waypoint x="128" y="170" />
50
- <di:waypoint x="360" y="170" />
51
- </bpmndi:BPMNEdge>
52
- <bpmndi:BPMNEdge id="Flow_1in3mpt_di" bpmnElement="Flow_1in3mpt">
53
- <di:waypoint x="460" y="170" />
54
- <di:waypoint x="672" y="170" />
55
- </bpmndi:BPMNEdge>
56
- </bpmndi:BPMNPlane>
57
- </bpmndi:BPMNDiagram>
58
- </bpmn:definitions>
@@ -1,124 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <bpmn:definitions xmlns:bpmn="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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="HelloWorld_Definition" targetNamespace="http://bpmn.io/schema/bpmn" exporter="5Minds Studio" exporterVersion="1">
3
- <bpmn:collaboration id="Collaboration_1cidyxu" name="">
4
- <bpmn:participant id="Participant_0px403d" name="HelloWorld" processRef="HelloWorld_Process" />
5
- </bpmn:collaboration>
6
- <bpmn:process id="HelloWorld_Process" name="HelloWorld" isExecutable="true">
7
- <bpmn:laneSet>
8
- <bpmn:lane id="Lane_1xzf0d3" name="Lane">
9
- <bpmn:extensionElements>
10
- <camunda:properties>
11
- <camunda:property name="datastore" value="localDB" />
12
- </camunda:properties>
13
- </bpmn:extensionElements>
14
- <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
15
- <bpmn:flowNodeRef>StartEvent_2</bpmn:flowNodeRef>
16
- <bpmn:flowNodeRef>Event_098kcno</bpmn:flowNodeRef>
17
- <bpmn:flowNodeRef>Event_1dke00u</bpmn:flowNodeRef>
18
- <bpmn:flowNodeRef>Activity_0qfd2qf</bpmn:flowNodeRef>
19
- </bpmn:lane>
20
- </bpmn:laneSet>
21
- <bpmn:sequenceFlow id="Flow_0gyaiob" sourceRef="StartEvent_1" targetRef="Activity_0qfd2qf" />
22
- <bpmn:sequenceFlow id="Flow_1vz3m6d" sourceRef="Activity_0qfd2qf" targetRef="Event_1dke00u" />
23
- <bpmn:startEvent id="StartEvent_1" name="StartEvent_1">
24
- <bpmn:outgoing>Flow_0gyaiob</bpmn:outgoing>
25
- </bpmn:startEvent>
26
- <bpmn:startEvent id="StartEvent_2" name="StartEvent_2">
27
- <bpmn:outgoing>Flow_02bhdfx</bpmn:outgoing>
28
- </bpmn:startEvent>
29
- <bpmn:sequenceFlow id="Flow_02bhdfx" sourceRef="StartEvent_2" targetRef="Activity_0qfd2qf" />
30
- <bpmn:endEvent id="Event_098kcno">
31
- <bpmn:incoming>Flow_020xdqk</bpmn:incoming>
32
- </bpmn:endEvent>
33
- <bpmn:sequenceFlow id="Flow_020xdqk" sourceRef="Event_1dke00u" targetRef="Event_098kcno" />
34
- <bpmn:intermediateThrowEvent id="Event_1dke00u">
35
- <bpmn:incoming>Flow_1vz3m6d</bpmn:incoming>
36
- <bpmn:outgoing>Flow_020xdqk</bpmn:outgoing>
37
- <bpmn:messageEventDefinition id="MessageEventDefinition_02r4uyb" messageRef="Message_2MNRTsHm" />
38
- </bpmn:intermediateThrowEvent>
39
- <bpmn:userTask id="Activity_0qfd2qf">
40
- <bpmn:extensionElements>
41
- <camunda:formData>
42
- <camunda:formField id="FormField_c61nPzPh" type="string" />
43
- </camunda:formData>
44
- </bpmn:extensionElements>
45
- <bpmn:incoming>Flow_0gyaiob</bpmn:incoming>
46
- <bpmn:incoming>Flow_02bhdfx</bpmn:incoming>
47
- <bpmn:outgoing>Flow_1vz3m6d</bpmn:outgoing>
48
- <bpmn:property id="Property_0eew054" name="__targetRef_placeholder" />
49
- <bpmn:dataInputAssociation id="DataInputAssociation_05huqd1">
50
- <bpmn:sourceRef>DataStoreReference_12d82du</bpmn:sourceRef>
51
- <bpmn:targetRef>Property_0eew054</bpmn:targetRef>
52
- </bpmn:dataInputAssociation>
53
- <bpmn:dataOutputAssociation id="DataOutputAssociation_0q4exvn">
54
- <bpmn:targetRef>DataStoreReference_12d82du</bpmn:targetRef>
55
- </bpmn:dataOutputAssociation>
56
- </bpmn:userTask>
57
- <bpmn:dataStoreReference id="DataStoreReference_12d82du" />
58
- </bpmn:process>
59
- <bpmn:message id="Message_2MNRTsHm" name="HelloWorld" />
60
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
61
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
62
- <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
63
- <dc:Bounds x="5" y="4" width="885" height="346" />
64
- </bpmndi:BPMNShape>
65
- <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
66
- <dc:Bounds x="35" y="4" width="855" height="346" />
67
- </bpmndi:BPMNShape>
68
- <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
69
- <dc:Bounds x="92" y="82" width="36" height="36" />
70
- <bpmndi:BPMNLabel>
71
- <dc:Bounds x="78" y="125" width="64" height="14" />
72
- </bpmndi:BPMNLabel>
73
- </bpmndi:BPMNShape>
74
- <bpmndi:BPMNShape id="Event_0okqf1m_di" bpmnElement="StartEvent_2">
75
- <dc:Bounds x="92" y="222" width="36" height="36" />
76
- <bpmndi:BPMNLabel>
77
- <dc:Bounds x="79" y="265" width="64" height="14" />
78
- </bpmndi:BPMNLabel>
79
- </bpmndi:BPMNShape>
80
- <bpmndi:BPMNShape id="Event_098kcno_di" bpmnElement="Event_098kcno">
81
- <dc:Bounds x="472" y="152" width="36" height="36" />
82
- </bpmndi:BPMNShape>
83
- <bpmndi:BPMNShape id="Event_00n3l3p_di" bpmnElement="Event_1dke00u">
84
- <dc:Bounds x="352" y="152" width="36" height="36" />
85
- </bpmndi:BPMNShape>
86
- <bpmndi:BPMNShape id="Activity_0jhqvza_di" bpmnElement="Activity_0qfd2qf">
87
- <dc:Bounds x="180" y="130" width="100" height="80" />
88
- </bpmndi:BPMNShape>
89
- <bpmndi:BPMNShape id="DataStoreReference_12d82du_di" bpmnElement="DataStoreReference_12d82du">
90
- <dc:Bounds x="215" y="265" width="50" height="50" />
91
- </bpmndi:BPMNShape>
92
- <bpmndi:BPMNEdge id="Flow_0gyaiob_di" bpmnElement="Flow_0gyaiob">
93
- <di:waypoint x="128" y="100" />
94
- <di:waypoint x="154" y="100" />
95
- <di:waypoint x="154" y="170" />
96
- <di:waypoint x="180" y="170" />
97
- </bpmndi:BPMNEdge>
98
- <bpmndi:BPMNEdge id="Flow_1vz3m6d_di" bpmnElement="Flow_1vz3m6d">
99
- <di:waypoint x="280" y="170" />
100
- <di:waypoint x="352" y="170" />
101
- </bpmndi:BPMNEdge>
102
- <bpmndi:BPMNEdge id="Flow_02bhdfx_di" bpmnElement="Flow_02bhdfx">
103
- <di:waypoint x="128" y="240" />
104
- <di:waypoint x="154" y="240" />
105
- <di:waypoint x="154" y="170" />
106
- <di:waypoint x="180" y="170" />
107
- </bpmndi:BPMNEdge>
108
- <bpmndi:BPMNEdge id="Flow_020xdqk_di" bpmnElement="Flow_020xdqk">
109
- <di:waypoint x="388" y="170" />
110
- <di:waypoint x="472" y="170" />
111
- </bpmndi:BPMNEdge>
112
- <bpmndi:BPMNEdge id="DataInputAssociation_05huqd1_di" bpmnElement="DataInputAssociation_05huqd1">
113
- <di:waypoint x="225" y="265" />
114
- <di:waypoint x="210" y="240" />
115
- <di:waypoint x="219" y="210" />
116
- </bpmndi:BPMNEdge>
117
- <bpmndi:BPMNEdge id="DataOutputAssociation_0q4exvn_di" bpmnElement="DataOutputAssociation_0q4exvn">
118
- <di:waypoint x="250" y="210" />
119
- <di:waypoint x="260" y="230" />
120
- <di:waypoint x="250" y="265" />
121
- </bpmndi:BPMNEdge>
122
- </bpmndi:BPMNPlane>
123
- </bpmndi:BPMNDiagram>
124
- </bpmn:definitions>