Hi Liwen,

On 7/24/07, Liwen <[EMAIL PROTECTED]> wrote:
>
> When I ran the following code, it  printed out only '8 true' ,
> '9 !!!!!' not printed and participants WPS and SOS are not called.
>
> If I remove '_if :test => "${f:status} == true"  do' and 'end' lines.
> Those two participants
> are getting called.
>
>         _if :test => "${f:status} == true"  do
>            _print "8 ${f:status}"
>
>            set :field => 'task', :value => "WPS-task"
>            _print "9 !!!!! "
>            set :field => "p1", :value => "p1 param"
>            set :field => "wps_f1", :value=>'wps_f1_value'
>            participant :WPS
>            SOS :activity =>'ZZZZZZZZZZZZ', :status =>'DONE'
>         end

I understand, you've been mislead by the Ruby-like appearance of the
process definition. It should be written like :


---8<---
_if :test => "${f:status}"  do
    sequence do
        _print "8 ${f:status}"

        set :field => 'task', :value => "WPS-task"
        _print "9 !!!!! "
        set :field => "p1", :value => "p1 param"
        set :field => "wps_f1", :value=>'wps_f1_value'
        participant :WPS
        SOS :activity =>'ZZZZZZZZZZZZ', :status =>'DONE'
    end
end
--->8---

The 'sequence' was missing from your initial implementation, you
really have to tell the engine how to structure activities, there is
no implicit sequence like in regular programming languages.

The general syntax for an if is :

<if>
    <condition/>
    <then/>
    <else/>
</if>

As you wrote it, the <then/> was mapped to the "print 8" and the
<else/> to the 'set' that immediately followed it.

The <condition/> may be integrated within the <if/> via the 'test'
attribute as you did it. The OpenWFE process definition language is
closer to Lisp than to C (for example).


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