How could sarasvati help me

5 views
Skip to first unread message

sgw.y

unread,
Aug 4, 2009, 5:12:16 PM8/4/09
to sarasvati-wf-dev
I have an eclipse-like multi-view application that needs some high-
level GUI management. The first thing that comes on my mind is to map
user actions to GUI manipulations which is exactly what a workflow
engine such as sarasvati does. The idea is to describe a transition
graph representing my system's states and then executing it as a petri
net. Every time an transition fires, I would get into some state
requiring some controller's actions to be executed, these being "on
hold" until the user does something resuming the flow process.

The first straightforward problem I see with sarasvati is that it
associates every node with a new instance of some Action class. This
could get rather expensive and frankly in my opinion not a very
rational use of resources. Rather I would like to associate Action
nodes to a specific already instantiated object's method (a method of
a controller class). How can I easily do that?

Second point: have you ever thought about forking processes? With
tabbed apps, a click in a main window could cause a transition into a
state represented by a new GUI context (another tab). It is perflectly
fine to walk the process further from the new tab, but since the main
one hasn't been closed yet, if the user selects it again I have no
process to walk through from there anymore. Hence, forking a new one
could help solving this issue, making these two tabs live completely
separately.


Thanks

Paul Lorenz

unread,
Aug 4, 2009, 6:20:59 PM8/4/09
to sarasvat...@googlegroups.com
I'm not sure that Sarasvati will suit your needs, but your project sounds interesting. I'll be interested to hear if it works out.

On Tue, Aug 4, 2009 at 5:12 PM, sgw.y <fron...@gmail.com> wrote:

I have an eclipse-like multi-view application that needs some high-
level GUI management. The first thing that comes on my mind is to map
user actions to GUI manipulations which is exactly what a workflow
engine such as sarasvati does. The idea is to describe a transition
graph representing my system's states and then executing it as a petri
net. Every time an transition fires, I would get into some state
requiring some controller's actions to be executed, these being "on
hold" until the user does something resuming the flow process.

The first straightforward problem I see with sarasvati is that it
associates every node with a new instance of some Action class. This
could get rather expensive and frankly in my opinion not a very
rational use of resources. Rather I would like to associate Action
nodes to a specific already instantiated object's method (a method of
a controller class). How can I easily do that?

Sarasvati doesn't use action classes, it depends on subclasses of Node to implement various actions. I'm assuming you'd be using the memory based engine. One option would be to set the controller into the process env:

p.getEnv().setTransientAttribute( "controller", controller );

You could then use ScriptNodes to tie your actions together. Something like

<node name="foo" type="script">
    <custom>
      <execute type="js">
        <![CDATA[
          token.process.env.getTransientAttribute( "controller" ).doFoo();
        ]]>
      </execute>
    </custom>

  </node>
     
 

Second point: have you ever thought about forking processes? With
tabbed apps, a click in a main window could cause a transition into a
state represented by a new GUI context (another tab). It is perflectly
fine to walk the process further from the new tab, but since the main
one hasn't been closed yet, if the user selects it again I have no
process to walk through from there anymore. Hence, forking a new one
could help solving this issue, making these two tabs live completely
separately.

Haven't considered forking process as I've not encountered a use for it yet. Sarasvati does support nested processes, but I'm not sure that would do much for you.

Again, sounds like an interesting experiment. Good luck with it :)

cheers,
Paul
Reply all
Reply to author
Forward
0 new messages