Skip to content

Commit 8d22b2e

Browse files
authored
Merge pull request openiap#1 from open-rpa/master
update
2 parents d139542 + 89ba893 commit 8d22b2e

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
github: [skadefro]
2+
# These are supported funding model platforms
3+
# github: [skadefro]
4+
# patreon: # Replace with a single Patreon username
5+
# open_collective: # Replace with a single Open Collective username
6+
# ko_fi: # Replace with a single Ko-fi username
7+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
# liberapay: skadefro
10+
# issuehunt: # Replace with a single IssueHunt username
11+
# otechie: # Replace with a single Otechie username
12+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

OpenFlowNodeRED/src/nodered/nodes/rpa.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787
</div>
8888
</script>
8989
<script type="text/x-red" data-help-name="rpa workflow">
90-
Send payload as data to a robot, requesting it to run the selected Workflow
90+
Send payload as data to a robot, requesting it to run the selected Workflow.<br>
91+
You can set Workflow using msg.workflowid<br>
92+
You can set Target using msg.targetid<br>
9193
</script>
9294
<script type="text/javascript">
9395
RED.nodes.registerType('rpa workflow', {
@@ -96,8 +98,8 @@
9698
paletteLabel: 'robot',
9799
icon: "open_rpa_white.png",
98100
defaults: {
99-
queue: { value: "", required: true },
100-
workflow: { value: "", required: true },
101+
queue: { value: "" },
102+
workflow: { value: "" },
101103
localqueue: { value: "" },
102104
name: { value: "" }
103105
},

OpenFlowNodeRED/src/nodered/nodes/rpa_nodes.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,29 @@ export class rpa_workflow_node {
157157
async oninput(msg: any) {
158158
try {
159159
this.node.status({});
160+
let targetid = NoderedUtil.IsNullEmpty(this.config.queue) || this.config.queue === 'none' ? msg.targetid : this.config.queue;
161+
let workflowid = NoderedUtil.IsNullEmpty(this.config.workflow) ? msg.workflowid : this.config.workflow;
160162
var correlationId = Math.random().toString(36).substr(2, 9);
161163
this.messages[correlationId] = msg;
162164
if (msg.payload == null || typeof msg.payload == "string" || typeof msg.payload == "number") {
163165
msg.payload = { "data": msg.payload };
164166
}
167+
if(NoderedUtil.IsNullEmpty(targetid)) {
168+
this.node.status({ fill: "red", shape: "dot", text: "robot is mandatory" });
169+
return;
170+
}
171+
if(NoderedUtil.IsNullEmpty(workflowid)) {
172+
this.node.status({ fill: "red", shape: "dot", text: "workflow is mandatory" });
173+
return;
174+
}
165175
var rpacommand = {
166176
command: "invoke",
167-
workflowid: this.config.workflow,
177+
workflowid: workflowid,
168178
jwt: msg.jwt,
169179
data: { payload: msg.payload }
170180
}
171181
this.node.status({ fill: "blue", shape: "dot", text: "Robot running..." });
172-
this.con.SendMessage(JSON.stringify(rpacommand), this.config.queue, correlationId, true);
182+
this.con.SendMessage(JSON.stringify(rpacommand), targetid, correlationId, true);
173183
} catch (error) {
174184
NoderedUtil.HandleError(this, error);
175185
try {

0 commit comments

Comments
 (0)