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

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/Dockerfile +1 -1
  2. package/docker-compose.yml +12 -0
  3. package/examples/External-Task-Sample.json +252 -0
  4. package/externaltask-error.html +26 -12
  5. package/externaltask-error.js +19 -20
  6. package/externaltask-input.html +31 -14
  7. package/externaltask-input.js +107 -55
  8. package/externaltask-output.html +20 -10
  9. package/externaltask-output.js +12 -11
  10. package/message-event-trigger.html +14 -14
  11. package/message-event-trigger.js +10 -14
  12. package/nodered/node-red-contrib-processcube-flows.json +216 -132
  13. package/nodered/package.json +1 -0
  14. package/nodered/settings.js +92 -82
  15. package/package.json +3 -9
  16. package/process-start.html +23 -19
  17. package/process-start.js +10 -15
  18. package/processcube-engine-config.html +10 -10
  19. package/processcube-engine-config.js +30 -22
  20. package/processdefinition-query.html +23 -29
  21. package/processdefinition-query.js +42 -36
  22. package/processes/External-Task-Sample.bpmn +94 -0
  23. package/processinstance-query.html +20 -19
  24. package/processinstance-query.js +16 -23
  25. package/signal-event-trigger.html +14 -14
  26. package/signal-event-trigger.js +10 -14
  27. package/usertask-finished-listener.html +12 -17
  28. package/usertask-finished-listener.js +30 -27
  29. package/usertask-input.html +27 -40
  30. package/usertask-input.js +37 -24
  31. package/usertask-new-listener.html +12 -17
  32. package/usertask-new-listener.js +27 -27
  33. package/usertask-output.html +24 -23
  34. package/usertask-output.js +25 -21
  35. package/.prettierrc.json +0 -6
  36. package/processes/CheckError.bpmn +0 -78
  37. package/processes/NodeRedExternalTask.bpmn +0 -77
  38. package/processes/SampleUserTask.bpmn +0 -95
@@ -21,14 +21,15 @@
21
21
  **/
22
22
 
