Workflow of the order and ecommerce workflow examples in OFBiz

Source: Internet
Author: User

Processorder --> checkblacklist --> processpayment --> success --> clearchart --> initiateorderworkflow --> Start the Workflow

1. Use processorder when submitting an order. It is found according to controller. xml under ecommerce.
<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>
After createorder is successfully called, checkblacklist is called Based on success conditions. It is also found according to controller. xml under ecommerce.

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

After the checkorderblacklist is successful, switch to processpayment Based on success
<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>

After processpayment is successful, switch to 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>

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

In initiateorderworkflow,
Dispatcher. runasync ("processorder", utilmisc. tomap ("orderid", orderid, "orderstatusid", orderheader. getstring ("statusid "{
Window. Open ('/images/wink.gif', '_ blank ');
} "Alt =" "hspace =" 2 "src =" http://www.blogcn.com/images/wink.gif "onLoad =" function anonymous ()
{
} "> Screen. width/2) This. width = screen. width/2" vspace = 2 border = 0>); start the workflow, corresponding to
<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>
The engine of this service is workflow, which indicates a workflow service,

Service Definition location in processorder indicates the package in xpdl definition,
<Package ID = "org. OFBiz. commonapp. Order. Order">
Invoke corresponds to in orderprocessxpdl. XML,
<Workflowprocess id = "processorder" name = "processes incoming orders">

==============================================

After placing an order in ecommerce,
In ordermgr
My status of this order is hold
In workeffort
Activity Status is suincluded, my status is accepted, and activity name is order not ready
Prepare to collect the money and click [receive payment]
Aciton = ttp: // localhost: 8080/ordermgr/control/receivepayment? Order_id = 10000 & workeffortid = 10002 & partyid = Admin & roletypeid = _ Na _ & fromdate = 10:43:03. 0

After receiving the money, click [Save]
Action =/ordermgr/control/receiveofflinepayments/orderview? Order_id = 10000 & workeffortid = 10002 & partyid = Admin & roletypeid = _ Na _ & fromdate = 10:43:03. 0

In this case
In ordermgr
My status of this order is waiting
In workeffort
Activity status is not started, my status is sent, activity name is complete order

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.