Support npm subflow modules

This commit is contained in:
Nick O'Leary
2020-08-28 16:36:11 +01:00
committed by Nick O'Leary
parent 6e1466e411
commit 9a660f3fe9
13 changed files with 499 additions and 254 deletions

View File

@@ -208,7 +208,12 @@ class Subflow extends Flow {
this.node = new Node(subflowInstanceConfig);
this.node.on("input", function(msg) { this.send(msg);});
this.node.on("close", function() { this.status({}); })
// Called when the subflow instance node is being stopped
this.node.on("close", function(done) {
this.status({});
// Stop the complete subflow
self.stop().finally(done)
})
this.node.status = status => this.parent.handleStatus(this.node,status);
// Create a context instance
// console.log("Node.context",this.type,"id:",this._alias||this.id,"z:",this.z)