Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Prasad Bhogle
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

BPEL Process Activities

Summary

In this article we will be discussing about various BPEL Process Activities and their usage. As the name suggests the process activities are nothing but the tasks to be performed at a specific stage. Considering a BPEL process as a workflow or a block diagram, process activities become the building blocks of BPEL Process.  
A BPEL process consists of steps. Each step is called an activity. BPEL supports primitive and structure activities. Primitive activities represent basic constructs and are used for common tasks, such as those listed below:

• Invoking other web services, using <invoke>
• Waiting for the client to invoke the business process through sending a message, using <receive> (receiving a request)
• Generating a response for synchronous operations, using <reply>
• Manipulating data variables, using <assign>
• Indicating faults and exceptions, using <throw>
• Waiting for some time, using <wait>
• Terminating the entire process, using <terminate>, etc.

We can then combine these and other primitive activities and define complex algorithms, which exactly specify the steps of business processes. To combine primitive activities BPEL supports several structured activities.
The most important are:
• Sequence ( <sequence>), which allows us to define a set of activities that will be invoked in an ordered sequence
• Flow ( <flow>) for defining a set of activities that will be invoked in parallel
• Case-switch construct ( <switch>) for implementing branches
• While ( <while>) for defining loops
• The ability to select one of a number of alternative paths, using <pick>
Each BPEL process will also declare variables, using <variable> , and define partner links, using <partnerLink>
  
The most commonly used activities are Receive, Assign, Invoke, Reply, Scope, Human task, Transform, Email, Switch, Receive, Flow etc.
Lets discuss few of them in this article. We will start with Receive Activity, obvious reason being generally a BPEL process is started with this activity when a given process receives an incoming XML message.

Receive

This activity receives input from external process/adapter/service. This activity waits for an asynchronous callback response message from a service and the received message information is stored in input variable. The operation depends on the type of partner link e.g. for file adapter the receive operation with be read. I haven't used other tabs except Sensors. Sensor's can be viewed similar to triggers which can be used for monitoring the BPEL Process activity at its sub-status. Sensors can be used for various other activities as well.
The input various store the received message in XML format.

Reply

This activity allows the process to send a message in reply to a message that was received through a receive activity. The combination of a receive activity and a reply activity forms a request-response operation on the WSDL port type for the process. This is generally used in Synchronous BPEL processes when client will be given immediate response based on its input (Receive).

Assign

As the name suggests the job of this activity is to assign values of one variable to another. The variables are generally XML messages which can be manipulated and massaged in this activity.
During Assign operation one can simply assign one variable to another or apply an XPATH function to one variable and assign it to another variable. Generally every activity in an BPEL Process has input variable and output variable. Assign activity does the job taking variable values from one stage to another.
Transform
This activity enables you to create a transformation that maps source elements to target elements. This activity allows you to create an XSL (XML Stylesheet) which transforms source data elements to target data element. You can say this is much advanced assign which uses power of XSL and very good things is its just drag and drop interface to create mapping between source and target variables
Following screen will be displayed after clicking second icon in-front of Mapper file.

Scope

 Scope activity can be treated as PLSQL Block or try/catch block with set of activities performed within itself. This Block has its own set of input and output variable. With-in one scope there can be multiple Process activities
Above scope icon can be expended to see set of activities inside
One can define variables applicable for given scope by clicking (X) icon at top left of scope box
Exception handling can be associated with a scope activity. One can create a Catch branch by clicking Catch icon on the left edge of scope block and perform exception handling activities.

 Switch

This is similar to case statement in any programming language. We can define various conditions based on which activities can be performed.This can have one or more conditional branches defined in a case branch, followed optionally by an otherwise branch.
Click on top portion to define the case expression
The case expressions can be defined using expression builder by clicking the Icon in-front of expression

Flow

