![]() |
![]() |
|
|
Example of Starting a Workflow Using an Event
This section presents an example that shows you how to define a Start node that starts a workflow when an event is triggered. The event that starts the workflow is the receipt of an XML document that contains the root element order, and a workflowstatus element with a value of new.
To define the Start node, the entries in the Start Properties dialog box should look like those shown in the following figure.
Figure B-1 Start Properties Dialog Box
In the Start Properties dialog box, specify the following:
XPath("/order/workflowstatus/test()-'new")
If the condition evaluates to true, the workflow starts.
To specify the variables, click Add to open the Workflow Variable Assignment dialog box.
Figure B-2 Workflow Variable Assignment Dialog Box
The XML document that triggers the event-type start is shown in the following listing. Listing B-1 XML Document That Triggers the Event-Type Start
<Order>
<OrderId>1</OrderId>
<OrderType>New</OrderType>
<WorkflowStatus>New</WorkflowStatus>
<Status />
<LEC>
<VendorId>ABC</VendorId>
</LEC>
<SalesPerson>
<UserId>Mark</UserId>
<Email>Mark@ABC</Email>
</SalesPerson>
<Quote>
<Id>1</Id>
</Quote>
<Customer>
<FirstName>Joe</FirstName>
<LastName>Customer</LastName>
<Address>
<Street>123 Main Street</Street>
<City>Boston</City>
<State>MA</State>
</Address>
</Customer>
</Order>
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|