23
23
  module.exports = {
24
- /*******************************************************************************
25
- * Flow File and User Directory Settings
26
- * - flowFile
27
- * - credentialSecret
28
- * - flowFilePretty
29
- * - userDir
30
- * - nodesDir
31
- ******************************************************************************/
24
+
25
+ /*******************************************************************************
26
+ * Flow File and User Directory Settings
27
+ * - flowFile
28
+ * - credentialSecret
29
+ * - flowFilePretty
30
+ * - userDir
31
+ * - nodesDir
32
+ ******************************************************************************/
32
33
 
33
34
  /** The file containing the flows. If not set, defaults to flows_<hostname>.json **/
34
35
  flowFile: 'flows.json',
@@ -40,7 +41,7 @@ module.exports = {
40
41
  * node-red from being able to decrypt your existing credentials and they will be
41
42
  * lost.
42
43
  */
43
- credentialSecret: 'a-secret-key',
44
+ credentialSecret: "a-secret-key",
44
45
 
45
46
  /** By default, the flow JSON will be formatted over multiple lines making
46
47
  * it easier to compare changes when using version control.
@@ -59,15 +60,15 @@ module.exports = {
59
60
  */
60
61
  //nodesDir: '/home/nol/.node-red/nodes',
61
62
 
62
- /*******************************************************************************
63
- * Security
64
- * - adminAuth
65
- * - https
66
- * - httpsRefreshInterval
67
- * - requireHttps
68
- * - httpNodeAuth
69
- * - httpStaticAuth
70
- ******************************************************************************/
63
+ /*******************************************************************************
64
+ * Security
65
+ * - adminAuth
66
+ * - https
67
+ * - httpsRefreshInterval
68
+ * - requireHttps
69
+ * - httpNodeAuth
70
+ * - httpStaticAuth
71
+ ******************************************************************************/
71
72
 
72
73
  /** To password protect the Node-RED editor and admin API, the following
73
74
  * property can be used. See https://nodered.org/docs/security.html for details.
@@ -124,20 +125,20 @@ module.exports = {
124
125
  //httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
125
126
  //httpStaticAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
126
127
 
127
- /*******************************************************************************
128
- * Server Settings
129
- * - uiPort
130
- * - uiHost
131
- * - apiMaxLength
132
- * - httpServerOptions
133
- * - httpAdminRoot
134
- * - httpAdminMiddleware
135
- * - httpNodeRoot
136
- * - httpNodeCors
137
- * - httpNodeMiddleware
138
- * - httpStatic
139
- * - httpStaticRoot
140
- ******************************************************************************/
128
+ /*******************************************************************************
129
+ * Server Settings
130
+ * - uiPort
131
+ * - uiHost
132
+ * - apiMaxLength
133
+ * - httpServerOptions
134
+ * - httpAdminRoot
135
+ * - httpAdminMiddleware
136
+ * - httpNodeRoot
137
+ * - httpNodeCors
138
+ * - httpNodeMiddleware
139
+ * - httpStatic
140
+ * - httpStaticRoot
141
+ ******************************************************************************/
141
142
 
142
143
  /** the tcp port that the Node-RED web server is listening on */
143
144
  uiPort: process.env.PORT || 1880,
@@ -177,6 +178,7 @@ module.exports = {
177
178
  // next();
178
179
  // },
179
180
 
181
+
180
182
  /** Some nodes, such as HTTP In, can be used to listen for incoming http requests.
181
183
  * By default, these are served relative to '/'. The following property
182
184
  * can be used to specify a different root path. If set to false, this is
@@ -242,16 +244,16 @@ module.exports = {
242
244
  */
243
245
  //httpStaticRoot: '/static/',
244
246
 
245
- /*******************************************************************************
246
- * Runtime Settings
247
- * - lang
248
- * - runtimeState
249
- * - diagnostics
250
- * - logging
251
- * - contextStorage
252
- * - exportGlobalContextKeys
253
- * - externalModules
254
- ******************************************************************************/
247
+ /*******************************************************************************
248
+ * Runtime Settings
249
+ * - lang
250
+ * - runtimeState
251
+ * - diagnostics
252
+ * - logging
253
+ * - contextStorage
254
+ * - exportGlobalContextKeys
255
+ * - externalModules
256
+ ******************************************************************************/
255
257
 
256
258
  /** Uncomment the following to run node-red in your preferred language.
257
259
  * Available languages include: en-US (default), ja, de, zh-CN, zh-TW, ru, ko
@@ -264,7 +266,7 @@ module.exports = {
264
266
  * be available at http://localhost:1880/diagnostics
265
267
  * - ui: When `ui` is `true` (or unset), the action `show-system-info` will
266
268
  * be available to logged in users of node-red editor
267
- */
269
+ */
268
270
  diagnostics: {
269
271
  /** enable or disable diagnostics endpoint. Must be set to `false` to disable */
270
272
  enabled: true,
@@ -297,12 +299,12 @@ module.exports = {
297
299
  * trace - record very detailed logging + debug + info + warn + error + fatal errors
298
300
  * off - turn off all logging (doesn't affect metrics or audit)
299
301
  */
300
- level: 'info',
302
+ level: "info",
301
303
  /** Whether or not to include metric events in the log output */
302
304
  metrics: false,
303
305
  /** Whether or not to include audit events in the log output */
304
- audit: false,
305
- },
306
+ audit: false
307
+ }
306
308
  },
307
309
 
308
310
  /** Context Storage
@@ -353,11 +355,12 @@ module.exports = {
353
355
  // }
354
356
  },
355
357
 
356
- /*******************************************************************************
357
- * Editor Settings
358
- * - disableEditor
359
- * - editorTheme
360
- ******************************************************************************/
358
+
359
+ /*******************************************************************************
360
+ * Editor Settings
361
+ * - disableEditor
362
+ * - editorTheme
363
+ ******************************************************************************/
361
364
 
362
365
  /** The following property can be used to disable the editor. The admin API
363
366
  * is not affected by this option. To disable both the editor and the admin
@@ -382,8 +385,9 @@ module.exports = {
382
385
  //tours: false,
383
386
 
384
387
  header: {
385
- title: 'Node-RED powered by ProcessCube &copy;',
386
- url: 'https://processcube.io', // optional url to make the header text/image a link to this url
388
+ title: "Node-RED powered by ProcessCube&copy;",
389
+ url: "https://processcube.io" // optional url to make the header text/image a link to this url
390
+
387
391
  },
388
392
  palette: {
389
393
  /** The following property can be used to order the categories in the editor
@@ -392,7 +396,12 @@ module.exports = {
392
396
  * If not set, the following default order is used:
393
397
  */
394
398
  //categories: ['subflows', 'common', 'function', 'network', 'sequence', 'parser', 'storage'],
395
- categories: ['ProcessCube', 'ProcessCube Events', 'ProcessCube UI', 'dashboard 2'],
399
+ categories: [
400
+ "ProcessCube",
401
+ "ProcessCube Events",
402
+ "ProcessCube UI",
403
+ "dashboard 2"
404
+ ]
396
405
  },
397
406
 
398
407
  projects: {
@@ -405,15 +414,15 @@ module.exports = {
405
414
  * This can be overridden per-user from the 'Git config'
406
415
  * section of 'User Settings' within the editor
407
416
  */
408
- mode: 'manual',
409
- },
417
+ mode: "manual"
418
+ }
410
419
  },
411
420
 
412
421
  codeEditor: {
413
422
  /** Select the text editor component used by the editor.
414
423
  * As of Node-RED V3, this defaults to "monaco", but can be set to "ace" if desired
415
424
  */
416
- lib: 'monaco',
425
+ lib: "monaco",
417
426
  options: {
418
427
  /** The follow options only apply if the editor is set to "monaco"
419
428
  *
@@ -428,39 +437,40 @@ module.exports = {
428
437
  //fontSize: 14,
429
438
  //fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
430
439
  //fontLigatures: true,
431
- },
440
+ }
432
441
  },
433
442
 
434
443
  markdownEditor: {
435
444
  mermaid: {
436
445
  /** enable or disable mermaid diagram in markdown document
437
446
  */
438
- enabled: true,
439
- },
447
+ enabled: true
448
+ }
440
449
  },
