Hey everyone,
In our team we’re working with Jambonz, and we rely on multiple flow tabs across various instances. Sometimes, when importing flows or using copy/paste, I’ve noticed that link in
and link out
nodes end up connected across tabs. Which isn't always obvious in the editor.
Right now, there’s no built-in way to spot when a link out
is connected to a link in
on another flow tab, and this has led to some subtle and hard-to-trace issues in our deployments.
It would be awesome if this kind of cross-tab link detection could be implemented in nrlint
as a rule. We’d love to flag this automatically before deploying flows.
Example Flow:
[
{
"id": "e36062e25dde582e",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "77ec5a2928f81681",
"type": "link out",
"z": "e36062e25dde582e",
"name": "link out 4",
"mode": "link",
"links": ["58d242c5274dfb9f"],
"x": 1025,
"y": 120,
"wires": []
},
{
"id": "0d2cddaad035a262",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "58d242c5274dfb9f",
"type": "link in",
"z": "0d2cddaad035a262",
"name": "link in 1",
"links": ["77ec5a2928f81681"],
"x": 1015,
"y": 120,
"wires": [[]]
}
]
Here’s a simple script I wrote to detect when link out
and link in
nodes are connected across different tabs:
function findCrossTabLinks(flow) {
const linkInNodes = flow.filter(n => n.type === "link in");
const linkOutNodes = flow.filter(n => n.type === "link out");
const tabs = flow.filter(n => n.type === "tab");
const tabLabels = Object.fromEntries(tabs.map(tab => [tab.id, tab.label]));
const result = [];
linkOutNodes.forEach(outNode => {
outNode.links.forEach(linkId => {
const targetNode = linkInNodes.find(inNode => inNode.id === linkId);
if (targetNode && outNode.z !== targetNode.z) {
result.push({
from: outNode.id,
fromName: outNode.name || "",
fromTab: outNode.z,
fromTabLabel: tabLabels[outNode.z] || "",
to: targetNode.id,
toName: targetNode.name || "",
toTab: targetNode.z,
toTabLabel: tabLabels[targetNode.z] || "",
});
}
});
});
return result;
}
Thanks!
- Wesley