Forum OpenACS Development: petri net question

Collapse
Posted by Max Pakhutkin on
What's the current thinking in the community about implementing task
execution by multiple resources in the Petri Net implementation of the
workflow package? Also, the system doesn't seem to support AND splits
where multiple arcs lead away from a place to multiple transitions, and
each transition may execute. Unless I've missed something in the code,
that is.

I'm implementing a small workflow system for work and have been
struggling with these questions for a while now. Possibly this
discussion could help with future development of the workflow package,
as well as help me implement my system.

If place A is an input for N transitions each of which may execute, but
there is only one input to place A, with the current implementation only
one token will get delivered to place A. How do we decide that in
reality it needs N tokens? Look ahead at the kind of arcs leading away
from A, before depositing the token in A? Or attach a "throughput
capacity" to each outbound arc?

Another one is a execution of same task by multiple resources. Say I
have a request that must be approved by a number of Approvers. I create
a request, and in the next step, assign Approvers. I am not limited on
the number of Approvers by business logic. I was thinking that if the
"Assign Approvers" transition immediately precedes the "Apprvers
Approve" transition, I could dinamically deposit N number of tokens in
the input place for "Approvers Approve", upon completion of "Assign
Approvers". However, what if the "Assign Approvers" is separated from
"Approvers Approve" by a few transition in the workflow?

Even if I figure out how to properly populate the input place for
"Approvers Approve", what if there is an AND split from the input place
for the transition? How does one implement the "Approvers Approve" in
such a way that even after all approvers perform the task, there are
still enough tokens in the input place for the rest of the AND-split
transitions to use.

One way I thought of was to not complete the "Approvers Approve"
transition until an external counter is equal to the assigned number of
approvers, and only then move the token. But that kind of takes each
individual approval task out of the system, despite the fact that it's a
  legitimate workflow task and we should be able to report on it and its
progress. Unless we are separating task from the token manipulation they
  result in, that is, I guess.

Another one is not to allow dinamic allocations of Approvers and insist
on a static number. Still, when do you decide on how many tokens to use
in the input place for such a transition: when you execute tasks that
would populate that place with tokens, or when you execute the task
itself and either not consume a token or add input tokens then if needed?

To me it sound like the Petri Nets doesn't really provide an answer to
this. While I've seen multiple references to AND splits and even some
references to multi-execution transitions, I haven't seen anything that
suggests someone has figured out how to implement that model yet.

But I've got to be missing something so any input on this, and possibly
references to relevant documents would be greatly appreciated. Thanks.

Max Pakhutkin

Collapse
2: Re: petri net question (response to 1)
Posted by Lars Pind on
Max,

I don't have time to go into details with your post right now, but one place with multiple output arcs is an "implicit OR"-split.

An AND-split is a transition with multiple output arcs, each of which point to its own place.

/Lars

Collapse
3: Re: petri net question (response to 2)
Posted by Max Pakhutkin on
Yes, sorry for confusion. I don't seem to have the terms right.
Collapse
4: Re: petri net question (response to 1)
Posted by Lars Pind on
I forgot to mention the new workflow package, which was just released.

While the new workflow package only supports Finite State Machines, it's designed with the ability to add new semantics, such as petri nets, or something else entirely.

What's your use case? The ability to require that some action be performed by a number of people, one after the other, before we can move on to a new state?

In that case, that might be something worth grafting on to workflow itself, regardless of whether it's FSM or Petri Nets.

In any case, acs-workflow is effectively a discontinued package, so I'd recommend that you look into 'workflow' instead.

/Lars

Collapse
5: Re: petri net question (response to 4)
Posted by Max Pakhutkin on
Thanks, I didn't know that. I'll check it out.

The use case is that I'm developing a system that could accomodate any workflow (based on Petri Nets) and some workflows may require that a number of users perform an action before the state changes (i.e. a request cannot be considered approved until all approvers sign off on it). The number of approves will be dynamic, which means I can't simply hardcode N transitions into the workflow where each of the N transitions is an approve transition assigned to just one user.