jpaulm / drawfbp

Tool for Creating and Exploring Flow-Based Programming Diagram Hierarchies
http://www.jpaulmorrison.com/fbp/
146 stars 20 forks source link

Support arbitrary string instead of class. #4

Closed alfa256 closed 4 years ago

alfa256 commented 9 years ago

When dealing with other languages a class file might not be the correct abstraction so allowing a string to be used as the "component" property of a process will help.

jpaulm commented 9 years ago

Hi Alfredo,

Class does not apply to the other languages supported by DrawFBP. You'll notice that, if you switch to another language (using Select Diagram Language), the "class" option is greyed out. I tried to make DrawFBP open-ended with respect to other languages, but odd quirks keep slipping in! Since DrawFBP is written in Java, it has no problem accessing the annotations in class files, which it then uses when checking diagrams, but I'm not sure how it should interface with C#, C++, etc. I've tried to leave hooks in place for several other languages, and I assume that Groovy and Scala would work just like Java - although I haven't tried them.

Perhaps you (and other readers) could give some thought to a more universal interface... Or even languages that I could experiment with... :-)

Thanks,

Paul M.

On Fri, Jul 31, 2015 at 9:06 PM, alfa256 notifications@github.com wrote:

When dealing with other languages a class file might not be the correct abstraction so allowing a string to be used as the "component" property of a process will help.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4.

alfa256 commented 9 years ago

Oh it's a very simple thing, you'd lose the ability to view the component code but instead of picking a class you could prompt for a component name and then let the engine that runs it decide what to do with it. In my case it would be like "core/Log" , and then my engine handles it. There's no checking done in drawfbp but giving an option to run an arbitrary command upon pressing F5 or a Run option would be good, so that the graph is translated to json and then saved to the target route, where execution takes place.

El lun., 3 ago. 2015 a las 15:39, Paul Morrison (notifications@github.com) escribió:

Hi Alfredo,

Class does not apply to the other languages supported by DrawFBP. You'll notice that, if you switch to another language (using Select Diagram Language), the "class" option is greyed out. I tried to make DrawFBP open-ended with respect to other languages, but odd quirks keep slipping in! Since DrawFBP is written in Java, it has no problem accessing the annotations in class files, which it then uses when checking diagrams, but I'm not sure how it should interface with C#, C++, etc. I've tried to leave hooks in place for several other languages, and I assume that Groovy and Scala would work just like Java - although I haven't tried them.

Perhaps you (and other readers) could give some thought to a more universal interface... Or even languages that I could experiment with... :-)

Thanks,

Paul M.

On Fri, Jul 31, 2015 at 9:06 PM, alfa256 notifications@github.com wrote:

When dealing with other languages a class file might not be the correct abstraction so allowing a string to be used as the "component" property of a process will help.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127365447.

jpaulm commented 9 years ago

I am thinking of adding a Run button which would prompt the user to enter a command - or should it simply run a file with some fixed name, which could be modified to hold a command? I think either one would be fairly easy to do...

Is this (or one of these) what you had in mind? TIA

On Mon, Aug 3, 2015 at 3:10 PM, alfa256 notifications@github.com wrote:

Oh it's a very simple thing, you'd lose the ability to view the component code but instead of picking a class you could prompt for a component name and then let the engine that runs it decide what to do with it. In my case it would be like "core/Log" , and then my engine handles it. There's no checking done in drawfbp but giving an option to run an arbitrary command upon pressing F5 or a Run option would be good, so that the graph is translated to json and then saved to the target route, where execution takes place.

El lun., 3 ago. 2015 a las 15:39, Paul Morrison (<notifications@github.com

) escribió:

Hi Alfredo,

Class does not apply to the other languages supported by DrawFBP. You'll notice that, if you switch to another language (using Select Diagram Language), the "class" option is greyed out. I tried to make DrawFBP open-ended with respect to other languages, but odd quirks keep slipping in! Since DrawFBP is written in Java, it has no problem accessing the annotations in class files, which it then uses when checking diagrams, but I'm not sure how it should interface with C#, C++, etc. I've tried to leave hooks in place for several other languages, and I assume that Groovy and Scala would work just like Java - although I haven't tried them.

Perhaps you (and other readers) could give some thought to a more universal interface... Or even languages that I could experiment with... :-)

Thanks,

Paul M.

On Fri, Jul 31, 2015 at 9:06 PM, alfa256 notifications@github.com wrote:

When dealing with other languages a class file might not be the correct abstraction so allowing a string to be used as the "component" property of a process will help.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127365447.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127374634.

