[OFBIZ][转] workflow1 |
Eva 发表于 2006/3/9 21:25:12 | ofbiz 中使用xpdl定义工作流,所以要看定义语言,另外,ofbiz中的order模块是通过工作流实现的,此流程,首先在网上下订单,然后内部进行处理。
order例子的运行过程processorder--]checkblacklist --]processpayment --]success --] clearchart --] initiateOrderWorkflow --]start the workflow
1.首先根据订单提交时的用processorder,根据ecommerce下的controller.xml发现[request-map uri="processorder"][security https="true"/][event type="java" path="org.ofbiz.commonapp.order.shoppingcart.CheckOutEvents" invoke="createOrder"/][response name="success" type="request" value="checkBlacklist"/][response name="error" type="view" value="checkout"/][/request-map]在调用createOrder成功后,根据success的条件,调用checkBlacklist,同样在根据ecommerce下的controller.xml发现
[request-map uri="checkBlacklist"][security direct-request="false"/][event type="java" path="org.ofbiz.commonapp.order.shoppingcart.CheckOutEvents" invoke="checkOrderBlacklist"/][response name="success" type="request" value="processpayment"/][response name="failed" type="request" value="failedBlacklist"/][response name="error" type="view" value="checkout"/][/request-map]
在checkOrderBlacklist成功后,根据success,转向processpayment[request-map uri="processpayment"][security https="true" direct-request="false"/][event type="java" path="org.ofbiz.commonapp.order.shoppingcart.CheckOutEvents" invoke="processPayment"/][response name="success" type="request" value="clearcartfororder"/][response name="fail" type="view" value="checkoutoptions"/][response name="error" type="view" value="checkout"/][/request-map]
processPayment成功后,转向clearcartfororder[request-map uri="clearcartfororder"][security direct-request="false"/][event type="java" path="org.ofbiz.commonapp.order.shoppingcart.ShoppingCartEvents" invoke="clearCart"/][response name="success" type="request" value="initiateOrderWorkflow"/][response name="error" type="view" value="checkout"/][/request-map]
成功后,调用initiateOrderWorkflow,[request-map uri="initiateOrderWorkflow"][security https="true" direct-request="false"/][event type="java" path="org.ofbiz.commonapp.order.shoppingcart.CheckOutEvents" invoke="initiateOrderWorkflow"/][response name="success" type="request" value="checkExternalPayment"/][response name="error" type="view" value="checkout"/][/request-map]
在initiateOrderWorkflow中, dispatcher.runAsync("processOrder", UtilMisc.toMap("orderId", orderId, "orderStatusId", orderHeader.getString("statusId")));启动工作流,对应services_order.xml中的[service name="processOrder" engine="workflow" location="org.ofbiz.commonapp.order.order" invoke="ProcessOrder"][description]Service for testing the workflow engine[/description][attribute name="orderId" type="String" mode="IN" optional="false"/] [attribute name="orderStatusId" type="String" mode="INOUT" optional="false"/][/service]此service的engine为workflow表示是一个工作流的服务,
service的定义ProcessOrder中的location表示xpdl定义中的package,[Package Id="org.ofbiz.commonapp.order.order"]invoke对应与在orderProcessXPDL.xml中,[WorkflowProcess Id="ProcessOrder" Name="Processes incoming orders"]
|
|
|
.: personal

Name:Eva
Position: ZJ.NingBo
|
|
.: Calendar
« | September 2023 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | |
|
.: My Subjects
|
.: NewBlogs
.: NewComment
|
.:New Info
blog名称:Eva's Blog 日志总数:11 评论数量:105 留言数量:-1 访问次数:259540 建立时间:2005年11月30日 |
|
.: My Links
|

|