Skip to content

Commit 164ff88

Browse files
committed
Fix nested task assigns
1 parent 3ceb471 commit 164ff88

11 files changed

Lines changed: 25 additions & 23 deletions

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openflow-nodered",
3-
"version": "1.1.90",
3+
"version": "1.1.91",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

OpenFlowNodeRED/src/nodered/nodes/amqp_nodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class amqp_consumer_node {
9898
}
9999
onsocketclose(message) {
100100
if (message == null) message = "";
101-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
101+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
102102
// this.onclose(false, null);
103103
}
104104
onsignedin() {
@@ -196,7 +196,7 @@ export class amqp_publisher_node {
196196
}
197197
onsocketclose(message) {
198198
if (message == null) message = "";
199-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
199+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
200200
// this.onclose(false, null);
201201
}
202202
websocket(): WebSocketClient {

OpenFlowNodeRED/src/nodered/nodes/api_nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ export class api_watch {
11721172
}
11731173
onsocketclose(message) {
11741174
if (message == null) message = "";
1175-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
1175+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
11761176
// this.onclose(false, null);
11771177
}
11781178
async connect() {

OpenFlowNodeRED/src/nodered/nodes/rpa_nodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class rpa_detector_node {
3737
}
3838
onsocketclose(message) {
3939
if (message == null) message = "";
40-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
40+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
4141
// this.onclose(false, null);
4242
}
4343
async connect() {
@@ -130,7 +130,7 @@ export class rpa_workflow_node {
130130
}
131131
onsocketclose(message) {
132132
if (message == null) message = "";
133-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
133+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
134134
// this.onclose(false, null);
135135
}
136136
async connect() {

OpenFlowNodeRED/src/nodered/nodes/workflow_nodes.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class workflow_in_node {
4040
}
4141
onsocketclose(message) {
4242
if (message == null) message = "";
43-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
43+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
4444
// this.onclose(false, null);
4545
}
4646
async connect() {
@@ -364,7 +364,8 @@ export class workflow_out_node {
364364
const expiration: number = (typeof msg.expiration == 'number' ? msg.expiration : Config.amqp_workflow_out_expiration);
365365
this.node.status({ fill: "blue", shape: "dot", text: "QueueMessage.1" });
366366
await NoderedUtil.QueueMessage(WebSocketClient.instance, msg.resultqueue, null, data, msg.correlationId, expiration);
367-
msg._replyTo = null; // don't double message (??)
367+
if (msg.resultqueue == msg._replyTo) msg._replyTo = null; // don't double message (??)
368+
368369
}
369370
} catch (error) {
370371
NoderedUtil.HandleError(this, error);
@@ -481,7 +482,7 @@ export class assign_workflow_node {
481482
}
482483
onsocketclose(message) {
483484
if (message == null) message = "";
484-
this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
485+
if (this.node != null) this.node.status({ fill: "red", shape: "dot", text: "Disconnected " + message });
485486
this.onclose(false, null);
486487

487488
}
@@ -544,6 +545,7 @@ export class assign_workflow_node {
544545
if (ack !== null && ack !== undefined) ack();
545546
return;
546547
}
548+
const currentinstance = res[0];
547549
const state = res[0].state;
548550
const _parentid = res[0].parentid;
549551
if (_parentid !== null && _parentid !== undefined && _parentid !== "") {
@@ -553,16 +555,16 @@ export class assign_workflow_node {
553555
if (ack !== null && ack !== undefined) ack();
554556
return;
555557
}
556-
557-
res2[0].state = state;
558-
result = res[0].msg;
558+
const parentinstance = res2[0];
559+
result = parentinstance.msg;
559560
if (NoderedUtil.IsNullUndefinded(result)) result = {};
561+
result.state = data.state;
560562
result.payload = data.payload;
561563
result.jwt = data.jwt;
562564
result.user = data.user;
563565
this.node.send([null, result]);
564566
if (ack !== null && ack !== undefined) ack();
565-
await NoderedUtil.UpdateOne("workflow_instances", null, res[0], 1, false, null);
567+
// await NoderedUtil.UpdateOne("workflow_instances", null, res[0], 1, false, null);
566568
return;
567569
}
568570
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.90
1+
1.1.91

docker-compose-toolbox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
- "traefik.http.routers.web.rule=Host(`toolbox.openrpa.dk`)"
4646
- "traefik.http.routers.web.entrypoints=web"
4747
- "traefik.frontend.passHostHeader=true"
48-
image: "cloudhack/openflow:1.1.90"
48+
image: "cloudhack/openflow:1.1.91"
4949
container_name: "web"
5050
environment:
5151
- update_acl_based_on_groups=true
@@ -82,7 +82,7 @@ services:
8282
- "traefik.http.routers.nodered.rule=Host(`nodered1.toolbox.openrpa.dk`)"
8383
- "traefik.http.routers.nodered.entrypoints=web"
8484
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
85-
image: "cloudhack/openflownodered:1.1.90"
85+
image: "cloudhack/openflownodered:1.1.91"
8686
container_name: "nodered"
8787
environment:
8888
# - nodered_id=1

docker-compose-traefik-letsencrypt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ services:
6969
- "traefik.http.routers.web.entrypoints=web,websecure"
7070
- "traefik.frontend.passHostHeader=true"
7171
- "traefik.http.routers.web.tls.certresolver=myresolver"
72-
image: "cloudhack/openflow:1.1.90"
72+
image: "cloudhack/openflow:1.1.91"
7373
container_name: "web"
7474
environment:
7575
- update_acl_based_on_groups=true
@@ -107,7 +107,7 @@ services:
107107
- "traefik.http.routers.nodered.entrypoints=web,websecure"
108108
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
109109
- "traefik.http.routers.nodered.tls.certresolver=myresolver"
110-
image: "cloudhack/openflownodered:1.1.90"
110+
image: "cloudhack/openflownodered:1.1.91"
111111
container_name: "nodered"
112112
environment:
113113
# - nodered_id=1

docker-compose-traefik.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
- "traefik.http.routers.web.rule=Host(`localhost.openrpa.dk`)"
4646
- "traefik.http.routers.web.entrypoints=web"
4747
- "traefik.frontend.passHostHeader=true"
48-
image: "cloudhack/openflow:1.1.90"
48+
image: "cloudhack/openflow:1.1.91"
4949
container_name: "web"
5050
environment:
5151
- update_acl_based_on_groups=true
@@ -82,7 +82,7 @@ services:
8282
- "traefik.http.routers.nodered.rule=Host(`nodered1.localhost.openrpa.dk`)"
8383
- "traefik.http.routers.nodered.entrypoints=web"
8484
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
85-
image: "cloudhack/openflownodered:1.1.90"
85+
image: "cloudhack/openflownodered:1.1.91"
8686
container_name: "nodered"
8787
environment:
8888
# - nodered_id=1

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- "5672:5672"
1919
- "15672:15672"
2020
web:
21-
image: "cloudhack/openflow:1.1.90"
21+
image: "cloudhack/openflow:1.1.91"
2222
environment:
2323
- update_acl_based_on_groups=true
2424
- multi_tenant=false
@@ -52,7 +52,7 @@ services:
5252
- "80:80"
5353
- "5858:5858"
5454
nodered:
55-
image: "cloudhack/openflownodered:1.1.90"
55+
image: "cloudhack/openflownodered:1.1.91"
5656
environment:
5757
# - nodered_id=1
5858
- nodered_sa=nodered1

0 commit comments

Comments
 (0)