On Wed, Oct 26, 2011 at 07:04:05PM -0700, catalina cordoba wrote:
>
> I just began to work with cursors, but I found a problem with the
> ubication of the cursors when I try to jump from a participant that is
> defined within a block of a Workflow Pattern to other block, and I
> also need to jump to a participant that is defined within the same
> block.
>
> I'll try to explain it better with the next example:
>
> I got something like:
>
> 1. pdef = Ruote.process_definition :name => 'test' do
> (...)

Hello,

you need to make your code tighter:

---8<---
pdef = Ruote.process_definition :name => 'test' do
  cursor do
    participant :ref => 'AAA'
    cursor :if => '${f:flag}' do
      participant :ref => 'BBB'
      participant :ref => 'CCC'
      jump :to => 'AAA'
      jump :to => 'BBB', :if => '${f:flag1}'
    end
  end
end
--->8---

It's easier to reason about it afterwards.

> As you can see at line 9, I'm trying to jump to participant 'AAA', but
> it doesn't work because of the cursor at line 6, but if I dont define
> that cursor (at line 6) in that block, then the jump to the
> participant 'BBB' (at line 12) doesn't work.
>
> So, I dont know how to manage the cursors within different blocks. Is
> it possible to use a global cursor or something like that for all the
> blocks within the process?

There is a section named "cursor command with :ref" in the cursor documentation:

  http://ruote.rubyforge.org/exp/cursor.html

You can do:

---8<---
pdef = Ruote.process_definition :name => 'test' do
  cursor :tag => 'main_cursor' do
    participant :ref => 'AAA'
    cursor :if => '${f:flag}' do
      participant :ref => 'BBB'
      participant :ref => 'CCC'
      jump :to => 'AAA', :ref => 'main_cursor'
      jump :to => 'BBB', :if => '${f:flag1}'
    end
  end
end
--->8---

Granted, it'd be easier if the jump would look automatically for AAA upstream. 
I'm making a note about that. Adding the :tag and the :ref isn't too cumbersome 
hopefully.


Best regards,

--
John Mettraux - http://lambda.io/processi

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