450
+
441
451
  },
442
452
 
443
- /*******************************************************************************
444
- * Node Settings
445
- * - fileWorkingDirectory
446
- * - functionGlobalContext
447
- * - functionExternalModules
448
- * - functionTimeout
449
- * - nodeMessageBufferMaxLength
450
- * - ui (for use with Node-RED Dashboard)
451
- * - debugUseColors
452
- * - debugMaxLength
453
- * - execMaxBufferSize
454
- * - httpRequestTimeout
455
- * - mqttReconnectTime
456
- * - serialReconnectTime
457
- * - socketReconnectTime
458
- * - socketTimeout
459
- * - tcpMsgQueueSize
460
- * - inboundWebSocketTimeout
461
- * - tlsConfigDisableLocalFiles
462
- * - webSocketNodeVerifyClient
463
- ******************************************************************************/
453
+ /*******************************************************************************
454
+ * Node Settings
455
+ * - fileWorkingDirectory
456
+ * - functionGlobalContext
457
+ * - functionExternalModules
458
+ * - functionTimeout
459
+ * - nodeMessageBufferMaxLength
460
+ * - ui (for use with Node-RED Dashboard)
461
+ * - debugUseColors
462
+ * - debugMaxLength
463
+ * - execMaxBufferSize
464
+ * - httpRequestTimeout
465
+ * - mqttReconnectTime
466
+ * - serialReconnectTime
467
+ * - socketReconnectTime
468
+ * - socketTimeout
469
+ * - tcpMsgQueueSize
470
+ * - inboundWebSocketTimeout
471
+ * - tlsConfigDisableLocalFiles
472
+ * - webSocketNodeVerifyClient
473
+ ******************************************************************************/
464
474
 
465
475
  /** The working directory to handle relative file paths from within the File nodes
466
476
  * defaults to the working directory of the Node-RED process.
@@ -558,4 +568,4 @@ module.exports = {
558
568
  // * - reason: if result is false, the HTTP reason string to return
559
569
  // */
560
570
  //},
561
- };
571
+ }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "0.14.0-fix-error-in-process-instance-query-9aeac9-lyzi0gix",
3
+ "version": "0.14.0",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
- "scripts": {
7
- "lint": "prettier --write --config ./.prettierrc.json \"**/*.{html,js}\""
8
- },
9
6
  "authors": [
10
7
  {
11
8
  "name": "Martin Moellenbeck",
@@ -51,7 +48,7 @@
51
48
  }
52
49
  },
