Usage of custom properties in BPEL:-
I would like to share useful scenario Which I done on custom properties in BPEL.
Custom properties can be specified for a business process
and all of its basic activities, as well as for inline human task activities, and Java
snippets. A custom property has a name and an optional (string) value. This
value can be specified during authoring time, and serve as the initial values
that can be changed in the runtime instances of the process.
Custom properties are different than query properties. Where
custom properties are configured for activities,
query properties are declared on variables and used to determine which parts of
a variable are accessible with the query() API function in the runtime
environment.
A custom property is a piece of meta data that you can
associate with an instance of task. A custom property consists of a name and
value pair. Both the names and values are simple character strings. You can set
or retrieve a custom property through the human task API when working with an
instance of a human task. You can use this data for a variety of purposes,
since it is not limited to any one usage pattern.
Scenario:-
I took simple scenario
inorder to demonstrate custom properties
usage. In this scenario customer details can be verified by verifier . So I used
Human task component(To-do task). For this scenario, the name of the custom
property is chosen to represent the fact that it is an
customerId(cno)
so the name customerId
for the name of the
property is appropriate. The value of the custom property is much more
interesting. Obviously a constant value does not make sense for our solution. I
want the value of the custom property to be the value of the customerId(cno)
field in the incoming data. The Human Task
Manager provides support for this through a technique called replacement
variables. Replacement variables allow us to supply a description of where the
data should be obtained that should be used for the value of the property. The
syntax of each of the allowable replacement variable encoding is described at
the below link
Follow below step inorder to complete scenario:-
Step 1: created Customer business object and Interface. As shown in below figures.
Fig1:
Fig2:
Step2: -I
took human task component (To-do task) added created
interface and created custom properties with name CustomeId . In Environment tab
available in properties.
Name:-customerId
Value :-
%htm:input.\customerInfo/cno%
This
should be interpreted as taking the field called cno
from the
customerInfo
operation
specified by the input variable. The complete Custom Property definition in the
Human Task Editor Environment panel looks as shown.
Step3:-
Now open business process
choreographer .Here I want to create own View(CustomerList) which displays customers.While
displaying instances I want customize view here I am adding one more column
CustomerId and using custom properties as value for that column as shown below.
I hope you understood concept .
No comments:
Post a Comment