@5minds/node-red-contrib-processcube
Advanced tools
Comparing version 0.2.6-feature-1b79c0-lvmvp9ag to 0.2.6-feature-56f704-lvnqzr5u
@@ -573,3 +573,110 @@ { | ||
} | ||
}, | ||
"node-red-contrib-uibuilder": { | ||
"name": "node-red-contrib-uibuilder", | ||
"version": "6.8.2", | ||
"local": false, | ||
"user": false, | ||
"nodes": { | ||
"uibuilder": { | ||
"name": "uibuilder", | ||
"types": [ | ||
"uibuilder" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uibuilder.js" | ||
}, | ||
"uib-cache": { | ||
"name": "uib-cache", | ||
"types": [ | ||
"uib-cache" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-cache.js" | ||
}, | ||
"uib-tag": { | ||
"name": "uib-tag", | ||
"types": [ | ||
"uib-tag" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-tag/customNode.js" | ||
}, | ||
"uib-element": { | ||
"name": "uib-element", | ||
"types": [ | ||
"uib-element" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-element/customNode.js" | ||
}, | ||
"uib-update": { | ||
"name": "uib-update", | ||
"types": [ | ||
"uib-update" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-update/customNode.js" | ||
}, | ||
"uib-html": { | ||
"name": "uib-html", | ||
"types": [ | ||
"uib-html" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-html/customNode.js" | ||
}, | ||
"uib-save": { | ||
"name": "uib-save", | ||
"types": [ | ||
"uib-save" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-save/customNode.js" | ||
}, | ||
"uib-sender": { | ||
"name": "uib-sender", | ||
"types": [ | ||
"uib-sender" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-sender.js" | ||
}, | ||
"uib-list": { | ||
"name": "uib-list", | ||
"types": [ | ||
"uib-list" | ||
], | ||
"enabled": true, | ||
"local": false, | ||
"user": false, | ||
"module": "node-red-contrib-uibuilder", | ||
"file": "/usr/src/node-red/node_modules/node-red-contrib-uibuilder/nodes/uib-list/customNode.js" | ||
} | ||
} | ||
} | ||
} |
@@ -892,7 +892,8 @@ [ | ||
"engine": "d042a4c68f51d6ab", | ||
"x": 290, | ||
"y": 360, | ||
"x": 250, | ||
"y": 120, | ||
"wires": [ | ||
[ | ||
"090d42845540049c" | ||
"090d42845540049c", | ||
"846c5269df75c7a1" | ||
] | ||
@@ -913,6 +914,156 @@ ] | ||
"statusType": "auto", | ||
"x": 510, | ||
"y": 360, | ||
"x": 520, | ||
"y": 120, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "661e71d204ee957d", | ||
"type": "uibuilder", | ||
"z": "fd3c725340de4f74", | ||
"name": "", | ||
"topic": "", | ||
"url": "usertasks", | ||
"okToGo": true, | ||
"fwdInMessages": false, | ||
"allowScripts": false, | ||
"allowStyles": false, | ||
"copyIndex": true, | ||
"templateFolder": "blank", | ||
"extTemplate": "", | ||
"showfolder": false, | ||
"reload": true, | ||
"sourceFolder": "src", | ||
"deployedVersion": "6.8.2", | ||
"showMsgUib": false, | ||
"title": "", | ||
"descr": "", | ||
"x": 410, | ||
"y": 300, | ||
"wires": [ | ||
[ | ||
"823445c277179d4e" | ||
], | ||
[] | ||
] | ||
}, | ||
{ | ||
"id": "823445c277179d4e", | ||
"type": "debug", | ||
"z": "fd3c725340de4f74", | ||
"name": "debug 11", | ||
"active": true, | ||
"tosidebar": true, | ||
"console": false, | ||
"tostatus": false, | ||
"complete": "false", | ||
"statusVal": "", | ||
"statusType": "auto", | ||
"x": 590, | ||
"y": 280, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "4078e4fb0a080b04", | ||
"type": "uib-element", | ||
"z": "fd3c725340de4f74", | ||
"name": "", | ||
"topic": "", | ||
"elementtype": "sform", | ||
"parent": "body", | ||
"parentSource": "", | ||
"parentSourceType": "str", | ||
"elementid": "", | ||
"elementId": "", | ||
"elementIdSourceType": "str", | ||
"heading": "", | ||
"headingSourceType": "str", | ||
"headingLevel": "h2", | ||
"data": "payload", | ||
"dataSourceType": "msg", | ||
"position": "last", | ||
"positionSourceType": "str", | ||
"passthrough": false, | ||
"confData": {}, | ||
"x": 390, | ||
"y": 420, | ||
"wires": [ | ||
[ | ||
"c59406be55bd5124" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "3b9e8eb5743f557c", | ||
"type": "inject", | ||
"z": "fd3c725340de4f74", | ||
"name": "", | ||
"props": [ | ||
{ | ||
"p": "payload" | ||
} | ||
], | ||
"repeat": "", | ||
"crontab": "", | ||
"once": false, | ||
"onceDelay": 0.1, | ||
"topic": "", | ||
"payload": "[{\"id\":\"r1\",\"type\":\"text\",\"required\":false,\"label\":\"Label for form row 1\",\"value\":\"Foo\",\"title\":\"Some helpful text\"},{\"id\":\"r11\",\"type\":\"email\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r12\",\"type\":\"month\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r14\",\"type\":\"time\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r15\",\"type\":\"week\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r16\",\"type\":\"password\",\"required\":true,\"label\":\"Label for form row 11\",\"title\":\"Some helpful text\"},{\"id\":\"r2\",\"type\":\"range\",\"required\":true,\"label\":\"Label for form row 1\",\"value\":\"Foo\"},{\"id\":\"r3\",\"type\":\"button\",\"label\":\"Text on button\",\"value\":\"Buttons can have values as well\"}]", | ||
"payloadType": "json", | ||
"x": 80, | ||
"y": 400, | ||
"wires": [ | ||
[ | ||
"4078e4fb0a080b04" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "c59406be55bd5124", | ||
"type": "link out", | ||
"z": "fd3c725340de4f74", | ||
"name": "link out 1", | ||
"mode": "link", | ||
"links": [ | ||
"d9edaa2e3c514edc" | ||
], | ||
"x": 545, | ||
"y": 400, | ||
"wires": [] | ||
}, | ||
{ | ||
"id": "d9edaa2e3c514edc", | ||
"type": "link in", | ||
"z": "fd3c725340de4f74", | ||
"name": "link in 1", | ||
"links": [ | ||
"c59406be55bd5124" | ||
], | ||
"x": 245, | ||
"y": 300, | ||
"wires": [ | ||
[ | ||
"661e71d204ee957d" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "846c5269df75c7a1", | ||
"type": "function", | ||
"z": "fd3c725340de4f74", | ||
"name": "function 2", | ||
"func": "msg.payload = msg.payload.formFields;\n\nreturn msg;", | ||
"outputs": 1, | ||
"timeout": 0, | ||
"noerr": 0, | ||
"initialize": "", | ||
"finalize": "", | ||
"libs": [], | ||
"x": 100, | ||
"y": 280, | ||
"wires": [ | ||
[ | ||
"4078e4fb0a080b04" | ||
] | ||
] | ||
} | ||
] |
{ | ||
"name": "@5minds/node-red-contrib-processcube", | ||
"version": "0.2.6-feature-1b79c0-lvmvp9ag", | ||
"version": "0.2.6-feature-56f704-lvnqzr5u", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Node-RED nodes for ProcessCube", |
@@ -14,2 +14,21 @@ const process = require('process'); | ||
function mapUserTaskToMsg(userTask) { | ||
return userTask.userTaskConfig.formFields.map(field => { | ||
switch (field.type) { | ||
case 'string': | ||
return { id: field.id, type: 'text', required: false, label: field.label, value: '', title: 'Some helpful text' }; | ||
case 'long': | ||
return { id: field.id, type: 'number', required: true, label: field.label, title: 'Some helpful text' }; | ||
case 'date': | ||
return { id: field.id, type: 'date', required: true, label: field.label, title: 'Some helpful text' }; | ||
case 'enum': | ||
return { id: field.id, type: 'select', required: true, label: field.label, options: field.enumValues.map(v => ({ id: v.id, name: v.name })), title: 'Choose an option' }; | ||
case 'boolean': | ||
return { id: field.id, type: 'checkbox', required: false, label: field.label, title: 'Check for Yes' }; | ||
default: | ||
return { id: field.id, type: field.type, required: true, label: field.label, title: 'Additional Information Needed' }; | ||
} | ||
}); | ||
} | ||
module.exports = function(RED) { | ||
@@ -44,2 +63,5 @@ function UserTaskInput(config) { | ||
// Abschließend mit - client.userTasks.finishUserTask(waitingUserTask?.flowNodeInstanceId, sampleResult) | ||
// flowNodeInstanceId | ||
// processModelName | ||
@@ -52,5 +74,13 @@ // flowNodeId | ||
}).then((matchingFlowNodes) => { | ||
node.send({ payload: matchingFlowNodes }); | ||
if (matchingFlowNodes && matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) { | ||
userTask = matchingFlowNodes.userTasks[0]; | ||
let formFields = mapUserTaskToMsg(userTask); | ||
node.send({ payload: {formFields: formFields, userTask: userTask }, _flowNodeInstanceId: userTaskWaitingNotification.flowNodeInstanceId }); | ||
} else { | ||
node.send({ payload: matchingFlowNodes }); | ||
} | ||
}); | ||
}); | ||
@@ -57,0 +87,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
185540
49
2564
1