A Ruote workitem con contain additional workitem payload in the fields
attribute.
The content of the fields attribute can be set at any time and the content
is passed to the next workitem when the previous one is proceeded.

This behavior is perfect if I want persistent fields. But what about
temporary values I want to stay in the workitem only for the duration of
that specific workitem?

What I'm trying to accomplish, is to have a place where I can store some
variables that lasts only for that specific workitem.
When the workitem proceeded and the payload is copied, this set of values
should be cleared.

I'm currently doing this by having a special hash in the fields attribute I
reset in the Participant#consume each time the workitem is consumed.
Unfortunately, this approach doesn't work very well because if I use a
different participant, the hash won't be cleared.

There are several real world cases for this feature:

   1. I want to be able to temporary set a variable and use it in the
   workflow definition to trigger some special workflow actions
   2. I want to be able to clear a set of variables when the workitem is
   consumed

Is there any existing and clean way to accomplish this?

I came with a couple of solutions.

The first idea is to use naming conventions. For instance, a fields
attribute called with a specific prefix won't be copied to the new workitem.
I don't really like this solution because it would make more difficult to
use the variable in the workflow definition (eg. ...., :if =>
"{$f:__tmpvalue__} == 10"

The second idea is to use a special attribute instead of fields that will be
ignored when Ruote copies the workitem payload.
I could also modify Ruote in order to make a new t: notation available. (eg.
...., :if => "{$t:tmpvalue} == 10"

What do you think about it? Have you ever encountered this need before?


-- 
Simone Carletti
Application Developer

Site & Blog: http://www.simonecarletti.com
Email: [email protected]
LinkedIn: http://linkedin.com/in/weppos
Skype: weppos

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to