set expression

7 views
Skip to first unread message

rebo

unread,
Jan 6, 2011, 11:18:13 AM1/6/11
to ruote
I'm a bit confused about the set expression, I am trying to set a
workitem field so a latter participant can access it.

For instance, from the documentation:

sequence do
set :field => 'subject', :value => 'food and beverage'
set :field => 'date', :val => 'tomorrow'
participant :ref => 'attendees'
end

However putting the above in ruote-kit and launching the process does
not seem to affect the subsequent workitem's fields for attendess.

I get the same issue with the set expression within my own process
definitions.

Torsten Schönebaum

unread,
Jan 6, 2011, 11:31:06 AM1/6/11
to openwfe...@googlegroups.com
Am Donnerstag, den 06.01.2011, 08:18 -0800 schrieb rebo:
> I'm a bit confused about the set expression, I am trying to set a
> workitem field so a latter participant can access it.
>
> For instance, from the documentation:
>
> sequence do
> set :field => 'subject', :value => 'food and beverage'
> set :field => 'date', :val => 'tomorrow'
> participant :ref => 'attendees'
> end
>
> However putting the above in ruote-kit and launching the process does
> not seem to affect the subsequent workitem's fields for attendess.

I can't reproduce this problem here[1]. Which versions of ruote,
ruote-kit and Ruby do you use? Mine are:
ruote: 2.1.11
ruote-kit: current HEAD
Ruby: ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770,
Ruby Enterprise Edition 2010.02

Cheers,
Torsten

[1] That means, the workitem fields appear in
http://localhost:9292/_ruote/workitems/0_0_2!!20110106-bejoyarani
(example url) as expected.

rebo

unread,
Jan 7, 2011, 6:14:58 AM1/7/11
to ruote
Hmm something strange is going on, when I run ruote-kit independently
via rackup, it works fine. But when running as a gem running from my
rails app it doesn't work. Will investigate further.

On Jan 6, 4:31 pm, Torsten Schönebaum <torsten.schoeneb...@web.de>
wrote:

Torsten Schönebaum

unread,
Jan 7, 2011, 6:39:10 AM1/7/11
to openwfe...@googlegroups.com
rebo wrote:
> Hmm something strange is going on, when I run ruote-kit independently
> via rackup, it works fine. But when running as a gem running from my
> rails app it doesn't work. Will investigate further.

Is there a workitem for attendees? If not, it's likely that you're not
running a ruote worker in your rails app.

HTH,
Torsten

rebo

unread,
Jan 7, 2011, 7:25:25 AM1/7/11
to ruote
Hi thanks for the advice Torsten but i think i've found the cause ( or
at least a trigger) of the problem.

The route setup was fine, ruote worker running in seperate process no
problem.

What seems to cause the issue is when I have

gem 'sinatra', '1.0'

within my gemfile, commenting out that line everything runs fine. Put
it back in and set expressions do not work. Its really strange as
within Ruote-kit itself that sinatra version is specified.

Very odd!

On Jan 7, 11:39 am, Torsten Schönebaum <torsten.schoeneb...@web.de>
wrote:

John Mettraux

unread,
Jan 7, 2011, 7:30:46 AM1/7/11
to openwfe...@googlegroups.com

On Fri, Jan 07, 2011 at 04:25:25AM -0800, rebo wrote:
>
> Hi thanks for the advice Torsten but i think i've found the cause ( or
> at least a trigger) of the problem.
>
> The route setup was fine, ruote worker running in seperate process no
> problem.
>
> What seems to cause the issue is when I have
>
> gem 'sinatra', '1.0'
>
> within my gemfile, commenting out that line everything runs fine. Put
> it back in and set expressions do not work. Its really strange as
> within Ruote-kit itself that sinatra version is specified.
>
> Very odd!

Hello Rebo,

maybe Sinatra's set is shadowing ruote's set, since you can do

---8<---
require 'sinatra'

set :port, 3333

get '/' do
"nada"
end
--->8---


Best regards,

--
John Mettraux - http://jmettraux.wordpress.com

rebo

unread,
Jan 7, 2011, 7:50:07 AM1/7/11
to ruote
Must be something to do with that, as changing

class SetExpression < FlowExpression
names :set, :unset

to

class SetExpression < FlowExpression
names :setf, :unset

within fe_set.rb works with or without the sinatra gem in the
gemfile. (obviously using setf instead of set.) So some kind of
conflict on the set method....

John Mettraux

unread,
Jan 8, 2011, 5:48:56 AM1/8/11
to openwfe...@googlegroups.com

On Fri, Jan 07, 2011 at 04:50:07AM -0800, rebo wrote:
>
> Must be something to do with that, as changing
>
> class SetExpression < FlowExpression
> names :set, :unset
>
> to
>
> class SetExpression < FlowExpression
> names :setf, :unset
>
> within fe_set.rb works with or without the sinatra gem in the
> gemfile. (obviously using setf instead of set.) So some kind of
> conflict on the set method....

Hello,

I went on an added an 'rset' alias for the set expression :

https://github.com/jmettraux/ruote/commit/801afe5c932c7b1e176f9e2a62d0546c79e09d14

Went for 'r[uote]set' and not 'setf' since set can set variables and fields.


Many thanks !

Torsten Schönebaum

unread,
Jan 10, 2011, 11:18:22 AM1/10/11
to openwfe...@googlegroups.com

Nonetheless, sinatra's set shouldn't pollute the global namespace in
ruote-kit. I'll investigate that as soon as I've time for that.

Thanks for the report, rebo, and thanks for the workaround, John!

Cheers,
Torsten

Torsten Schönebaum

unread,
Jan 11, 2011, 5:30:07 AM1/11/11
to openwfe...@googlegroups.com

There's a fix in
https://github.com/tosch/ruote-kit/commit/00381b3ebe774fc37af0eae99bc6f149e1d51618

@rebo: Could you test if you may use 'set' in process definitions with
that fix?

Thanks again for the report,
Torsten

Reply all
Reply to author
Forward
0 new messages