53
50
  "dependencies": {
54
- "@5minds/processcube_engine_client": "^5.0.0",
51
+ "@5minds/processcube_engine_client": "^5.0.1",
55
52
  "jwt-decode": "^4.0.0",
56
53
  "openid-client": "^5.5.0"
57
54
  },
@@ -61,8 +58,5 @@
61
58
  "workflow",
62
59
  "bpmn",
63
60
  "low-code"
64
- ],
65
- "devDependencies": {
66
- "prettier": "^3.3.3"
67
- }
61
+ ]
68
62
  }
@@ -3,50 +3,54 @@
3
3
  category: 'ProcessCube',
4
4
  color: '#02AFD6',
5
5
  defaults: {
6
- name: { value: '' },
7
- engine: { value: '', type: 'processcube-engine-config' },
8
- processmodel: { value: '', required: false },
9
- startevent: { value: '', required: false },
6
+ name: {value: ""},
7
+ engine: {value: "", type: "processcube-engine-config"},
8
+ processmodel: {value: "", required: false},
9
+ startevent: {value: "", required: false}
10
10
  },
11
11
  inputs: 1,
12
12
  outputs: 1,
13
- icon: 'font-awesome/fa-sign-in',
14
- label: function () {
15
- return this.name || 'process-start';
16
- },
13
+ icon: "font-awesome/fa-sign-in",
14
+ label: function() {
15
+ return this.name||"process-start";
16
+ }
17
17
  });
18
18
  </script>
19
19
 
20
20
  <script type="text/html" data-template-name="process-start">
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-URL</label>
27
- <input type="text" id="node-input-engine" placeholder="Engine-URL" />
27
+ <input type="text" id="node-input-engine" placeholder="Engine-URL">
28
28
  </div>
29
29
  <div class="form-row">
30
30
  <label for="node-input-processmodel"><i class="fa fa-tag"></i> Processmodel</label>
31
- <input type="text" id="node-input-processmodel" placeholder="ID of Processmodel" />
31
+ <input type="text" id="node-input-processmodel" placeholder="ID of Processmodel">
32
32
  </div>
33
33
  <div class="form-row">
34
34
  <label for="node-input-startevent"><i class="fa fa-tag"></i> Startevent</label>
35
- <input type="text" id="node-input-startevent" placeholder="ID of Startevent" />
35
+ <input type="text" id="node-input-startevent" placeholder="ID of Startevent">
36
36
  </div>
37
37
  </script>
38
38
 
39
39
  <script type="text/html" data-help-name="process-start">
40
40
  <h2>Start a Processmodel in the ProcessCube</h2>
41
- <p>If the <code>msg.payload</code> is set, it will be used as the input for the process.</p>
42
41
  <p>
43
- If a <code>msg.processModelId</code> is set, it will be used as the process model and override the configured
44
- <b>Processmodel</b>.
42
+ If the <code>msg.payload</code> is set, it will be used as the input for the process.
43
+ </p>
44
+ <p>
45
+ If a <code>msg.processModelId</code> is set, it will be used as the process model and
46
+ override the configured <b>Processmodel</b>.
45
47
  </p>
46
48
  <p>
47
- If a <code>msg.startEventId</code> is set, it will be used as the start event and override the configured
48
- <b>Startevent</b>.
49
+ If a <code>msg.startEventId</code> is set, it will be used as the start event and
50
+ override the configured <b>Startevent</b>.
49
51
  </p>
50
52
  <h3>More documentation</h3>
51
- <p>The Dokumenation can be found on <a href="https://processcube.io">ProcessCube Developer Network</a>.</p>
52
- </script>
53
+ <p>
54
+ The Dokumenation can be found on <a href="https://processcube.io">ProcessCube Developer Network</a>.
55
+ </p>
56
+ </script>
package/process-start.js CHANGED
@@ -1,25 +1,16 @@
1
- const process = require('process');
2
- const engine_client = require('@5minds/processcube_engine_client');
1
+ const process = require("process");
2
+ const engine_client = require("@5minds/processcube_engine_client");
3
3
 
