|
Problem(Abstract) |
This Technote helps you to implement Java Transition
Conditions inside business processes. |
|
|
|
Resolving the
problem |
You can associate transition conditions with control links
inside your business process. Those conditions are evaluated at runtime
and their result determines the control flow of your concrete business
process instance.
If the transition condition of a control link evaluates to true at
runtime, the target activity of the link is activated. Otherwise, the
target activity is skipped and dead-path elimination starts.
If you choose to use built-in values for you transition condition, you can
choose from the following three values:
If you need more flexibility, you can choose to implement your transition
condition with Java code. To do that, open the properties box of the link
for which you want to define a transition condition and go to the
Condition page. As shown in the image below, choose Java.
Typically, you would perform one or more of the following actions inside a
transition condition:
- test data from process variables
- test properties of the link's source activity
- test process properties
Of course, just as in Java Snippets, you can execute arbitrary Java code.
For example, you could use methods specified in the Public
API of WebSphere Process Choreographer.
Testing process data
You can use the following methods inside transition conditions to work
with the data belonging to a business process:
- get<Variable Name>()
- set<Variable Name>()
... where <Variable Name> is the name of the process variable
you want to access. For each variable, get() and set() methods are created
as well as classes that contain get() and set() methods for each part of a
variable.
The following code snippet shows how the value of a variable can be
tested:
The target activity of this link would only be navigated if the number of
order items is larger than 25.
Testing source activity properties
The following code snippet shows how the execution state of the link's
source activity can be used:
The target activity of this link would only be navigated if the state of
the link's source activity is EXPIRED.
Please see the public API of WebSphere Process Choreographer to learn
about the available activity properties.
Testing process properties
You can also test different process properties. The following code snippet
shows how the custom properties of a business process can be used in
transition conditions:
The target activity of this link would only be navigated if the customer
that this process deals with is a gold customer.
Please see the public API of WebSphere Process Choreographer to learn
about the available process properties. |
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Business Integration |
WebSphere Business Integration Server Foundation |
BPEL |
AIX, HP-UX, Linux, Linux Red Hat - pSeries, Linux zSeries, OS/400,
Solaris, Windows, z/OS |
5.1 |
Edition Independent |
|
|
|