Vous êtes sur la page 1sur 6

Oracle BPM 11g PS4-FP Workshop

Bundled Order Fulfillment

Table of Contents
3

Bundled Order Fulfillment ................................................................................. 1


3.1

Use Case Description .................................................................................. 1


3.1.1 Overview ............................................................................................. 1

3.2

Exercise Instructions.................................................................................... 2

3.3

Testing the application................................................................................. 2

3.4

Quick Build Instructions ............................................................................... 5

3.1 Use Case Description


Note: The solution for this exercise can be found in
c:\adf4bpm\Solutions\Solution_Lab01.zip

3.1.1 Overview
This is an extremely simplified case of distributed order fulfillment that
illustrates use of multi-instance processing and scoped conversations.
3.1.1.1 Background
The use case is for a telecommunications company that sells the
following products:

Telephone Service

Internet (various speed options, such as 1Mbps, 5Mbps, 15 Mbps etc)

Mobile phone (individual and family plans)

Cable Television

3.1.1.2 A Simple Bundled Order


The company also offers bundled packages which are combinations of
the above products. Each of the individual products in a bundle are
provisioned and fulfilled through separate back-end systems.

Page 1 of 6

Bundled Order Fulfillment 3.1


Oracle Confidential. For authorized use only. Do not distribute to third parties.

Oracle BPM 11g PS4-FP Workshop

3.2 Exercise Instructions


1.

You are to build a BPM application to process provisioning and


fulfillment of a bundled order.

2.

The process will be invoked as a web service with one input


parameter of type BundledOrder. This will contain an order header
and a list of order items one item for each product in the bundle.
You can find the types defined in
c:\bpm11gps4fp\Artifacts\bundledorder.xsd .

3.

Note that the structure of each type of order item is different. The
Order Items element is basically a collection of different types of
items.

4.

Services for processing provisioning requests for each item type


such as Internet, Mobile Phone etc are already deployed to your
hosted server instance as a single composite, with multiple service
end points, called BundledOrderProvisioningServices.

5.

You will call the appropriate service for provisioning each item in
the order.

6.

When the provisioning service returns the fulfillment date on


completion.

7.

In case of Mobile phone and Telephone, it also returns the


assigned phone number.

8.

Update the original order information with the fulfillment date and
phone number (where appropriate). Set the order status for each
item to COMPLETED

9.

Once all the items are processed, write the updated order
information to a file.

10.

At a high level your process would be a simple two-activity process


like this:

3.3 Testing the application


You will be testing the application in two phases. The first part will be
making sure that the process works as required. The second part will
be to test how the multi-instance sub-process behaves in case of an
exception

3.2 Bundled Order Fulfillment


Oracle Confidential. For authorized use only. Do not distribute to third parties.

Page 2 of 6

Oracle BPM 11g PS4-FP Workshop

3.3.1 Testing the happy-path


1.

You will need to use the web service testing page from the SOA
Infra (http://hostname:soaport/soa-infra) instead of the testing
page in EM. This is because the BundledOrder schema uses
polymorphic elements which the EM tester doesnt handle very
well.

2.

Use the test data available in c:\bpm11gps4fp\Data\bundledorder-test-data.xml

Page 3 of 6

3.

A successful test will result in file written to the output directory that
you configured in your File Adapter

4.

Audit trail of a completed composite looks like this:

5.

Audit trail of the completed BPM process looks like this:

Bundled Order Fulfillment 3.3


Oracle Confidential. For authorized use only. Do not distribute to third parties.

Oracle BPM 11g PS4-FP Workshop

3.3.2 Testing Exception Handling


3.3.2.1 Testing without any exception handling
1. Login in to EM, select BundledOrderProvisioningServices
component and shut it down.
2.

Use the same input as used in the first test

3.

Examine the audit trail. Did your process complete? Why?

4.

Restart the BundledOrderProvisioningServices comp

5.

Use the input from c:\bpm11gps4fp\Data\bundled-order-testdata-bad.xml

6.

This should result in a fault being thrown by the


PhoneProvisioningService.

3.3 Bundled Order Fulfillment


Oracle Confidential. For authorized use only. Do not distribute to third parties.

Page 4 of 6

Oracle BPM 11g PS4-FP Workshop

7.

Look at the audit trail for the process instance. What do you see?
Can you explain the behavior?

3.3.2.2 Testing with exception handling


1. Copy the following files from c:\bpm11gps4fp\Artifacts to your
BPM process project directory that contains composite.xml:
fault-policies.xml
fault-bindings.xml
2.

Re-deploy the process

3.

Use the same bad data used in the earlier test.

4.

The exception is caused by invalid area code in the payload.

5.

From the EM console, fix the data error and recover the fault

3.4 Quick Build Instructions

Page 5 of 6

1.

Create a new application workspace for BPM

2.

Create a new Asynchronous BPM process. Use the BundledOrder


element as input to the process

3.

Add a Sub Process activity and set multi-instance marker with


mode as parallel and creation type as Cardinality. Set the
cardinality using an expression (either simple of XPath) to the
number of items in the order. Refer to Section 17.2 - Introduction
to Loop and Multi-Instance Markers in Subprocesses in the
Modeling and Implementation Guide for Oracle Business
Process Management http://www.oracle.com/technetwork/middleware/soasuite/document
ation/oracle-bpm-modeling-guide-ps4fp-487996.pdf

4.

Add an exclusive gateway with conditional sequence flows for each


of the item types. The ItemType element under OrderItem
identifies the type. Possible values are INTERNET, PHONE,
MOBILE, CABLETV

5.

You can use either message throw/catch events or Send/Receive


activities to request the provisioning.

6.

You will need to define process variables of each individual item


type such as PhoneOrderItem, InternetOrderItem,
MobilePhoneOrderItem and CableTVOrderItem.

7.

Copy the individual item from the order to the above defined
variables to make it easy to pass required information to the
provisioning services

8.

To enable the callbacks to be delivered to the correct receiver,


PS4-FP introduces the concept of a conversation. You need to
Bundled Order Fulfillment 3.4
Oracle Confidential. For authorized use only. Do not distribute to third parties.

Oracle BPM 11g PS4-FP Workshop

ensure that the Receive task (or Catch Message Event) uses the
same conversation as the corresponding Send task (or Throw
Message event). Refer to 20.3.1 How to Invoke Asynchronous
Service Operation Using Message Events, in the modeling guide
mentioned above for details.
9.

Copy fulfillment date, phone number (where appropriate) and the


literal COMPLETED to the original order variable

10.

NOTE: This use case uses a complex schema which has


polymorphic elements. The BPM expression editor will only show
the base type, AbstractOrderItem, contained by OrderItem. You
will need to manually change the element name in the expression
to appropriate derived type. For e.g. to copy the details for the
Internet order item, you would use an expression similar to one
shown below. The modeler will also flag these expressions with
warnings about invalid assignment ignore them but make sure
you are using the correct path to the required element.

3.4 Bundled Order Fulfillment


Oracle Confidential. For authorized use only. Do not distribute to third parties.

Page 6 of 6

Vous aimerez peut-être aussi