4
4
  module.exports = function (RED) {
5
5
  function ProcessStart(config) {
6
6
  RED.nodes.createNode(this, config);
7
7
  var node = this;
8
- var flowContext = node.context().flow;
9
- var nodeContext = node.context();
10
8
 
11
9
  this.engine = this.server = RED.nodes.getNode(config.engine);
12
10
 
13
- const engineUrl = this.engine?.url || process.env.ENGINE_URL || 'http://engine:8000';
11
+ const client = this.engine.getEngineClient();
14
12
 
15
- var client = nodeContext.get('client');
16
-
17
- if (!client) {
18
- nodeContext.set('client', new engine_client.EngineClient(engineUrl));
19
- client = nodeContext.get('client');
20
- }
21
-
22
- node.on('input', function (msg) {
13
+ node.on("input", function (msg) {
23
14
  const startParameters = {
24
15
  processModelId: msg.processModelId || config.processmodel,
25
16
  startEventId: msg.startEventId || config.startevent,
@@ -32,12 +23,16 @@ module.exports = function (RED) {
32
23
  msg.payload = result;
33
24
 
34
25
  node.send(msg);
35
- node.status({ fill: 'blue', shape: 'dot', text: `started ${result.processInstanceId}` });
26
+ node.status({
27
+ fill: "blue",
28
+ shape: "dot",
29
+ text: `started ${result.processInstanceId}`,
30
+ });
36
31
  })
37
32
  .catch((error) => {
38
33
  node.error(error);
39
34
  });
40
35
  });
41
36
  }
42
- RED.nodes.registerType('process-start', ProcessStart);
37
+ RED.nodes.registerType("process-start", ProcessStart);
43
38
  };
@@ -1,30 +1,30 @@
1
1
  <script type="text/javascript">
2
- RED.nodes.registerType('processcube-engine-config', {
2
+ RED.nodes.registerType('processcube-engine-config',{
3
3
  category: 'config',
4
4
  defaults: {
5
- url: { value: 'http://engine:8000', required: true },
5
+ url: {value:"http://engine:8000",required:true}
6
6
  },
7
- label: function () {
7
+ label: function() {
8
8
  return this.url;
9
9
  },
10
10
  credentials: {
11
- clientId: { type: 'text' },
12
- clientSecret: { type: 'password' },
13
- },
11
+ clientId: { type: "text" },
12
+ clientSecret: { type: "password" }
13
+ }
14
14
  });
15
15
  </script>
16
16
 
17
17
  <script type="text/html" data-template-name="processcube-engine-config">
18
18
  <div class="form-row">
19
19
  <label for="node-config-input-url"><i class="fa fa-bookmark"></i> Url</label>
20
- <input type="text" id="node-config-input-url" />
20
+ <input type="text" id="node-config-input-url">
21
21
  </div>
22
22
  <div class="form-row">
23
23
  <label for="node-config-input-clientId"><i class="fa fa-bookmark"></i> Client id</label>
24
- <input type="text" id="node-config-input-clientId" />
24
+ <input type="text" id="node-config-input-clientId">
25
25
  </div>
26
26
  <div class="form-row">
27
27
  <label for="node-config-input-clientSecret"><i class="fa fa-bookmark"></i> Client secret</label>
28
- <input type="password" id="node-config-input-clientSecret" />
28
+ <input type="password" id="node-config-input-clientSecret">
29
29
  </div>
30
- </script>
30
+ </script>
@@ -4,7 +4,7 @@ const oidc = require('openid-client');
4
4
 
5
5
  const DELAY_FACTOR = 0.85;
6
6
 
7
- module.exports = function (RED) {
7
+ module.exports = function(RED) {
8
8
  function ProcessCubeEngineNode(n) {
9
9
  RED.nodes.createNode(this, n);
10
10
  const node = this;
@@ -14,7 +14,8 @@ module.exports = function (RED) {
14
14
  this.registerOnIdentityChanged = function (callback) {
15
15
  identityChangedCallbacks.push(callback);
16
16
  };
17
- this.setIdentity = (identity) => {
17
+
18
+ this.setIdentity = (identity) => {
18
19
  this.identity = identity;
19
20
 
20
21
  for (const callback of identityChangedCallbacks) {
@@ -22,35 +23,41 @@ module.exports = function (RED) {
22
23
  }
23
24
  };
24
25
 
26
+ var nodeContext = node.context();
27
+
28
+ this.getEngineClient = () => {
29
+ const engineUrl = this.url || process.env.ENGINE_URL || 'http://engine:8000';
30
+ let client = nodeContext.get('client');
31
+
32
+ if (!client) {
33
+ nodeContext.set('client', new engine_client.EngineClient(engineUrl));
34
+ client = nodeContext.get('client');
35
+ }
36
+
37
+ return client;
38
+ };
39
+
25
40
  if (this.credentials.clientId && this.credentials.clientSecret) {
26
41
  const engineClient = new engine_client.EngineClient(this.url);
27
42
 
28
- engineClient.applicationInfo
29
- .getAuthorityAddress()
30
- .then((authorityUrl) => {
31
- startRefreshingIdentityCycle(
32
- this.credentials.clientId,
33
- this.credentials.clientSecret,
34
- authorityUrl,
35
- this,
36
- ).catch((reason) => {
37
- console.error(reason);
38
- node.error(reason);
39
- });
40
- })
41
- .catch((reason) => {
43
+ engineClient.applicationInfo.getAuthorityAddress().then(authorityUrl => {
44
+ startRefreshingIdentityCycle(this.credentials.clientId, this.credentials.clientSecret, authorityUrl, this).catch(reason => {
42
45
  console.error(reason);
43
46
  node.error(reason);
44
47
  });
48
+ }).catch((reason) => {
49
+ console.error(reason);
50
+ node.error(reason);
51
+ });
45
52
  }
46
53
  }
47
- RED.nodes.registerType('processcube-engine-config', ProcessCubeEngineNode, {
54
+ RED.nodes.registerType("processcube-engine-config", ProcessCubeEngineNode, {
48
55
  credentials: {
49
- clientId: { type: 'text' },
50
- clientSecret: { type: 'password' },
51
- },
56
+ clientId: { type: "text" },
57
+ clientSecret: { type: "password" }
58
+ }
52
59
  });
53
- };
60
+ }
54
61
 
55
62
  async function getFreshTokenSet(clientId, clientSecret, authorityUrl) {
56
63
  const issuer = await oidc.Issuer.discover(authorityUrl);
@@ -69,6 +76,7 @@ async function getFreshTokenSet(clientId, clientSecret, authorityUrl) {
69
76
  }
70
77
 
71
78
  function getIdentityForExternalTaskWorkers(tokenSet) {
79
+
72
80
  const accessToken = tokenSet.access_token;
73
81
  const decodedToken = jwt.jwtDecode(accessToken);
74
82
 
@@ -132,4 +140,4 @@ async function startRefreshingIdentityCycle(clientId, clientSecret, authorityUrl
132
140
  };
133
141
 
134
142
  await refresh();
135
- }
143
+ }
@@ -3,58 +3,52 @@
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);
26
- },
27
- oneditsave: function () {
28
- (this.query = $('#node-input-query').typedInput('value')),
29
- (this.query_type = $('#node-input-query').typedInput('type'));
24
+ $("#node-input-query").typedInput('value', this.query);
25
+ $("#node-input-query").typedInput('type', this.query_type);
30
26
  },
27
+ oneditsave: function() {
28
+ this.query = $("#node-input-query").typedInput('value'),
29
+ this.query_type = $("#node-input-query").typedInput('type')
30
+
31
+ }
31
32
  });
32
33
  </script>
33
34
 
34
35
  <script type="text/html" data-template-name="processdefinition-query">
35
36
  <div class="form-row">
36
37
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
37
- <input type="text" id="node-input-name" placeholder="Name" />
38
+ <input type="text" id="node-input-name" placeholder="Name">
38
39
  </div>
39
40
  <div class="form-row">
40
41
  <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" />
42
+ <input type="text" id="node-input-engine" placeholder="http://engine:8000">
42
43
  </div>
43
44
  <div class="form-row">
44
45
  <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
45
- <input type="text" id="node-input-query" />
46
+ <input type="text" id="node-input-query">
46
47
  </div>
47
48
  <div class="form-row" style="display:flex; margin-bottom: 3px;">
48
- <label for="node-input-models_only" style="vertical-align:top"
49
- ><i class="fa fa-list-alt"></i> Models Only</label
50
- >
49
+ <label for="node-input-models_only" style="vertical-align:top"><i class="fa fa-list-alt"></i> Models Only</label>
51
50
  <div>
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
- />
51
+ <input type="checkbox" checked id="node-input-models_only" style="display: inline-block; width: auto; margin: 0px 0px 0px 4px;">
58
52
  <label style="width:auto" for="node-input-models_only">Only send models as result.</label>
59
53
  </div>
60
54
  </div>