node-red-contrib-actionflows
Advanced tools
Comparing version 2.0.1 to 2.0.3
module.exports = function(RED) { | ||
RED.nodes.registerType("actionflows", actionflows); | ||
RED.nodes.registerType("actionflows", actionflows); | ||
function actionflows(config) { | ||
@@ -285,3 +285,3 @@ var node = this; | ||
if (sub != null) { | ||
let inst = sub.instanceNodes; | ||
let inst = instanceNodesForSub(sub); | ||
for(var id in inst) { | ||
@@ -295,3 +295,3 @@ if (inst[id].type.startsWith("actionflows")) { | ||
}); | ||
// Merge alias with original object properties | ||
@@ -477,4 +477,4 @@ for(x in flows) { | ||
if (sub != null) { | ||
if (typeof sub.instanceNodes != "undefined") { | ||
var inst = sub.instanceNodes; | ||
var inst = instanceNodesForSub(sub); | ||
if (typeof inst != "undefined") { | ||
for(var id in inst) { | ||
@@ -598,3 +598,23 @@ if (id != f.id) { | ||
} | ||
function instanceNodesForSub(sub) { | ||
if(sub.hasOwnProperty('instanceNodes')) { | ||
return sub.instanceNodes; // Compatibility with Node-RED 0.19 | ||
} | ||
if(sub.hasOwnProperty('_flow') && sub._flow.activeNodes) { | ||
const allNodes = {}; | ||
allNodes[sub.id] = sub; | ||
for(const nodeId in sub._flow.activeNodes) { | ||
const node = sub._flow.activeNodes[nodeId]; | ||
allNodes[node.id] = node; | ||
if(node.type.startsWith('subflow:')) { | ||
Object.assign(allNodes, instanceNodesForSub(node)); | ||
} | ||
} | ||
return allNodes; | ||
} | ||
return {}; | ||
} | ||
RED.events.on("nodes-started", runtimeMap); | ||
} |
{ | ||
"name": "node-red-contrib-actionflows", | ||
"version": "2.0.1", | ||
"version": "2.0.3", | ||
"description": "Create extendable, loopable, and reusable design patterns for flows.", | ||
@@ -5,0 +5,0 @@ "author": "Stephen J. Carnam <steveorevo@gmail.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1429398
1555