Hi,

I was testing some expressions and found some problems.
Below in the example is a concurrent-iterator expression.

I get the following errors:


ruby SubProcessTest.rb SubProcessTest.rb:58: syntax error, unexpected
tSYMBEG, expecting kDO or '{' or '('
        concurrent-iterator :on_value =>"companyA, companyB,
companyC" ,:to_field =>"company" do
                             ^
SubProcessTest.rb:58: syntax error, unexpected ',', expecting kEND
        concurrent-iterator :on_value =>"companyA, companyB,
companyC" ,:to_field =>"company" do
 
^
SubProcessTest.rb:58: syntax error, unexpected kDO, expecting kEND
SubProcessTest.rb:73: syntax error, unexpected kEND, expecting $end


What is wrong ? In the documentation the concurrent-iterator
expression is used in the same way  (http://openwferu.rubyforge.org/
patterns.html#pat_13_multiple_instances_with_a_priori_design_time_knowledge ).

I have also some other problems with the iterator expression.
The version which is used in the example is OK, it works as expected.
But if i use a more dynamic version which is discussed in the
documentation

iterator :on_value => "${f:participant_list}", :to_variable => "p" do
        participant "${p}"
end

nothing will happend (no iteration will take place)  --> I think
somethink is wrong with the
:on_value => "${f:participant_list}" construct.


In my example if I use the dynamic dollor construct  "${f:comp}" it
should work:

iterator :on_value => "${f:comp}", :to_variable =>"next_participant"
do

            _if  do
                equals :field_value => "$
{next_participant}", :other_value => "bob"
                # then
               companyDefiner
                # else
               supplier :supplierName => "${next_participant}"
            end
        end


But no iteration will take place. What is wrong with that ?

Are  somewhere some examples using complex dollor notations to access
a value in a complex workitem attribute ( a array of hash maps )
within the process definition ( usefull in "if", "case", ...
expressions ) ?


Best regards

Andreas


example:
--------------------------------------------

#!/usr/bin/env ruby
require 'rubygems'
require 'openwfe/def'
require 'openwfe/workitem'
require 'openwfe/engine/engine'
require 'openwfe/extras/participants/sqsparticipants'
require 'openwfe/extras/listeners/sqslisteners'
require 'openwfe/expressions/raw_prog'
require 'openwfe/tools/flowtracer'

#
# instantiating an engine

engine = OpenWFE::Engine.new



#
# adding some participants

engine.register_participant :companyDefiner do |workitem|
    puts "put some companies to workitem..."
    workitem.companyDefiner_companies =
"companyA,companyB,companyC,companyD, companyE"
    workitem.companyDefiner_processInfos = [{"a"=>"1", "b"=>"2"},
{"a"=>"4", "b"=>"8"}, {"a"=>"3", "b"=>"9"},{"a"=>"9", "b"=>"15"},
{"a"=>"23", "b"=>"34"}]
    workitem.attributes = {"field1" => ['4','3','5','9']}
end



engine.register_participant :supplier do |workitem|
    puts "supplier got a workitem..."
    puts workitem.lookup_attribute("params.supplierName")
    puts workitem.lookup_attribute("field1.1")
end




class MainProcessDefinition0 < OpenWFE::ProcessDefinition

    sequence do

        companyDefiner

        iterator :on_value => "x , y, z", :to_variable
=>"next_participant" do

            _if  do
                equals :field_value => "$
{next_participant}", :other_value => "bob"
                # then
               companyDefiner
                # else
               supplier :supplierName => "${next_participant}"
            end
        end



        concurrent-iterator :on_value =>"companyA, companyB,
companyC" ,:to_field =>"company" do
           subprocess :ref => "supplierCommunication", :company => "$
{company}"
        end


    end

    process_definition :name => "supplierCommunication" do
        sequence do
          supplier
        end
    end

    set :field =>"comp", :value => "alice, bob, charly"
    set :field =>"testfield", :value =>"testvalue"
end

li = OpenWFE::LaunchItem.new(MainProcessDefinition0)
#OpenWFE::trace_flow(MainProcessDefinition0)

li.initial_comment = "please give your impressions about http://ruby-lang.org";

fei = engine.launch(li)

engine.wait_for fei


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to