Академический Документы
Профессиональный Документы
Культура Документы
Contents
Oracle BPM Suite 11g Multi-Instance Subprocess Scoped Conversations ................. 1
0
Concepts ............................................................................................................................... 1
0.1.1
0.2
0.3
Scope ............................................................................................................................... 3
0.2.2
Context ........................................................................................................................... 3
1.1.2
Overview ........................................................................................................................ 3
0.3.1
0.3.2
1.1.3
0.1
Mode - This determines whether you want the subprocess instances to be executed in Serial or Parallel
fashion.
Creation Type This indicates whether you are iterating through an Array or not.
Collection - This indicates that you wish to iterate through the elements of an Array and the number of
iterations depends on the Array size. The Multi-instance in this case is used to create for-each loop. Selecting
this option shows Loop Data Input and Loop Data Output. The former stands for the Array data type that
is passed as input to the subprocess and the latter the Array data type that is produced as a result of execution
of this subprocess. You can use XPATH Expressions to assign the values for these Arrays. The number of
times the subprocess is executed is determined by the size of the Array.
Cardinality - If the input is not an Array, you will have to select Cardinality and specify the number of times
that you wish to execute this subprocess in the Loop Cardinality section. This creates a for-loop. In the
screen shot below, the Loop Cardinality is determined by an integer Process Data Object.
Completion Condition - You can specify a condition to terminate the subprocess instances
abruptly and come out of the subprocess scope. The BPM Service Engine computes this condition
every time a token completes the subprocess.
You can use these in the XPATH expression to specify Loop Cardinality and Completion Conditions.
0.2
Sample Overview
0.2.1 Scope
This sample shows creation of Scoped Conversations for correlating multiple asynchronous conversations
happening inside a multi-instance embedded subprocess.
Note: This sample will work with Oracle BPM 11 g R1 PS4 FP release and above.
0.3
1.1.1 Context
Scoped Conversations are used when there are multiple asynchronous conversations happening
within the multi-instance subprocess scope.
1.1.2 Overview
This is a very simple example where a list of Order Items are fulfilled such as in the previous case
but instead of using a User Task to fulfill the Order Items, we do an asynchronous invocation to
another BPMN process. The ScopedConversation is the main process and it invokes another
asynchronous BPMN process FulfillOrderItem from inside a multi-instance subprocess for
fulfilling Order Items.
The configuration of the request-Message Start Event and the return Message End Event is
captured in the screen shots below. The configuration of the Message Start Event is the same
irrespective of whether the response returned in synchronous or asynchronous. You can define a
new interface operation and arguments or you can use an existing interface. An existing interface is
usually used when you have an inbound Adapter Service sending a message that in turn creates a
new process instance. In this case, we define a new interface. You can use the default conversation
in this case. The request argument is of type OrderItem.
The configuration of the return - Message End Event is shown in the picture below. The
Asynchronous option is chosen. The argument is of type OrderItem and the callback Operation
name is return.
0.3.2.2
Process Order
The Process Order is a parallel multi-instance embedded subprocess that iterates through the list of
Order Items and the Clerk role fulfills it through the FulfillOrderItem User Task. The
subprocess is aborted if the Clerk is not able to fulfill an Order Item. The Process Order multiinstance subprocess is configured very similar to the Process Order step (1.4.4) in the previous
sample. The Mode is set to Parallel, the Creation Type to Collection. The Loop Data Input is
set to the Order Item array element of the order Process Data object using the XPATH
Expression before the multi-instance subprocess execution starts. The Loop Data Output is copied
back to the order Process Data object after the multi-instance subprocess ends.
The order item fulfill request Send Task invokes the FulfillOrderItem - async BPMN
process and the order item fulfill response Receive Task receives the asynchronous response.
Since the pair of Send Task and Receive Task can be executed multiple times and there can be
multiple asynchronous conversations, a scoped conversation local to the embedded subprocess is
required. Further since the Send Task initiates the FulfillOrderItem - async BPMN process the
run-time engine can use the WS-Addressing based correlation and does not require Message-based
correlation sets.
0.3.2.3
1.
2.
0.3.2.4
The order item fulfill request Send Task invokes the FulfillOrderItem BPMN Process. It
creates a new instance of the FulfillOrderItem BPMN process. The configuration of this Send
Task is shown in the screen shot below. Note that the conversation is set to the Scoped
Conversation we created in the previous section. The target node that receives this message is the
request-Message Start Event of the FulfillOrderItem BPMN Process.
The InputDataItem handle to the element of the LoopDataInput Array passed as input to the
multi-instance subprocess is mapped to the input argument for the Send Task as shown in the figure
below:
The order item fulfill response Receive Task waits for the response from the
FulfillOrderItem BPMN Process. The target node that sends this message is the return-Message
End Event of the FulfillOrderItem BPMN Process. The configuration of this Receive Task is
shown in the screen shot below. Note that the conversation is set to the Scoped Conversation we
created in the previous section.
The output argument of the order item fulfill response - Receive Task is mapped back to
OutputDataItem. The OutputDataItem in turn is added to LoopDataOutput Array, the output
of the multi-instance subprocess.
Go to Oracle Enterprise Manager (Oracle EM) and use the Test option to supply input values for
triggering the process instance. Type in values for the Order and Order Items.
2.
Then log in as Clerk role (jcooper/welcome1) in to Oracle BPM Workspace. Execute the Fulfill
Order Item tasks. The Clerk role is mapped to the Loan Agent LDAP group.
10