Monday, January 22, 2007

Understanding ActiveBPEL Tutorial Test Client

Going through the BPEL construction process worked well but I also wanted to discover how the rest of the tutorial worked. So I dug in and hopefully this breakdown will help you. It helped me! :-)

The loan approval components A-F:

A. index.jsp:

Form with values such:
FirstName: John
LastName: Smith
Amount: 500
URL: http://localhost:8080/active-bpel/services/LoanService
Assessor Response: high,low,FAULT
Approver Response: yes,no, FAULT

Upon Submission:

- A form that submits to itself in which the jsp will make a call to the BPEL process

Step 1: update the values of "loan_approval_config.xml"
(~\Active Endpoints\ActiveBPEL Designer\Server\ActiveBPEL_Tomcat\temp\loan_approval_config.xml)
is updated with the values from the form via the class using xpath notation.

Step 2:
Get the BPEL result via the following call:

This call grabs the newly updated values form the above loan_approval_config.xml
and essentially makes a call to the web service via code like:

Service service = new Service();
Call call = (Call)service.createCall();
String urlString = rp.getAttr("/rundata/client", "url");
call.setOperationName(rp.getAttr("/rundata/client", "operation"));
call.addParameter("firstName", org.apache.axis.Constants.XSD_STRING,
call.addParameter("name", org.apache.axis.Constants.XSD_STRING,
call.addParameter("amount", org.apache.axis.Constants.XSD_INTEGER,

firstName = rp.getText("/rundata/client/firstName");
lastName = rp.getText("/rundata/client/name");
amount = new BigInteger(rp.getText("/rundata/client/amount"));
result = (String)call.invoke(new Object[] {firstName, lastName, amount});

Note however that the index.jsp updates the values for the Assessor and Approver web services in the loan_approval_config.xml.


Class designed to update the "loan_approval_config.xml" file.
It contains a org.w3c.dom.Document and a instance variable so that the xml document can be updated via xpath notation.


public interface Constants {
public static final String MAGIC_FAULT_STRING = "FAULT";
public static final String MAGIC_FAULT_ERROR_CODE_STRING = "42";
public static final String UNEXPECTED_ERROR_CODE_STRING = "9999";


Special extension of org.apache.axis.AxisFault which is thrown by the 2 Web Services and the

E. The Web Services

Looking at the 2 web services used in the BPEL:

Simply retrieve a value from the loan_approval_config.xml file
RuntimeParams rp = new RuntimeParams();
response = rp.getText("/rundata/approver/accept");

response = rp.getText("/rundata/assessor/risk-level");

So basics of this BPEL client is index.jsp which

1. updates a loan_approval_config.xml with form values
2. makes a call the to the BPEL by reading the values from loan_approval_config.xml
3. the two partnerLink webservices(Approver and Assessor) read their values from this xml file
4. the jsp is returned the results from the BPEL call


PeSi from Rostock said...

Thanks alot. I really pondered, what the webservice would be used for in this example. Now this lightens it up for me.

Anonymous said...

Casinos Online tyuueooru
Free Casinos
For this purpose, you may require checking out the lists of good gambling websites that are offered on various sites in the form of ratings, reviews, etc.
[url=]Download Online Casino[/url]
This is why online casino seems to be a common interest of many nowadays. - Casino Bonus
For this purpose, you may require checking out the lists of good gambling websites that are offered on various sites in the form of ratings, reviews, etc.

Anonymous said...

Good brief and this fill someone in on helped me alot in my college assignement. Say thank you you seeking your information.