Hi John,

I'm working with revision 1214.
Your fix works but a got another supprising result.

The line:
participant :ref => "logger", :msg =>"${f:supplierList.1.DunsNr}"

write to the output: ZUTE8555

because of this I would expect that the "then" part of the "_if"
statement should be executed but this is not the case.

What is wrong here ?

      _if do
           equals :field_value => "${f:supplierList.
1.DunsNr}", :other_value => "ZUTE8555"
            #then
            participant :ref => "logger",  :msg => "matched"
            #else
            participant :ref => "logger", :msg => "not matched"
        end




My small example test program :


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'

engine = OpenWFE::Engine.new


engine.register_participant :logger do |workitem|
    #engine.ldebug "LOG #{workitem.params.msg}"
    puts workitem.lookup_attribute("params.msg")
end


class TenderProcessDefinition < OpenWFE::ProcessDefinition

    sequence do

       participant :ref => "logger", :msg =>"This is a test"
       participant :ref => "logger", :msg =>"${f:supplierList.
1.DunsNr}"
        _if do
           equals :field_value => "${f:supplierList.
1.DunsNr}", :other_value => "ZUTE8555"
            #then
            participant :ref => "logger",  :msg => "matched"
            #else
            participant :ref => "logger", :msg => "not matched"
        end
    end

    set :field => "supplierList", :value =>
[{"name"=>"companyA","DunsNr" => "JGE4753"},
{"name"=>"companyB","DunsNr" => "ZUTE8555"},
{"name"=>"companyC","DunsNr" => "GTI6775"},
{"name"=>"companyD","DunsNr" => "XUE6755"}]
end

li = OpenWFE::LaunchItem.new(TenderProcessDefinition)

#OpenWFE::trace_flow(TenderProcessDefinition)

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

fei = engine.launch(li)

engine.wait_for fei




Best regards


Andreas



On 1 Nov., 13:11, "John Mettraux" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 10/31/07, John Mettraux <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'll work on this "Ruby array within the process definition" issue a bit 
> > later.
>
> It's in, at revision 1214.
>
> This is now possible :
>
> ---8<---
> process_definition :name => "test", :revision => "0.1" do
>     sequence do
>         set :field => "f0", :value => [ "this", "is", "my", :ruby,
> "array" ]    # <======= here
>         participant "Toto"
>     end
> end
> --->8---
>
> Before revision 1214, the array was turned into a String.
>
> Best regards,
>
> --
> John Mettraux   -///-  http://jmettraux.openwfe.org


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