Flow activity allows you to specify one or more activities/set of activities to be performed simultaneously. A flow activity completes when all activities in the flow have finished processing. Completion of a flow activity includes the possibility that it can be skipped if its enabling condition is false. In the diagram below Quotation is requested from two manufacturers simultaneously.
Invoke
This activity is used to call an external process using partner link/Adapter service.
The input variables are used to pass parameters/information to the called partner service and output variable is used to capture the result returned by the service.e.g. if you are calling a database procedure with input parameters and output parameters using database adapters then we can map these parameters with BPEL Invoke Activity input and output variables. Activity is intelligent enough to detect the operation in the called partner link service and enables input and output variable text boxes accordingly based in presence of request and response variables of the called partner service.

Human Task

Human tasks are used for monitoring or approval activities. These tasks are displayed in BPEL Worklist application. This is bit complicated activity and can need to separate article to address creation of human task and creation of JSP pages for performing some updates on incoming XML messages. Please note (FYI) that these JSP pages can be created automatically using JDeveloper but they don't get deployed successfully when you deploy the BPEL Process to SOA Suite/Application Server, this gives some error. Hence after creating BPEL Process and related JSP pages, JSP pages need to be deployed as separate Web Project.
When Human task is created it automatically creates two transform, one invoke and one receive activity which are visible after expanding OrderApproval_1 Human task
Following things are important while defining Human Task.
1.Outcome (e.g.APPROVE,REJECT)
2.Parameters - This will be displayed in Task List and we can build JSP pages to make changes in these input parameter values before assigning final outcome.
3.Assignment and Routing Policy - This is used for sending notifications to Approving authority Person or group.

Conclusion

Most of the BPEL processes use the activities which discussed above. As a suggestion, I would like to insist that the best way of understanding BPEL/ESB is developing SOA Order Booking Application end-to-end step by step as mentioned in SOA Suite Tutorial (B28937-01). This will guide you various aspects of BPEL and ESB projects and how both can be integrated with each other. One can take 2-3 days to complete this 370 page tutorial end-to-end, step-by-step just make sure you follow all steps as it is without even modifying variable names.

References

1.BPEL Process Manager Developers Guide (B28981-03)
2.SOA Suite Tutorial(B28937-01)

 

Prasad Bhogle

Comments   

0 #1 Appudappudu 2008-11-01 02:39
Thanks for the detailed explanation.
I have a question related to Tranform and assign ! I was doing a POC for a customer and there was a requirement where I had to use a transformation step followed by a assign step! Everything was fine, except that it was failing at the assign step(which is immediatly after the transform). I find no logical reason why I should fail as the values correctly coming out of transform!! Have your seen this behaviour before? I believe it's the same for asign followed by transform or transform followed by another transform step!!
Quote
0 #2 Eric Elzinga 2008-11-05 08:26
@Appudappudu

J ust a guess.
In your transformation you didnt 'map' all the fields in the target payload.
After this transformation is executed...you 'unmapped' fields arent there anymore in the payload.
So when you try to assgin..you will get some xpath query error because it can't find the field.
If so .....
Try to map all the fields in the xsl transformation. .and the fields you want to assign later..add a string('') for example
Quote
0 #3 Appudappudu 2008-11-06 14:13
Hi, Thanks for the reply, I don't see any problem as the assign statement that I am using is having a value coming out of transform step! Can you possibly test the scenario if you have some time? Just take any transform and have one value assigned to a different variable which has already mapped in transform!? I did saw the run time values having some values in BPEL console! I don't know if still something is missing!!!
Quote
0 #4 jennie 2008-11-26 05:29
hi,

its just ok. i think you must write in detail giving full explanation. your article is somewhat confusing. OK ?
Quote
0 #5 kishor nagbhire 2008-12-09 06:20
hi SHIVA
i'm a new user of ur site
can u help me on that topic
i want record in GL

'''''' undefined accounting periods in the current accounting calendar '''''''''''

help me
thanks
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  May 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
    1  2  3  4  5
  6  7  8  9101112
13141516171819
20212223242526
2728293031  

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner