:override => false not working

4 views
Skip to first unread message

Rashi Gupta

unread,
Jan 10, 2012, 11:54:47 PM1/10/12
to ruote
I have my ruote workflow defined in following way

....
prsdef = Ruote.process_definition :name => 'Workflow11116' do
sequence do
participant :Test
participant :Test
end
end

engine =
Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new))
source = "TestParticipant"
engine.register_participant :Test, ParticipantTest, 'source' =>
source

source = "TestParticipant2"
engine.register_participant :Test, ParticipantTest, 'source' =>
source, :override => false

....

class ParticipantTest
include Ruote::LocalParticipant

def initialize (options)
@options = options
end

def consume (workitem)
puts "========================================================"
puts "In Participant Test"
puts @options['source']
puts "========================================================"

reply_to_engine(workitem)
end
end

when the workflow is executed, then output is

puts "========================================================"
puts "In Participant Test"
puts TestParticipant2
puts "========================================================"
puts "========================================================"
puts "In Participant Test"
puts TestParticipant2
puts "========================================================"


How can i define the workflow with two participants with same name and
not overriding the first participant?

Any help is appreciated.

Thanks
Rashi

John Mettraux

unread,
Jan 11, 2012, 7:21:03 AM1/11/12
to openwfe...@googlegroups.com

On Tue, Jan 10, 2012 at 08:54:47PM -0800, Rashi Gupta wrote:
>
> How can i define the workflow with two participants with same name and
> not overriding the first participant?

Hello Rashi,

welcome to the ruote mailing list.

Sorry for the confusion, this :override => false is available on the "master"
branch of ruote, not in the gem at version 2.2.0.

If I run this (https://gist.github.com/1594410) with the "master" branch:

---8<---
require 'rubygems'
require 'pp'
require 'ruote'

class ParticipantTest
include Ruote::LocalParticipant

def initialize(options)
@options = options
end

def on_workitem
p @options
reply
end
end

engine = Ruote::Engine.new(Ruote::Worker.new(Ruote::HashStorage.new))

engine.register_participant(
:Test, ParticipantTest, 'source' => 'TestParticipant')
engine.register_participant(
:Test, ParticipantTest, 'source' => 'TestParticipant2', :override => false)

puts

pp engine.participant_list

puts

#engine.noisy = true

pdef = Ruote.define do
participant :Test
end

wfid = engine.launch(pdef)
engine.wait_for(wfid)

puts
--->8---

I get:

---8<---
[/^Test$/ ==> ParticipantTest {"source"=>"TestParticipant"},
/^Test$/ ==> ParticipantTest {"source"=>"TestParticipant2"}]

{"source"=>"TestParticipant"}
--->8---

(with 2.2.0 it outputs

---8<---
[/^Test$/ ==> ParticipantTest {"source"=>"TestParticipant2", "override"=>false}]
--->8---

and then complains because "on_workitem" is 2.3.0 and not 2.2.0, but the
point is that override is not known to 2.2.0 as the output tells.


Sorry again for the confusion, best regards,

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

Rashi Gupta

unread,
Jan 12, 2012, 5:43:23 AM1/12/12
to ruote
Is there any way in ruote 2.2.0 version, to define the workflow with
two participants with same name and
not overriding the first participant

Thanks,
Rashi

John Mettraux

unread,
Jan 12, 2012, 7:22:14 AM1/12/12
to openwfe...@googlegroups.com

On Thu, Jan 12, 2012 at 02:43:23AM -0800, Rashi Gupta wrote:
>
> Is there any way in ruote 2.2.0 version, to define the workflow with
> two participants with same name and
> not overriding the first participant

Hello Rashi,

I'm sorry, there is no easy/straightforward way to do that with ruote 2.2.0.

Please note that with Bundler it's easy to use the latest version of ruote
(or any commit/tag).

I'm supposed to release 2.3.0 soon, but I'm struggling to find free time to
do it.

Do you really need to have the same name for the two different participants ?
It's a rather infrequent use case.


Best regards,

Reply all
Reply to author
Forward
0 new messages