Flow-Based Programming Tutorial

335 views
Skip to first unread message

Paul Morrison

unread,
May 13, 2019, 2:43:03 PM5/13/19
to Flow Based Programming
I have put the first few steps of a tutorial on Flow-Based Programming up on GitHub - the URL is https://github.com/jpaulm/fbp-tutorial-filter-fileIt uses DrawFBP as the diagramming tool, and JavaFBP as the implementation software.

As suggested by Vladimir Sibirov, it is mostly a Readme, with a few diagrams and in-line listings included.  In it, I try to grow a simple application "organically" from a diagram built using DrawFBP to a running application.

I understand that I cannot include the whole book "Flow-Based Programming" in the tutorial, so I find myself going off on (probably inadequate) digressions into FBP ideas... I have to assume that the reader has a nodding acquaintance with the concepts, but I don't know how much to assume!

So I would really appreciate some feedback - and maybe even one or more collaborators.  Vlad is the only official collaborator so far, but volunteers to do some of the work would be very welcome!  Also there are "meta-questions", e.g. would a branch structure (with multiple links) be more or less confusing, etc.?  You may remember that I put up some videos showing how DrawFBP can be used - listed near the end of http://www.jpaulmorrison.com/fbp/ - but these may suffer from the same problems... if not worse!

Looking forward to hearing from people, especially those who are registered as members, but who I never hear from!

Paul M.

PS A number of you have cloned JavaFBP over the years - what happened with this?!

Shiva Pandiri

unread,
Aug 9, 2019, 9:43:39 AM8/9/19
to Flow Based Programming
Hi Sir,

Thank u so much for your post. I am very new to FBP. Started two days ago. Want to know how how to send data to two components at a time, Please help me with java examples.

David Lovemore

unread,
Aug 10, 2019, 2:36:09 AM8/10/19
to flow-based-...@googlegroups.com
I find your writing style difficult. Your paragraphs lack focus. So you start talking about one topic and end up talking about something several topics away within a few sentences.

I am not a technical author but I know people who have worked as technical authors. They say that a paragraph should either begin with a topic which is then expanded on by subsequent sentences, or be some sentences that build to a particular point summarized by the final sentence.

By all means continue to write the way you do. It's important to get this stuff out of your head and onto the computer. But your text would benefit from love and attention of an expert communicator.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/flow-based-programming/320fbd65-4b58-4343-a096-308534d7623a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Lovemore

unread,
Aug 10, 2019, 3:13:14 AM8/10/19
to flow-based-...@googlegroups.com
Paul,

I got stuck at step 03.

"Click on the JavaFBP jar file entry, and you can start walking through its tree structure, until you find the component you need, which is in the package com/jpaulmorrison/fbp/core/components/text."

Under:
/home/pi/prog/drawfbp/drawfbp-all-2.16.16.jar!/com/jpaulmorrison

I can only see graphics directory, no fbp.

So I cannot find text.StartsWith component.



On Mon, May 13, 2019 at 7:43 PM Paul Morrison <paul.m...@rogers.com> wrote:
--

Paul Morrison

unread,
Aug 10, 2019, 10:37:03 AM8/10/19
to flow-based-...@googlegroups.com, Bob Corrick
Hi Dave,

That one I can answer!  I think you are walking the wrong jar file... it does say " JavaFBP jar file", but maybe that's ambiguous...  I meant to walk the JavaFBP jar file which should show at the top of the list of components (when you select Block/Choose Component/Subnet Class") - not the DrawFBP jar file....

Bob, is there a wording that would make this clearer?

Cheers,

Paul

David Lovemore

unread,
Aug 10, 2019, 12:45:00 PM8/10/19
to flow-based-...@googlegroups.com, Bob Corrick
Paul,

I did not understand the difference between drawFBP and javaFBP.

There was also insufficient sanity check in the software I had the right file.

You could add a "troubleshooting" paragraph, at the point I made the mistake. Or somehow in the tutorial, perform some mini step that does check it. Finding com/jpaulmorrison/fbp is a sanity check.

David


David Lovemore

unread,
Aug 10, 2019, 1:15:19 PM8/10/19
to flow-based-...@googlegroups.com, Bob Corrick
Comments so far...

Step00: Windows only. I am programming on a raspberry pi linux box. I needed to examine bat file to work out how to run on linux.

Step02: The step02.png diagram is the same as step03.png. I think this is a mistake. Anyway it confused me how to add the class without skipping ahead to step03. 

