Skip to content

Commit c78abff

Browse files
committed
bug fixes
1 parent 5c206eb commit c78abff

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

OpenFlowNodeRED/src/nodered/nodes/workflow_nodes.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class workflow_in_node {
102102
wf.addRight(role._id, role.name, [-1]);
103103
this.workflow = wf;
104104
this.workflow.queue = queue;
105+
this.workflow.name = this.config.name;
105106
this.workflow.rpa = this.config.rpa;
106107
this.workflow.web = this.config.web;
107108
this.workflow = await NoderedUtil._UpdateOne("workflow", null, this.workflow, 0, false, null);
@@ -150,14 +151,23 @@ export class workflow_in_node {
150151
}
151152
}
152153
this.node.status({ fill: "blue", shape: "dot", text: "Processing " + _id });
154+
console.log(data);
153155
if (_id !== null && _id !== undefined && _id !== "") {
154156
var res = await NoderedUtil.Query("workflow_instances", { "_id": _id }, null, null, 1, 0, data.jwt);
155157
if (res.length == 0) {
156158
NoderedUtil.HandleError(this, "Unknown workflow_instances id " + _id);
157159
if (ack !== null && ack !== undefined) ack();
158160
return;
159161
}
160-
data = Object.assign(res[0], { payload: data });
162+
if (res[0].payload === null || res[0].payload === undefined) {
163+
res[0].payload = data;
164+
data = res[0];
165+
} else {
166+
res[0].payload = Object.assign(res[0].payload, data);
167+
data = res[0];
168+
}
169+
console.log(data.payload);
170+
// data = Object.assign(res[0], { payload: data });
161171
// Logger.instanse.info("workflow in activated id " + data._id);
162172
// result.name = res[0].name;
163173
// result._id = res[0]._id;

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.494
1+
0.0.495

0 commit comments

Comments
 (0)