From efaabc4514655e1514a841fd913abea7f2c5fe79 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 2 Oct 2013 16:32:57 +0200 Subject: [PATCH] Clear IIP if a connection is made to that port, refs meemoo/dataflow#72 --- src/plugins/nofloGraph.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/nofloGraph.coffee b/src/plugins/nofloGraph.coffee index 65123536c..2645dd2e0 100644 --- a/src/plugins/nofloGraph.coffee +++ b/src/plugins/nofloGraph.coffee @@ -145,6 +145,13 @@ class NoFloGraphPlugin graph.nofloGraph.removeInitial node.nofloNode.id, port subscribeDataflowEdge: (edge, graph) -> + # Ensure there is no IIP left behind when we make a connection to the port + for iip in graph.nofloGraph.initializers + continue unless iip + if iip.to.node is edge.target.parentNode.nofloNode.id and iip.to.port is edge.target.id + graph.nofloGraph.removeInitial edge.target.parentNode.nofloNode.id, edge.target.id + + # Create edge as needed unless edge.nofloEdge nofloEdge = graph.nofloGraph.addEdge edge.source.parentNode.nofloNode.id, edge.source.id, edge.target.parentNode.nofloNode.id, edge.target.id, route: edge.get 'route'