@5minds/node-red-contrib-processcube 0.14.0-feature-7cec87-lyytfjz9 → 0.14.0-fix-error-in-process-instance-query-9aeac9-lyzi0gix

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.prettierrc.json +6 -0
  2. package/Dockerfile +1 -1
  3. package/docker-compose.yml +0 -12
  4. package/externaltask-error.html +12 -26
  5. package/externaltask-error.js +20 -19
  6. package/externaltask-input.html +14 -31
  7. package/externaltask-input.js +55 -107
  8. package/externaltask-output.html +10 -20
  9. package/externaltask-output.js +11 -12
  10. package/message-event-trigger.html +14 -14
  11. package/message-event-trigger.js +21 -25
  12. package/nodered/node-red-contrib-processcube-flows.json +132 -216
  13. package/nodered/package.json +0 -1
  14. package/nodered/settings.js +82 -92
  15. package/package.json +9 -3
  16. package/process-start.html +19 -23
  17. package/process-start.js +18 -18
  18. package/processcube-engine-config.html +10 -10
  19. package/processcube-engine-config.js +22 -30
  20. package/processdefinition-query.html +29 -23
  21. package/processdefinition-query.js +12 -16
  22. package/processes/CheckError.bpmn +78 -0
  23. package/processes/NodeRedExternalTask.bpmn +77 -0
  24. package/processes/SampleUserTask.bpmn +95 -0
  25. package/processinstance-query.html +19 -20
  26. package/processinstance-query.js +17 -12
  27. package/signal-event-trigger.html +14 -14
  28. package/signal-event-trigger.js +21 -25
  29. package/usertask-finished-listener.html +17 -12
  30. package/usertask-finished-listener.js +34 -16
  31. package/usertask-input.html +40 -27
  32. package/usertask-input.js +19 -18
  33. package/usertask-new-listener.html +17 -12
  34. package/usertask-new-listener.js +35 -18
  35. package/usertask-output.html +23 -24
  36. package/usertask-output.js +12 -12
  37. package/examples/External-Task-Sample.json +0 -252
  38. package/processes/External-Task-Sample.bpmn +0 -94
@@ -3,52 +3,58 @@
3
3
  category: 'ProcessCube',
4
4
  color: '#02AFD6',
5
5
  defaults: {
6
- name: {value: ""},
7
- engine: {value: "", type: "processcube-engine-config"},
8
- query: {value: "payload"},
9
- query_type: {value: "msg"},
10
- models_only: {value: false},
6
+ name: { value: '' },
7
+ engine: { value: '', type: 'processcube-engine-config' },
8
+ query: { value: 'payload' },
9
+ query_type: { value: 'msg' },
10
+ models_only: { value: false },
11
11
  },
12
12
  inputs: 1,
13
13
  outputs: 1,
