 
   addNodeDataflow: (nfNode, dfGraph) ->
     return unless nfNode
-
-    return if nfNode.dataflowNode?
-
-    #HACK to not add twice
-    return if dfGraph.nodes.findWhere({nofloId: nfNode.id})?
+    return if nfNode.dataflowNode
 
     # Load the component
     dfNode = @dataflow.plugins.nofloLibrary.getInstance nfNode.component,


  addEdgeDataflow: (nfEdge, dfGraph) ->
    return unless nfEdge

    edgeToId = (edge) ->
      if edge.dataflowEdge


  subscribeDataflowEdge: (edge, graph) ->
    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'

      # Reference one another
      edge.nofloEdge = nofloEdge
      nofloEdge.dataflowEdge = edge

    edge.on 'change:route', ->
      edge.nofloEdge.metadata.route = edge.get 'route'

  subscribeNoFloEvents: (graph, runtime) ->
    graph.on 'addNode', (nfNode) =>
      setTimeout =>
        @addNodeDataflow nfNode, graph.dataflowGraph
        @addNodeRuntime nfNode, runtime
      , 0
    graph.on 'removeNode', (nfNode) =>
      if nfNode.dataflowNode?
        nfNode.dataflowNode.remove()
      runtime.sendGraph 'removenode',
        id: nfNode.id
    graph.on 'addEdge', (nfEdge) =>
      setTimeout =>
        @addEdgeDataflow nfEdge, graph.dataflowGraph
        @addEdgeRuntime nfEdge, runtime
      , 0
    graph.on 'removeEdge', (nfEdge) =>
      if nfEdge.from.node? and nfEdge.to.node?
        if nfEdge.dataflowEdge?