David Lovemore

unread,
Aug 11, 2019, 6:59:42 AM8/11/19
to flow-based-...@googlegroups.com, Bob Corrick
Paul,

I got the following error trying to run the code from step 10. I am not sure how it happened.

pi@raspberrypi:~/prog/playfbp $ java -cp ~/prog/fbp/javafbp-4.1.0.jar:. step10.java
step10.java:7: error: <identifier> expected
  component("display_count",com.jpaulmorrison.fbp.core.components.swing.ShowText.class.class);
                                                                                       ^
step10.java:9: error: <identifier> expected
  component("ignore",com.jpaulmorrison.fbp.core.components.routing.Discard.class.class);
                                                                                 ^
step10.java:11: error: <identifier> expected
  component("count",com.jpaulmorrison.fbp.core.components.misc.Counter.class.class);
                                                                             ^
3 errors
error: compilation failed

Paul Morrison

unread,
Aug 11, 2019, 9:23:31 AM8/11/19
to flow-based-...@googlegroups.com, Bob Corrick
Thanks, Dave, yes, Bob got that one too.  I am currently working on a fix, and hope to release it later today or tomorrow.  Not sure if it is worth creating a new release for it...  What do you think, Bob?

You could probably try an earlier release of DrawFBP, but I don't know when that bug crept in, so you might want to wait... or just edit the generated network manually... (just drop the second ".class")

Regards,

Paul



Paul Morrison

unread,
Aug 11, 2019, 10:15:50 AM8/11/19
to flow-based-...@googlegroups.com, Bob Corrick
I have decided to start a new release of DrawFBP: v2.16.18...  For now, I have left it as pre-Release...  It is at https://github.com/jpaulm/drawfbp/releases/tag/v2.16.18 .

If it checks out  🤞,  I will change it to a regular release, and promote it to Maven...

Thanks for your patience, guys!

Paul M.

Bob Corrick

unread,
Jul 27, 2020, 6:14:28 AM7/27/20
to Flow Based Programming
*** Update July 2020 *** Please see https://www.youtube.com/channel/UCtWXOEKp_irkkX9LSjMWh_A/ for two videos of this DrawFBP tutorial, firstly Step1 (intro, simplest FBP network), secondly Step12 (subnet). Both under 10 minutes.

Tom

unread,
Jul 28, 2020, 6:26:12 AM7/28/20
to flow-based-...@googlegroups.com
Hi!

I'd be very interested (in following) a guide from creating a hello world program into practical examples like creating your own "ls" or similar cmdline tools into creating a webserver that serves a webpage :)

I think this would give many people that otherwise wouldn't get that far the chance to experience FBP.

The examples I mentioned favor NoFlo because I use Node.js day to day :-)

gr,

Tom

--
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.

Paul Morrison

unread,
Jul 28, 2020, 10:24:57 AM7/28/20
to flow-based-...@googlegroups.com, Bob Corrick
Hi Tom,

I think Bob Corrick's first video - https://www.youtube.com/watch?v=zN2h439gu4A&t=201s - is the definitive "Hello World" for JavaFBP, using DrawFBP as the editor...  You can probably put off watching his second one, which involves subnets, until you need that feature... (right, Bob?) 

Once you have watched the first video, you can take a look at  https://github.com/jpaulm/javafbp-websockets - this shows a JavaFBP-written server, and a Mickey Mouse HTML5/JavaScript client...!  And you will be on your way... 🙂

All the best,

Paul M.



Paul Morrison

unread,
Dec 12, 2020, 2:39:13 PM12/12/20
to Flow Based Programming
This seems to be the latest reference to JavaFBP-WebSockets - https://github.com/jpaulm/javafbp-websockets  - a demo of a server written using JavaFBP - talking to clients which use HTML5/JavaScript... which I think could be a very interesting and powerful combination, as it speaks to the strengths of both technologies!

The server shown here handles clients using wss: (SSL), not ws:, as the underlying software, Nate Rajlich and Marcel Prestel's Java-WebSocket, will no longer support ws: (if I am not mistaken)...  I have managed to install a self-signed localhost certificate for Chrome, and I describe how to do that in the Readme, but I don't know how to do that for Firefox... or even if it's allowed!  I would very much appreciate help and/or guidance on this.  BTW it would also be great if people wanted to try writing clients in other languages!

Please try it out, and let me know how it goes!

Stay safe, everyone!
Reply all
Reply to author
Forward
0 new messages