alfa256 commented 9 years ago

Prompting for a command every run would be tedious, I'd rather have it be a string like "C:/foo/bar/thing.exe etc $GRAPHJSON", and $GRAPH would be replaced by the filename of the json version of the graph, or something in that style. In any case, it's the for the usecase of running graphs with engines that can feed from the json graphs.

El mar., 4 ago. 2015 a las 22:55, Paul Morrison (notifications@github.com) escribió:

I am thinking of adding a Run button which would prompt the user to enter a command - or should it simply run a file with some fixed name, which could be modified to hold a command? I think either one would be fairly easy to do...

Is this (or one of these) what you had in mind? TIA

On Mon, Aug 3, 2015 at 3:10 PM, alfa256 notifications@github.com wrote:

Oh it's a very simple thing, you'd lose the ability to view the component code but instead of picking a class you could prompt for a component name and then let the engine that runs it decide what to do with it. In my case it would be like "core/Log" , and then my engine handles it. There's no checking done in drawfbp but giving an option to run an arbitrary command upon pressing F5 or a Run option would be good, so that the graph is translated to json and then saved to the target route, where execution takes place.

El lun., 3 ago. 2015 a las 15:39, Paul Morrison (< notifications@github.com

) escribió:

Hi Alfredo,

Class does not apply to the other languages supported by DrawFBP. You'll notice that, if you switch to another language (using Select Diagram Language), the "class" option is greyed out. I tried to make DrawFBP open-ended with respect to other languages, but odd quirks keep slipping in! Since DrawFBP is written in Java, it has no problem accessing the annotations in class files, which it then uses when checking diagrams, but I'm not sure how it should interface with C#, C++, etc. I've tried to leave hooks in place for several other languages, and I assume that Groovy and Scala would work just like Java - although I haven't tried them.

Perhaps you (and other readers) could give some thought to a more universal interface... Or even languages that I could experiment with... :-)

Thanks,

Paul M.

On Fri, Jul 31, 2015 at 9:06 PM, alfa256 notifications@github.com wrote:

When dealing with other languages a class file might not be the correct abstraction so allowing a string to be used as the "component" property of a process will help.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127365447.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127374634.

— Reply to this email directly or view it on GitHub https://github.com/jpaulm/drawfbp/issues/4#issuecomment-127817260.

afshin2003 commented 9 years ago

+1 It is my interest too. According to noflo conventions of addressing components I need to specify components like core/Kick.

jpaulm commented 9 years ago

@afshin2003 @alfa256 It seems to me that we are now talking about two different things: Alfredo seems to be interested in a command function, callable from DrawFBP, with the diagram's JSON file name being automatically filled in - I have taken a stab at that, and it is in https://github.com/jpaulm/drawfbp/releases/tag/v2.10.10 - File/Run Command.

IIUC Afshin (and possibly Alfredo too) is concerned about the component designation which gets associated with the node name in a network. I will be trying to organize the various possible combinations that DrawFBP should support over the next few days, and will bounce it off you. In the meantime, perhaps the two of you could let me know if I am on the right track, or have misunderstood your concerns! TIA

alfa256 commented 9 years ago

The first issue is addressed Paul. As for the second requirement, instead of picking a file/class, I would like to simply input a string for the Component of a given Process. Something like left click -> input component. The string would be free form ( except for spaces or empty string) and just accept it as the value for the component that will be used when exporting the graph. For example "core/Log" or "Core/Kick", "math.add", etc, any arbitrary string.

jpaulm commented 9 years ago

@alfa256 , just to clarify... When you said, "The first issue is addressed", did you mean you had tried File/Run Command, and, if so, did it work OK?! Or did you find a different technique?

Re the second: I have coded up a prototype, but in the case of Java, I allow the user to browse a library - mostly because DrawFBP is comfortable in a Java environment! I am wondering if I could somehow provide both functions: browse library, or enter string... What do you think?

alfa256 commented 9 years ago

Yes, I would like both options, browse or enter string. It would make drawfbp useful for other frameworks. I didn't try the run command because the generated JSON has "null" in the "component" property. So that's why I raised this second issue.

jpaulm commented 9 years ago

@alfa256 and @afshin2003 Just in case you weren't notified, the latest release, v2.10.11, is my first attempt to support arbitrary strings, and seems to play well with File/Run Command. The language has to be set to JSON (using File/Select Diagram Language) - it may work with other languages, but I haven't tried it yet. Pls give me some feedback when you have a chance. Regards.