Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary
2020-01-22 11:54:24 +00:00
54 changed files with 442 additions and 352 deletions

View File

@@ -52,7 +52,7 @@ function Node(n) {
// the object (such as dashboard) will not like circular refs
// The value must still be writable in the case that a node does:
// Object.assign(this,config)
// as part of its constructure - config._flow will overwrite this._flow
// as part of its constructor - config._flow will overwrite this._flow
// which we can tolerate as they are the same object.
Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true })
this._asyncDelivery = n._flow.asyncMessageDelivery;
@@ -462,6 +462,9 @@ function log_helper(self, level, msg) {
if (self._alias) {
o._alias = self._alias;
}
if (self._flow) {
o.path = self._flow.path;
}
if (self.z) {
o.z = self.z;
}

View File

@@ -53,6 +53,7 @@ class Flow {
this.subflowInstanceNodes = {};
this.catchNodes = [];
this.statusNodes = [];
this.path = this.id;
}
/**
@@ -120,7 +121,7 @@ class Flow {
* @return {[type]} [description]
*/
start(diff) {
this.trace("start "+this.TYPE);
this.trace("start "+this.TYPE+" ["+this.path+"]");
var node;
var newNode;
var id;
@@ -234,7 +235,7 @@ class Flow {
for (id in this.activeNodes) {
if (this.activeNodes.hasOwnProperty(id)) {
node = this.activeNodes[id];
this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||""));
this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||"")+(node._zAlias?" [zAlias:"+node._zAlias+"]":""));
if (node.type === "catch") {
this.catchNodes.push(node);
} else if (node.type === "status") {

View File

@@ -88,7 +88,7 @@ class Subflow extends Flow {
* @param {[type]} subflowInstance [description]
*/
constructor(parent,globalFlow,subflowDef,subflowInstance) {
// console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id);
// console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id,"alias?",subflowInstance._alias);
// console.log("SubflowInstance\n"+JSON.stringify(subflowInstance," ",2));
// console.log("SubflowDef\n"+JSON.stringify(subflowDef," ",2));
var subflows = parent.flow.subflows;
@@ -140,6 +140,7 @@ class Subflow extends Flow {
this.subflowDef = subflowDef;
this.subflowInstance = subflowInstance;
this.node_map = node_map;
this.path = parent.path+"/"+(subflowInstance._alias||subflowInstance.id);
var env = [];
if (this.subflowDef.env) {
@@ -451,7 +452,7 @@ class Subflow extends Flow {
function createNodeInSubflow(subflowInstanceId, def) {
let node = clone(def);
let nid = redUtil.generateId();
// console.log("Create Node In subflow",node.id, "--->",nid, "(",node.type,")")
// console.log("Create Node In subflow",node._alias, "--->",nid, "(",node.type,")")
// node_map[node.id] = node;
node._alias = node.id;
node.id = nid;