On 7/26/07, Pat Cappelaere <[EMAIL PROTECTED]> wrote:
>
> Here is the file.

Hi Pat,

as it's always an interesting exercise, I translated the BPMN to the
attached OpenWFEru process definition.

(
Note to self : implement break and other cursor niceties for the
iterator expression
http://rubyforge.org/tracker/index.php?func=detail&aid=12588&group_id=2609&atid=10195
)

Best regards,

-- 
John Mettraux   -///-   http://jmettraux.openwfe.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

class BookStoreDefinition < OpenWFE::ProcessDefinition

    #
    # The body of the process
    #
    sequence do

        # process launched upon customer's request

        bookstore :activity => "handle customer order"

        find_publisher
        find_shipper

        publisher :activity => "notify of shipment"
        customer :activity => "bill"

        # handle payment might be implicit to the 'bill' activity
    end

    subprocess :name => "find_publisher" do
        sequence do

            iterator :on => "${ruby:publisher_list_to_s}", :to_field => "publisher" do

                publisher :activity => "placing order"

                _break :if => "${f:publisher_reply} == 'Order confirmed'"

                _unset :field => "publisher"
            end

            _if test => "${f:publisher} == ''" do
                sequence do
                    customer :activity => "order got rejected"
                    cancel_process
                end
            end

            # else field 'publisher' is set
        end
    end

    subprocess :name => "find_shipper" do

        iterator :on => "${ruby:shipper_list_to_s}", :to_field => "shipper" do

            shipper :activity => "shipment request"

            _break :if => "${f:shipper_reply} == 'Shipment accepted'"
        end

        # the field 'shipper' holds the name of the shipper
        # the 'no shipper found' case is not modelled, so it's not
        # implemented here
    end

    #
    # small subprocesses (shortcuts)

    subprocess :name => "customer" do
        participant :ref => "${f:customer}" :activity => "${activity}"
    end
    subprocess :name => "publisher" do
        participant :ref => "${f:publisher}" :activity => "${activity}"
    end
    subprocess :name => "shipper" do
        participant :ref => "${f:shipper}" :activity => "${activity}"
    end

end

Reply via email to