Question about the graph-editor (https://github.com/the-grid/the-graph)

57 views
Skip to first unread message

Robi Ray

unread,
Jun 14, 2016, 10:33:31 AM6/14/16
to Flow Based Programming
Hi,
    Am very much new to the FBP world and crawling my way through the docs. We have a supply chain optimization web based app where we intend to use the flow based paradigm to carry out certain CRUD operations. I have managed to run the graph editor which uses the noflo library, locally on my server. We have a specific requirement of adding a port to a node, dynamically. Now, I know, the export option, somewhat does the same, but visually, it creates a kind of 'auxiliary' port attached to the original port. I have successfully managed to add a new port via the 'graph.addInport' method & when debugged in the browser, am able to see the new port within the graph.inports dictionary obj. However, visually, I want the node to display the new port.
a) Whether, is it possible to do so?
b) If yes, can someone help me with some pointers, as to where should I be looking into ?

Thanks a ton, in advance,
Robi.

Paul Morrison

unread,
Jun 14, 2016, 1:03:14 PM6/14/16
to flow-based-...@googlegroups.com
Happened to see this post, which got me curious - I don't speak NoFlo, but why would you want to add a port dynamically?  If the component being executed by the node doesn't know, at coding time, how many ports it has access to, I would have thought the appropriate mechanism would be an array port. 

Just a thought...

Paul M.

--
You received this message because you are subscribed to the Google Groups "Flow Based Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flow-based-progra...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Nordby

unread,
Jun 14, 2016, 2:44:34 PM6/14/16
to Flow Based Programming
By 'dynamically' do you mean when programming the system, or while the program is deployed and running?

The latter is considered bad practice, and if you describe your usecase there likely is a better alternative.

Robi Ray

unread,
Jun 15, 2016, 4:23:25 AM6/15/16
to Flow Based Programming
Jon,
   While the program is deployed & running. So, basically, our application is specific to Crude Scheduling, where we have 'n' resources/nodes (Vessel, Tank, Moor, Berth, etc) which will be connected via 'x' routes (V1B1(vessel1-->berth1, T1M1(tank1-->moor1)). There could be a situation where the user wants to add an extra port/connection on a resource to perform some operation.
   Apparently, I had a word regarding this discussion, with the team & we have decided to have 'n' ports pre-defined for a node. However, if you have a better idea, I would like to know the same.

Thanks.

stewart mackenzie

unread,
Jun 15, 2016, 8:41:48 AM6/15/16
to Flow Based Programming

stewart mackenzie

unread,
Jun 15, 2016, 8:42:09 AM6/15/16
to Flow Based Programming

Paul Morrison

unread,
Jun 15, 2016, 9:34:09 AM6/15/16
to flow-based-...@googlegroups.com
I have a slightly different tack on this - when we were first developing interactive apps using classical FBP, very often people wanted to create a process per screen, and I noticed that there was tendency to add more and more connections between screens, leading to very messy networks!

I therefore suggested that these kinds of connections be defined using tables, rather than the FBP network, and all of a sudden their networks became simpler, and, more importantly, easier to maintain!     I talk about this a bit in Chap. 19 of the first edition of my book (see figs. 19.1 and 19.2) - http://www.jpaulmorrison.com/fbp/online.shtml .  I guess I dropped a lot of it in my 2nd edition as I didn't think it was still relevant!

--
Reply all
Reply to author
Forward
0 new messages