14
- icon: "font-awesome/fa-envelope-open",
15
- label: function() {
16
- return this.name || "processdefinition-query";
14
+ icon: 'font-awesome/fa-envelope-open',
15
+ label: function () {
16
+ return this.name || 'processdefinition-query';
17
17
  },
18
- oneditprepare: function() {
19
- $("#node-input-query").typedInput({
18
+ oneditprepare: function () {
19
+ $('#node-input-query').typedInput({
20
20
  default: 'msg',
21
- types: ['msg', 'json']
21
+ types: ['msg', 'json'],
22
22
  });
23
23
 
24
- $("#node-input-query").typedInput('value', this.query);
25
- $("#node-input-query").typedInput('type', this.query_type);
24
+ $('#node-input-query').typedInput('value', this.query);
25
+ $('#node-input-query').typedInput('type', this.query_type);
26
+ },
27
+ oneditsave: function () {
28
+ (this.query = $('#node-input-query').typedInput('value')),
29
+ (this.query_type = $('#node-input-query').typedInput('type'));
26
30
  },
27
- oneditsave: function() {
28
- this.query = $("#node-input-query").typedInput('value'),
29
- this.query_type = $("#node-input-query").typedInput('type')
30
-
31
- }
32
31
  });
33
32
  </script>
34
33
 
35
34
  <script type="text/html" data-template-name="processdefinition-query">
36
35
  <div class="form-row">
37
36
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
38
- <input type="text" id="node-input-name" placeholder="Name">
37
+ <input type="text" id="node-input-name" placeholder="Name" />
39
38
  </div>
40
39
  <div class="form-row">
41
40
  <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
42
- <input type="text" id="node-input-engine" placeholder="http://engine:8000">
41
+ <input type="text" id="node-input-engine" placeholder="http://engine:8000" />
43
42
  </div>
44
43
  <div class="form-row">
45
44
  <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
46
- <input type="text" id="node-input-query">
45
+ <input type="text" id="node-input-query" />
47
46
  </div>
48
47
  <div class="form-row" style="display:flex; margin-bottom: 3px;">
49
- <label for="node-input-models_only" style="vertical-align:top"><i class="fa fa-list-alt"></i> Models Only</label>
48
+ <label for="node-input-models_only" style="vertical-align:top"
49
+ ><i class="fa fa-list-alt"></i> Models Only</label
50
+ >
50
51
  <div>
51
- <input type="checkbox" checked id="node-input-models_only" style="display: inline-block; width: auto; margin: 0px 0px 0px 4px;">
52
+ <input
53
+ type="checkbox"
54
+ checked
55
+ id="node-input-models_only"
56
+ style="display: inline-block; width: auto; margin: 0px 0px 0px 4px;"
57
+ />
52
58
  <label style="width:auto" for="node-input-models_only">Only send models as result.</label>
53
59
  </div>
54
60
  </div>
@@ -3,9 +3,9 @@ const EventEmitter = require('node:events');
3
3
 
4
4
  const engine_client = require('@5minds/processcube_engine_client');
5
5
 
6
- module.exports = function(RED) {
6
+ module.exports = function (RED) {
7
7
  function ProcessdefinitionQuery(config) {
8
- RED.nodes.createNode(this,config);
8
+ RED.nodes.createNode(this, config);
9
9
  var node = this;
10
10
  var flowContext = node.context().flow;
11
11
  var nodeContext = node.context();
@@ -28,43 +28,39 @@ module.exports = function(RED) {
28
28
  eventEmitter = flowContext.get('emitter');
29
29
  }
30
30
 
31
- node.on("close", async () => {
31
+ node.on('close', async () => {
32
32
  client.dispose();
33
33
  client = null;
34
34
  });
35
35
 
36
- node.on('input', function(msg) {
37
- let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg)
36
+ node.on('input', function (msg) {
37
+ let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
38
38
  query = {
39
39
  ...query,
40
- identity: node.server.identity
40
+ identity: node.server.identity,
41
41
  };
42
-
43
- client.processDefinitions.getAll(query).then((matchingProcessDefinitions) => {
44
42
 
45
-
43
+ client.processDefinitions.getAll(query).then((matchingProcessDefinitions) => {
46
44
  if (config.models_only && matchingProcessDefinitions.totalCount > 0) {
47
45
  let models = [];
48
46
 
49
- matchingProcessDefinitions.processDefinitions.forEach(processDefinition => {
50
- processDefinition.processModels.forEach(model => {
47
+ matchingProcessDefinitions.processDefinitions.forEach((processDefinition) => {
48
+ processDefinition.processModels.forEach((model) => {
51
49
  models.push(model);
52
50
  });
53
51
  });
54
52
 
55
53
  msg.payload = {
56
54
  models: models,
57
- totalCount: models.length
55
+ totalCount: models.length,
58
56
  };
59
-
60
57
  } else {
61
58
  msg.payload = matchingProcessDefinitions;
62
59
  }
63
60
 
64
-
65
61
  node.send(msg);
66
62
  });
67
63
  });
68
64
  }
69
- RED.nodes.registerType("processdefinition-query", ProcessdefinitionQuery);
70
- }
65
+ RED.nodes.registerType('processdefinition-query', ProcessdefinitionQuery);
66
+ };
@@ -0,0 +1,78 @@
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="CheckError_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="CheckError" processRef="CheckError_Process" />
5
+ </bpmn:collaboration>
6
+ <bpmn:process id="CheckError_Process" name="CheckError" isExecutable="true">
7
+ <bpmn:laneSet>
8
+ <bpmn:lane id="Lane_1xzf0d3" name="Lane">
9
+ <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
10
+ <bpmn:flowNodeRef>Event_0kmuys0</bpmn:flowNodeRef>
11
+ <bpmn:flowNodeRef>Activity_09zn4t5</bpmn:flowNodeRef>
12
+ <bpmn:flowNodeRef>Event_1gy657v</bpmn:flowNodeRef>
13
+ <bpmn:flowNodeRef>Event_1w4tivm</bpmn:flowNodeRef>
14
+ </bpmn:lane>
15
+ </bpmn:laneSet>
16
+ <bpmn:startEvent id="StartEvent_1" name="Start">
17
+ <bpmn:outgoing>Flow_14izvt0</bpmn:outgoing>
18
+ </bpmn:startEvent>
19
+ <bpmn:sequenceFlow id="Flow_14izvt0" sourceRef="StartEvent_1" targetRef="Activity_09zn4t5" />
20
+ <bpmn:endEvent id="Event_0kmuys0">
21
+ <bpmn:incoming>Flow_1ukmuxb</bpmn:incoming>
22
+ </bpmn:endEvent>
23
+ <bpmn:sequenceFlow id="Flow_1ukmuxb" sourceRef="Activity_09zn4t5" targetRef="Event_0kmuys0" />
24
+ <bpmn:serviceTask id="Activity_09zn4t5" name="ETW with error" camunda:type="external" camunda:topic="SampleError">
25
+ <bpmn:incoming>Flow_14izvt0</bpmn:incoming>
26
+ <bpmn:outgoing>Flow_1ukmuxb</bpmn:outgoing>
27
+ </bpmn:serviceTask>
28
+ <bpmn:sequenceFlow id="Flow_0tgf785" sourceRef="Event_1w4tivm" targetRef="Event_1gy657v" />
29
+ <bpmn:endEvent id="Event_1gy657v">
30
+ <bpmn:incoming>Flow_0tgf785</bpmn:incoming>
31
+ </bpmn:endEvent>
32
+ <bpmn:boundaryEvent id="Event_1w4tivm" attachedToRef="Activity_09zn4t5">
33
+ <bpmn:outgoing>Flow_0tgf785</bpmn:outgoing>
34
+ <bpmn:errorEventDefinition id="ErrorEventDefinition_0nesf0j" />
35
+ </bpmn:boundaryEvent>
36
+ </bpmn:process>
37
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
38
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
39
+ <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
40
+ <dc:Bounds x="5" y="4" width="525" height="346" />
41
+ </bpmndi:BPMNShape>
42
+ <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
43
+ <dc:Bounds x="35" y="4" width="495" height="346" />
44
+ </bpmndi:BPMNShape>
45
+ <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
46
+ <dc:Bounds x="92" y="152" width="36" height="36" />
47
+ <bpmndi:BPMNLabel>
48
+ <dc:Bounds x="98" y="195" width="24" height="14" />
49
+ </bpmndi:BPMNLabel>
50
+ </bpmndi:BPMNShape>
51
+ <bpmndi:BPMNShape id="Event_0kmuys0_di" bpmnElement="Event_0kmuys0">
52
+ <dc:Bounds x="332" y="152" width="36" height="36" />
53
+ </bpmndi:BPMNShape>
54
+ <bpmndi:BPMNShape id="Activity_04h2kr7_di" bpmnElement="Activity_09zn4t5">
55
+ <dc:Bounds x="180" y="130" width="100" height="80" />
56
+ </bpmndi:BPMNShape>
57
+ <bpmndi:BPMNShape id="Event_1gy657v_di" bpmnElement="Event_1gy657v">
58
+ <dc:Bounds x="362" y="272" width="36" height="36" />
59
+ </bpmndi:BPMNShape>
60
+ <bpmndi:BPMNShape id="Event_0s7ur9g_di" bpmnElement="Event_1w4tivm">
61
+ <dc:Bounds x="222" y="192" width="36" height="36" />
62
+ </bpmndi:BPMNShape>
63
+ <bpmndi:BPMNEdge id="Flow_14izvt0_di" bpmnElement="Flow_14izvt0">
64
+ <di:waypoint x="128" y="170" />
65
+ <di:waypoint x="180" y="170" />
66
+ </bpmndi:BPMNEdge>
67
+ <bpmndi:BPMNEdge id="Flow_1ukmuxb_di" bpmnElement="Flow_1ukmuxb">
68
+ <di:waypoint x="280" y="170" />
69
+ <di:waypoint x="332" y="170" />
70
+ </bpmndi:BPMNEdge>
71
+ <bpmndi:BPMNEdge id="Flow_0tgf785_di" bpmnElement="Flow_0tgf785">
72
+ <di:waypoint x="240" y="228" />
73
+ <di:waypoint x="240" y="290" />
74
+ <di:waypoint x="362" y="290" />
75
+ </bpmndi:BPMNEdge>
76
+ </bpmndi:BPMNPlane>
77
+ </bpmndi:BPMNDiagram>
78
+ </bpmn:definitions>
@@ -0,0 +1,77 @@
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="NodeRedExternalTask_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="NodeRedExternalTask" processRef="NodeRedExternalTask_Process" />
5
+ </bpmn:collaboration>
6
+ <bpmn:process id="NodeRedExternalTask_Process" name="NodeRedExternalTask" isExecutable="true">
7
+ <bpmn:laneSet>
8
+ <bpmn:lane id="Lane_1xzf0d3">
9
+ <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
10
+ <bpmn:flowNodeRef>Activity_1h843f0</bpmn:flowNodeRef>
11
+ <bpmn:flowNodeRef>Activity_1duxvq1</bpmn:flowNodeRef>
12
+ <bpmn:flowNodeRef>Event_0z1wtnd</bpmn:flowNodeRef>
13
+ </bpmn:lane>
14
+ </bpmn:laneSet>
15
+ <bpmn:startEvent id="StartEvent_1" name="Start">
16
+ <bpmn:outgoing>Flow_1xfzejj</bpmn:outgoing>
17
+ </bpmn:startEvent>
18
+ <bpmn:sequenceFlow id="Flow_1xfzejj" sourceRef="StartEvent_1" targetRef="Activity_1h843f0" />
19
+ <bpmn:serviceTask id="Activity_1h843f0" name="Node Red Flow" camunda:type="external" camunda:topic="Test">
20
+ <bpmn:extensionElements>
21
+ <camunda:properties>
22
+ <camunda:property name="payload" value="{&#10; test: 1&#10;}" />
23
+ </camunda:properties>
24
+ </bpmn:extensionElements>
25
+ <bpmn:incoming>Flow_1xfzejj</bpmn:incoming>
26
+ <bpmn:outgoing>Flow_110cohh</bpmn:outgoing>
27
+ </bpmn:serviceTask>
28
+ <bpmn:sequenceFlow id="Flow_110cohh" sourceRef="Activity_1h843f0" targetRef="Activity_1duxvq1" />
29
+ <bpmn:serviceTask id="Activity_1duxvq1" name="SampleError" camunda:type="external" camunda:topic="SampleError">
30
+ <bpmn:incoming>Flow_110cohh</bpmn:incoming>
31
+ <bpmn:outgoing>Flow_1u1afua</bpmn:outgoing>
32
+ </bpmn:serviceTask>
33
+ <bpmn:sequenceFlow id="Flow_1u1afua" sourceRef="Activity_1duxvq1" targetRef="Event_0z1wtnd" />
34
+ <bpmn:endEvent id="Event_0z1wtnd">
35
+ <bpmn:incoming>Flow_1u1afua</bpmn:incoming>
36
+ </bpmn:endEvent>
37
+ </bpmn:process>
38
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
39
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
40
+ <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
41
+ <dc:Bounds x="5" y="4" width="695" height="346" />
42
+ </bpmndi:BPMNShape>
43
+ <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
44
+ <dc:Bounds x="35" y="4" width="665" height="346" />
45
+ </bpmndi:BPMNShape>
46
+ <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
47
+ <dc:Bounds x="92" y="152" width="36" height="36" />
48
+ <bpmndi:BPMNLabel>
49
+ <dc:Bounds x="98" y="195" width="24" height="14" />
50
+ </bpmndi:BPMNLabel>
51
+ </bpmndi:BPMNShape>
52
+ <bpmndi:BPMNShape id="Activity_0sg2du2_di" bpmnElement="Activity_1h843f0">
53
+ <dc:Bounds x="180" y="130" width="100" height="80" />
54
+ <bpmndi:BPMNLabel />
55
+ </bpmndi:BPMNShape>
56
+ <bpmndi:BPMNShape id="Activity_1ohliek_di" bpmnElement="Activity_1duxvq1">
57
+ <dc:Bounds x="370" y="130" width="100" height="80" />
58
+ <bpmndi:BPMNLabel />
59
+ </bpmndi:BPMNShape>
60
+ <bpmndi:BPMNShape id="Event_0z1wtnd_di" bpmnElement="Event_0z1wtnd">
61
+ <dc:Bounds x="562" y="152" width="36" height="36" />
62
+ </bpmndi:BPMNShape>
63
+ <bpmndi:BPMNEdge id="Flow_1xfzejj_di" bpmnElement="Flow_1xfzejj">
64
+ <di:waypoint x="128" y="170" />
65
+ <di:waypoint x="180" y="170" />
66
+ </bpmndi:BPMNEdge>
67
+ <bpmndi:BPMNEdge id="Flow_110cohh_di" bpmnElement="Flow_110cohh">
68
+ <di:waypoint x="280" y="170" />
69
+ <di:waypoint x="370" y="170" />
70
+ </bpmndi:BPMNEdge>
71
+ <bpmndi:BPMNEdge id="Flow_1u1afua_di" bpmnElement="Flow_1u1afua">
72
+ <di:waypoint x="470" y="170" />
73
+ <di:waypoint x="562" y="170" />
74
+ </bpmndi:BPMNEdge>
75
+ </bpmndi:BPMNPlane>
76
+ </bpmndi:BPMNDiagram>
77
+ </bpmn:definitions>
@@ -0,0 +1,95 @@
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="SampleUserTask_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="SampleUserTask" processRef="SampleUserTask_Process" />
5
+ </bpmn:collaboration>
6
+ <bpmn:process id="SampleUserTask_Process" name="SampleUserTask" isExecutable="true">
7
+ <bpmn:laneSet>
8
+ <bpmn:lane id="Lane_1xzf0d3" name="Lane">
9
+ <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
10
+ <bpmn:flowNodeRef>Activity_0ljiko7</bpmn:flowNodeRef>
11
+ <bpmn:flowNodeRef>Event_1eeiwx4</bpmn:flowNodeRef>
12
+ <bpmn:flowNodeRef>Activity_0glvmjk</bpmn:flowNodeRef>
13
+ </bpmn:lane>
14
+ </bpmn:laneSet>
15
+ <bpmn:startEvent id="StartEvent_1" name="Start">
16
+ <bpmn:extensionElements>
17
+ <camunda:properties>
18
+ <camunda:property name="studio.defaultCustomStartToken" value="{&#10; &#34;sample&#34;: &#34;hello&#34;&#10;}" />
19
+ </camunda:properties>
20
+ </bpmn:extensionElements>
21
+ <bpmn:outgoing>Flow_1h0giih</bpmn:outgoing>
22
+ </bpmn:startEvent>
23
+ <bpmn:sequenceFlow id="Flow_1h0giih" sourceRef="StartEvent_1" targetRef="Activity_0ljiko7" />
24
+ <bpmn:userTask id="Activity_0ljiko7" name="Hello world">
25
+ <bpmn:extensionElements>
26
+ <camunda:formData>
27
+ <camunda:formField id="text_id" label="Text Label" type="string" />
28
+ <camunda:formField id="number_id" label="Number Label" type="long" defaultValue="${token.current.sample}" customForm="{&#34;hint&#34;:&#34;Sample&#34;}" />
29
+ <camunda:formField id="date_id" label="Date Label" type="date" />
30
+ <camunda:formField id="select_id" label="Select Label" type="enum">
31
+ <camunda:value id="value_01" name="Value 01" />
32
+ <camunda:value id="value_02" name="Value 02" />
33
+ </camunda:formField>
34
+ <camunda:formField id="boolean_id" label="Boolean Label" type="boolean" />
35
+ </camunda:formData>
36
+ </bpmn:extensionElements>
37
+ <bpmn:incoming>Flow_1h0giih</bpmn:incoming>
38
+ <bpmn:outgoing>Flow_06e5qq4</bpmn:outgoing>
39
+ </bpmn:userTask>
40
+ <bpmn:sequenceFlow id="Flow_06e5qq4" sourceRef="Activity_0ljiko7" targetRef="Activity_0glvmjk" />
41
+ <bpmn:endEvent id="Event_1eeiwx4">
42
+ <bpmn:incoming>Flow_02dyxfy</bpmn:incoming>
43
+ </bpmn:endEvent>
44
+ <bpmn:sequenceFlow id="Flow_02dyxfy" sourceRef="Activity_0glvmjk" targetRef="Event_1eeiwx4" />
45
+ <bpmn:userTask id="Activity_0glvmjk" name="foo">
46
+ <bpmn:extensionElements>
47
+ <camunda:formData>
48
+ <camunda:formField id="FormField_BeDNcjma" label="Label 1" type="string" />
49
+ <camunda:formField id="FormField_Qv2INvg4" label="Label 2" type="string" />
50
+ </camunda:formData>
51
+ </bpmn:extensionElements>
52
+ <bpmn:incoming>Flow_06e5qq4</bpmn:incoming>
53
+ <bpmn:outgoing>Flow_02dyxfy</bpmn:outgoing>
54
+ </bpmn:userTask>
55
+ </bpmn:process>
56
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
57
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
58
+ <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
59
+ <dc:Bounds x="5" y="4" width="665" height="346" />
60
+ </bpmndi:BPMNShape>
61
+ <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
62
+ <dc:Bounds x="35" y="4" width="635" height="346" />
63
+ </bpmndi:BPMNShape>
64
+ <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
65
+ <dc:Bounds x="92" y="152" width="36" height="36" />
66
+ <bpmndi:BPMNLabel>
67
+ <dc:Bounds x="98" y="195" width="24" height="14" />
68
+ </bpmndi:BPMNLabel>
69
+ </bpmndi:BPMNShape>
70
+ <bpmndi:BPMNShape id="Activity_1uodwbi_di" bpmnElement="Activity_0ljiko7">
71
+ <dc:Bounds x="180" y="130" width="100" height="80" />
72
+ <bpmndi:BPMNLabel />
73
+ </bpmndi:BPMNShape>
74
+ <bpmndi:BPMNShape id="Event_1eeiwx4_di" bpmnElement="Event_1eeiwx4">
75
+ <dc:Bounds x="482" y="152" width="36" height="36" />
76
+ </bpmndi:BPMNShape>
77
+ <bpmndi:BPMNShape id="Activity_0vcm0z0_di" bpmnElement="Activity_0glvmjk">
78
+ <dc:Bounds x="330" y="130" width="100" height="80" />
79
+ <bpmndi:BPMNLabel />
80
+ </bpmndi:BPMNShape>
81
+ <bpmndi:BPMNEdge id="Flow_1h0giih_di" bpmnElement="Flow_1h0giih">
82
+ <di:waypoint x="128" y="170" />
83
+ <di:waypoint x="180" y="170" />
84
+ </bpmndi:BPMNEdge>
85
+ <bpmndi:BPMNEdge id="Flow_06e5qq4_di" bpmnElement="Flow_06e5qq4">
86
+ <di:waypoint x="280" y="170" />
87
+ <di:waypoint x="330" y="170" />
88
+ </bpmndi:BPMNEdge>
89
+ <bpmndi:BPMNEdge id="Flow_02dyxfy_di" bpmnElement="Flow_02dyxfy">
90
+ <di:waypoint x="430" y="170" />
91
+ <di:waypoint x="482" y="170" />
92
+ </bpmndi:BPMNEdge>
93
+ </bpmndi:BPMNPlane>
94
+ </bpmndi:BPMNDiagram>
95
+ </bpmn:definitions>
@@ -3,46 +3,45 @@
3
3
  category: 'ProcessCube',
4
4
  color: '#02AFD6',
5
5
  defaults: {
6
- name: {value: ""},
7
- engine: {value: "", type: "processcube-engine-config"},
8
- query: {value: "payload"},
9
- query_type: {value: "msg"}
6
+ name: { value: '' },
7
+ engine: { value: '', type: 'processcube-engine-config' },
8
+ query: { value: 'payload' },
9
+ query_type: { value: 'msg' },
10
10
  },
11
11
  inputs: 1,
12
12
  outputs: 1,
13
- icon: "font-awesome/fa-envelope-open",
14
- label: function() {
15
- return this.name || "processinstance-query";
13
+ icon: 'font-awesome/fa-envelope-open',
14
+ label: function () {
15
+ return this.name || 'processinstance-query';
16
16
  },
17
- oneditprepare: function() {
18
- $("#node-input-query").typedInput({
17
+ oneditprepare: function () {
18
+ $('#node-input-query').typedInput({
19
19
  default: 'msg',
20
- types: ['msg', 'json']
20
+ types: ['msg', 'json'],
21
21
  });
22
22
 
23
- $("#node-input-query").typedInput('value', this.query);
24
- $("#node-input-query").typedInput('type', this.query_type);
23
+ $('#node-input-query').typedInput('value', this.query);
24
+ $('#node-input-query').typedInput('type', this.query_type);
25
+ },
26
+ oneditsave: function () {
27
+ (this.query = $('#node-input-query').typedInput('value')),
28
+ (this.query_type = $('#node-input-query').typedInput('type'));
25
29
  },
26
- oneditsave: function() {
27
- this.query = $("#node-input-query").typedInput('value'),
28
- this.query_type = $("#node-input-query").typedInput('type')
29
-
30
- }
31
30
  });
32
31
  </script>
33
32
 
34
33
  <script type="text/html" data-template-name="processinstance-query">
35
34
  <div class="form-row">
36
35
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
37
- <input type="text" id="node-input-name" placeholder="Name">
36
+ <input type="text" id="node-input-name" placeholder="Name" />
38
37
  </div>
39
38
  <div class="form-row">
40
39
  <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
41
- <input type="text" id="node-input-engine" placeholder="http://engine:8000">
40
+ <input type="text" id="node-input-engine" placeholder="http://engine:8000" />
42
41
  </div>
43
42
  <div class="form-row">
44
43
  <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
45
- <input type="text" id="node-input-query">
44
+ <input type="text" id="node-input-query" />
46
45
  </div>
47
46
  </script>
48
47
 
@@ -3,9 +3,9 @@ const EventEmitter = require('node:events');
3
3
 
4
4
  const engine_client = require('@5minds/processcube_engine_client');
5
5
 
6
- module.exports = function(RED) {
6
+ module.exports = function (RED) {
7
7
  function ProcessinstanceQuery(config) {
8
- RED.nodes.createNode(this,config);
8
+ RED.nodes.createNode(this, config);
9
9
  var node = this;
10
10
  var flowContext = node.context().flow;
11
11
  var nodeContext = node.context();
@@ -28,21 +28,26 @@ module.exports = function(RED) {
28
28
  eventEmitter = flowContext.get('emitter');
29
29
  }
30
30
 
31
- node.on("close", async () => {
31
+ node.on('close', async () => {
32
32
  client.dispose();
33
33
  client = null;
34
34
  });
35
35
 
36
- node.on('input', function(msg) {
37
- let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg)
36
+ node.on('input', function (msg) {
37
+ let query = RED.util.evaluateNodeProperty(config.query, config.query_type, node, msg);
38
38
 
39
- client.processInstances.query(query, { identity: node.server.identity }).then((matchingInstances) => {
39
+ client.processInstances
40
+ .query(query, { identity: node.server.identity })
41
+ .then((matchingInstances) => {
42
+ console.log(matchingInstances);
43
+ msg.payload = matchingInstances;
40
44
 
41
- msg.payload = matchingInstances;
42
-
43
- node.send(msg);
44
- });
45
+ node.send(msg);
46
+ })
47
+ .catch((error) => {
48
+ node.error(`Processinstancequery failed: ${error.message}`);
49
+ });
45
50
  });
46
51
  }
47
- RED.nodes.registerType("processinstance-query", ProcessinstanceQuery);
48
- }
52
+ RED.nodes.registerType('processinstance-query', ProcessinstanceQuery);
53
+ };
@@ -1,41 +1,41 @@
1
1
  <script type="text/javascript">
2
- RED.nodes.registerType('signal-event-trigger',{
2
+ RED.nodes.registerType('signal-event-trigger', {
3
3
  category: 'ProcessCube',
4
4
  color: '#02AFD6',
5
5
  defaults: {
6
- name: {value: ""},
7
- engine: {value: "", type: "processcube-engine-config"},
8
- signalname: {value: "", required: true},
9
- processInstanceId: {value:""}
6
+ name: { value: '' },
7
+ engine: { value: '', type: 'processcube-engine-config' },
8
+ signalname: { value: '', required: true },
9
+ processInstanceId: { value: '' },
10
10
  },
11
11
  inputs: 1,
12
12
  outputs: 1,
13
- icon: "font-awesome/fa-envelope-open",
14
- label: function() {
15
- return this.name||"signal-event-trigger";
16
- }
13
+ icon: 'font-awesome/fa-envelope-open',
14
+ label: function () {
15
+ return this.name || 'signal-event-trigger';
16
+ },
17
17
  });
18
18
  </script>
19
19
 
20
20
  <script type="text/html" data-template-name="signal-event-trigger">
21
21
  <div class="form-row">
22
22
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
23
- <input type="text" id="node-input-name" placeholder="Name">
23
+ <input type="text" id="node-input-name" placeholder="Name" />
24
24
  </div>
25
25
  <div class="form-row">
26
26
  <label for="node-input-engine"><i class="fa fa-tag"></i> Engine</label>
27
- <input type="text" id="node-input-engine" placeholder="Engine">
27
+ <input type="text" id="node-input-engine" placeholder="Engine" />
28
28
  </div>
29
29
  <div class="form-row">
30
30
  <label for="node-input-signalname"><i class="fa fa-tag"></i> Signal Name</label>
31
- <input type="text" id="node-input-signalname" placeholder="Name of the Signal">
31
+ <input type="text" id="node-input-signalname" placeholder="Name of the Signal" />
32
32
  </div>
33
33
  <div class="form-row">
34
34
  <label for="node-input-processinstanceid"><i class="fa fa-tag"></i> Process Instance Id</label>
35
- <input type="text" id="node-input-processinstanceid" placeholder="Id of the recipient process instance">
35
+ <input type="text" id="node-input-processinstanceid" placeholder="Id of the recipient process instance" />
36
36
  </div>
37
37
  </script>
38
38
 
39
39
  <script type="text/html" data-help-name="signal-event-trigger">
40
40
  <p>A node which emmits a signal event to the Engine.</p>
41
- </script>
41
+ </script>
@@ -2,7 +2,7 @@ const process = require('process');
2
2
 
3
3
  const engine_client = require('@5minds/processcube_engine_client');
4
4
 
5
- module.exports = function(RED) {
5
+ module.exports = function (RED) {
6
6
  function SignalEventTrigger(config) {
7
7
  RED.nodes.createNode(this, config);
8
8
  var node = this;
@@ -17,29 +17,25 @@ module.exports = function(RED) {
17
17
  if (!client) {
18
18
  nodeContext.set('client', new engine_client.EngineClient(engineUrl));
19
19
  client = nodeContext.get('client');
20
- }
21
-
22
- node.on('input', function(msg) {
23
-
24
- client.events.triggerSignalEvent(
25
- config.signalname,
26
- {
27
- processInstanceId: config.processinstanceid,
28
- payload: msg.payload,
29
- identity: node.server.identity
30
- }
31
-
32
- ).then((result) => {
33
-
34
- msg.payload = result;
35
-
36
- node.send(msg);
37
- node.status({fill: "blue", shape: "dot", text: `signal event triggered`});
38
-
39
- }).catch((error) => {
40
- node.error(error);
41
- });
20
+ }
21
+
22
+ node.on('input', function (msg) {
23
+ client.events
24
+ .triggerSignalEvent(config.signalname, {
25
+ processInstanceId: config.processinstanceid,
26
+ payload: msg.payload,
27
+ identity: node.server.identity,
28
+ })
29
+ .then((result) => {
30
+ msg.payload = result;
31
+
32
+ node.send(msg);
33
+ node.status({ fill: 'blue', shape: 'dot', text: `signal event triggered` });
34
+ })
35
+ .catch((error) => {
36
+ node.error(error);
37
+ });
42
38
  });
43
39
  }
44
- RED.nodes.registerType("signal-event-trigger", SignalEventTrigger);
45
- }
40
+ RED.nodes.registerType('signal-event-trigger', SignalEventTrigger);
41
+ };