0

i am creating noflo project and need o get project or graph id inside the component

here is a simple component code

noflo = require 'noflo'

exports.getComponent = ->
  c = new noflo.Component
  c.inPorts.add 'in', (event, payload) ->
    return unless event is 'data'
    # Do something with the packet, then
    c.outPorts.out.send payload
  c.outPorts.add 'out'
c

is any event or any noflo object have project id or any noflo class having it so i include that one

thanks

code.rider
  • 1,891
  • 18
  • 21

1 Answers1

2

NoFlo components being executed have no knowledge of the graph or project they are being executed in. This encapsulation is an important part of the component-based approach in FBP. To get access to an identifier, you should send it as an IIP on an inport (like any other piece of data needed by component).

Jon Nordby
  • 5,494
  • 1
  • 21
  • 50