ollixx / node-red-contrib-components

reusable flows with a well defined api
MIT License
8 stars 9 forks source link

Nested component with an Output Port set to 'separate' can break parent Return node #62

Open objt-awn opened 8 months ago

objt-awn commented 8 months ago

If the outputs of the nested node are merged in the parent component back into a single flow that leads to a single return node, the single return node can no longer find the start node. If the parent node has multiple Return nodes, even if both are default outputs, it does not fail.

Depending on how the flow is put together, the error will appear

image

[ { "id": "3f65b41a396f4bf0", "type": "comment", "z": "01344d5a7e2c1355", "name": "A component return node must have exactly one component start node. Found 0 start nodes", "info": "", "x": 810, "y": 1180, "wires": [] }, { "id": "25e91e13295c1123", "type": "group", "z": "01344d5a7e2c1355", "name": "Works", "style": { "label": true, "fill": "#c8e7a7" }, "nodes": [ "2a68d00ac5f5b982", "b40bd76b90e8e3f9", "4d8ef818042731ab", "9074392a4e6126d6" ], "x": 254, "y": 919, "w": 632, "h": 122 }, { "id": "2a68d00ac5f5b982", "type": "component_in", "z": "01344d5a7e2c1355", "g": "25e91e13295c1123", "name": "parent comp", "api": [], "usecontext": true, "x": 350, "y": 980, "wires": [ [ "4d8ef818042731ab" ] ] }, { "id": "b40bd76b90e8e3f9", "type": "component_out", "z": "01344d5a7e2c1355", "g": "25e91e13295c1123", "name": "", "mode": "default", "component_definitions_are_NOT_allowed_inside_subflows": false, "x": 790, "y": 960, "wires": [] }, { "id": "4d8ef818042731ab", "type": "component", "z": "01344d5a7e2c1355", "g": "25e91e13295c1123", "name": "", "targetComponent": null, "targetComponentId": "ffc5cbc7cb69c22d", "paramSources": {}, "statuz": "", "statuzType": "str", "outputs": 2, "outLabels": [ "default", "Separate" ], "x": 560, "y": 980, "wires": [ [ "b40bd76b90e8e3f9" ], [ "9074392a4e6126d6" ] ] }, { "id": "9074392a4e6126d6", "type": "component_out", "z": "01344d5a7e2c1355", "g": "25e91e13295c1123", "name": "", "mode": "default", "component_definitions_are_NOT_allowed_inside_subflows": false, "x": 790, "y": 1000, "wires": [] }, { "id": "11cae7393974374e", "type": "group", "z": "01344d5a7e2c1355", "name": "Fails", "style": { "label": true, "fill": "#ffbfbf" }, "nodes": [ "83eb1a83e36b50f7", "61c8db731d91b51e", "87469e01be540572" ], "x": 254, "y": 1079, "w": 632, "h": 82 }, { "id": "83eb1a83e36b50f7", "type": "component_in", "z": "01344d5a7e2c1355", "g": "11cae7393974374e", "name": "parent comp", "api": [], "usecontext": true, "x": 350, "y": 1120, "wires": [ [ "87469e01be540572" ] ] }, { "id": "61c8db731d91b51e", "type": "component_out", "z": "01344d5a7e2c1355", "g": "11cae7393974374e", "name": "", "mode": "default", "component_definitions_are_NOT_allowed_inside_subflows": false, "x": 790, "y": 1120, "wires": [] }, { "id": "87469e01be540572", "type": "component", "z": "01344d5a7e2c1355", "g": "11cae7393974374e", "name": "", "targetComponent": null, "targetComponentId": "ffc5cbc7cb69c22d", "paramSources": {}, "statuz": "", "statuzType": "str", "outputs": 2, "outLabels": [ "default", "Separate" ], "x": 560, "y": 1120, "wires": [ [ "61c8db731d91b51e" ], [ "61c8db731d91b51e" ] ] }, { "id": "9a68683af7436a7f", "type": "group", "z": "01344d5a7e2c1355", "name": "Nested component", "style": { "label": true, "fill": "#ffffbf" }, "nodes": [ "ffc5cbc7cb69c22d", "da1844bbdc603d0f", "a9b0710458117f5e", "16c3629390e7186c" ], "x": 254, "y": 759, "w": 632, "h": 142 }, { "id": "ffc5cbc7cb69c22d", "type": "component_in", "z": "01344d5a7e2c1355", "g": "9a68683af7436a7f", "name": "nested comp", "api": [], "usecontext": true, "x": 350, "y": 840, "wires": [ [ "16c3629390e7186c" ] ] }, { "id": "da1844bbdc603d0f", "type": "component_out", "z": "01344d5a7e2c1355", "g": "9a68683af7436a7f", "name": "", "mode": "default", "component_definitions_are_NOT_allowed_inside_subflows": false, "x": 790, "y": 800, "wires": [] }, { "id": "a9b0710458117f5e", "type": "component_out", "z": "01344d5a7e2c1355", "g": "9a68683af7436a7f", "name": "Separate", "mode": "separate", "component_definitions_are_NOT_allowed_inside_subflows": false, "x": 780, "y": 860, "wires": [] }, { "id": "16c3629390e7186c", "type": "switch", "z": "01344d5a7e2c1355", "g": "9a68683af7436a7f", "name": "", "property": "true", "propertyType": "jsonata", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 550, "y": 840, "wires": [ [ "da1844bbdc603d0f" ], [ "a9b0710458117f5e" ] ] } ]