On 10/31/07, John Mettraux <[EMAIL PROTECTED]> wrote:
> On 10/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Hi John,
> >
> > I tried to use a more complex dollar notation but I got an exception.
> > The program and the exception is below.
> > What is wrong ?
> > I apply your example to my scenario and I thought that it should work,
> > but it does'nt.
> >
> > Best regards,
> >
> > Andreas
> >
> >
> >
> > 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 :log do |workitem|
> >     #engine.ldebug "LOG #{workitem.params.msg}"
> >     puts workitem.lookup_attribute("params.msg")
> > end
> >
> >
> > class TenderProcessDefinition < OpenWFE::ProcessDefinition
> >
> >     sequence do
> >
> >         _if do
> >            equals :field_value => "${f:supplierList.
> > 1.DunsNr}", :other_value => "ZUTE8555"
> >             #then
> >             log :msg => "matched"
> >             #else
> >             log :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
>
> Hi Andreas,
>
> you've spotted two things.
>
> 1). the process fails silently, that's bad, you had to use trace_flow
> to detect the root error. I have to to fix that.

I was wrong, it did not fail silently, I could fetch the stack trace with

    puts engine.get_error_journal.get_error_log(fei)[0].stacktrace


> 2). the root issue, the array is set in the process definition, using
> Ruby, IIRC, the array is turned into a String, I have to check why
> it's like that for now. It guess it would follow the "principle of
> least surprise" if it simply worked the way you coded it.

That still holds, these complex lookups should never fail. If they
don't apply, a nil/blank value should be returned.

I fixed that at revision 1212, the tests are at
http://openwferu.rubyforge.org/svn/trunk/openwfe-ruby/test/lookup_att_test.rb

I'll work on this "Ruby array within the process definition" issue a bit later.


Danke sehr,

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