John,
It is an intersting exercise...
I am wondering if an automated code generator would not do something like
this:
class BookOrder < OpenWFE:ProcessDefinition
sequence do
customer activity=>'order'
bookstore activity=>'handle order'
bookstore activity=>'place book order'
publisher activity=>'handle order'
_if test => "${f:publisher_reply} == 'order confirmed'" do
branch_1
end
_if test => "${f:publisher_reply} == 'order rejected'" do
branch_2
end
subprocess name="branch_1"
sequence do
bookstore :activity => 'request shipment'
shipper :activity=> 'handle shipment request'
_if test => "${f:shipper_reply} == 'accept shipment'" do
branch_3
end
_if test => "${f:shipper_reply} == 'reject shipment'" do
branch_4
end
end
end
subprocess name="branch_2"
sequence do
bookstore activity=>"alternative publisher'
branch_1
end
end
subprocess name="branch_3"
sequence do
bookstore activity=>'inform publisher'
bookstore activity=>'send bill'
customer activity=>'pay bill'
bookstore activity=>'handle payment'
end
end
subprocess name="branch_4"
bookstore activity=>'alternative shipment'
branch_3
end
end
> From: John Mettraux <[EMAIL PROTECTED]>
> Reply-To: <[email protected]>
> Date: Thu, 26 Jul 2007 15:12:22 +0900
> To: <[email protected]>
> Subject: [openwferu-dev] Re: Converting BPMN graph to OpenWFERu
>
> 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&ati
> d=10195
> )
>
> Best regards,
>
> --
> John Mettraux -///- http://jmettraux.openwfe.org
>
> >
>
> 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
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---