Monday 17 October 2011

Flow Activity Concept in BPEL process

Flow Activity is only useful in case of Asynchronous call.
A BPEL process service component must sometimes gather information from multiple asynchronous sources. Because each callback can take an undefined amount of time (hours or days), it may take too long to call each service one at a time. By breaking the calls into a parallel flow, a BPEL process service component can invoke multiple web services at the same time, and receive the responses as they come in. This method is much more time efficient.
In case of Synchronous Call:- Oracle BPEL Process Manager executes in a single thread, executing the branches sequentially instead of in parallel
Create two synchronous BPEL process suppose one is to do Addition of two numbers and second one is to do multiplication of two numbers and one asynchronous process to do the concatenation.Now Invoke these webservices in one BPEL process using Flow Activity and test it in the Enterprise manager and see the Flow trace model.In my case it executed multiplication then after excuted Addition then it will execute concatenation Asynchronous process.
We need to set nonBlokingInvoke property set to true in partner link properties panel.
To perform this operation right click on the partner link and select the edit,then go to proprties tab and click the add icon then select this property from the provided values in drop down.

If this property is set then asynchronous partner link will not be blocked by synchronous partner links.
If we will not set this property then all synchronous process will execute first then asynchronous process will be executed.
Hope this would help.


How to create User Defined Custom XPATH function to use in XSLT

In this post we will see that how to create user defined function to use in XSLT Mapper.

Step1:- Create Java class to write the User defined function. The below Java code will convert long value into decimal value.

package com.geo.xpath;

public class LongToNumericPrimitiveTypesExample {

public static double LongToNumericPrimitiveTypes (Long input){
Long lObj = new Long("input");
double d = lObj.doubleValue();
return d;

}

}

Step 2:- Create ext-mapper-xpath-functions-config.xml file to contain the following value

<soa-xpath-functions version="11.1.1"

xmlns="http://xmlns.oracle.com/soa/config/xpath"

xmlns:geo="http://www.oracle.com/XSL/Transform/java/com.geo.xpath.LongToNumericPrimitiveTypesExample">

<function name="geo:LongToNumericPrimitiveTypes">

<className>com.geo.xpath.LongToNumericPrimitiveTypesExample</className>

<return type="number"/>

<params>

<param name="input" type="number"/>

</params>

<desc/>

<detail>

<![CDATA[This function convert long to decimal message.]]>

</detail>

</function>
</soa-xpath-functions>

In this XML basically Java class method is defined. Put this XML inside the META-INF folder in the same java class and create a JAR file of it.

Step 3:- For creating JAR file from JDeveloper. Right Click on the Java project select New -> Deployment Profile(From option select JAR File) then name the jar file and click next. Accept the all default value and the click Finish. Now right click again on the same project and click on the deploy option and deploy that JAR Archive. It will create the JAR file on to location like JDeveloper\mywork\Application1\LongTodecimalConversion\deploy. Verify if in the created jar file META-INF folder contains the ext-mapper-xpath-functions-config.xml file.

Step 4:- Now in JDeveloper select the Tools -> Preferences -> SOA and use the Add button to select the created jar. Now restart the JDeveloper. Created function will be available in user defined section of XSLT Mapper.



Now this is available at design time. Test it using the test  functionality of XSLT Mapper.

Step 5:- Now to make it available at run time put ext-mapper-xpath-functions-config.xml on the location <<SOAOracle_HOME>>\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\classes\META-INF and place the built jar file on the location <<SOAOracle_HOME>>\user_projects\domains\soa_domain\lib. Then restart the server. Now deploy the built project and test this user defined Custom XPATH function.

Hope this will help.


 

Sunday 16 October 2011

How to use While Activity in BPEL process

I am going to illustrate one example of using while activity in BPEL process.
In the example I created one Synchronous BPEL process with name ToTestBPELProcessWhileActivity.


Then Add a new Variable while clicking on highlighted variable icon in below image.

Name the Variable as Counter and select the type as Int by selecting radio button Type in Create Variable Dialogue.




Now Drag one Assign Activity in BPEL process and assign value 3 to Counter variable(Intialize value of the Counter Variable)



Then Drag one While activity below the assign activity and set the condition in General tab of While Activity as if loop should run till Counter variable have value greater then Zero.


Inside the scope of While Activity. Drop one Transformation activity as provided in below image.


Use the any activity to repeat it three times. Then Drop Assign activity below the transform activity in While Activity scope then use copy operation .It will decrement the loop counter variable as below


Once Counter variable value will be less then zero then while loop will terminate. That's it.














Monday 10 October 2011

Comparison between BPEL 1.1 and 2.0 Specification

Messaging:- In BPEL 1.1 there is no defined behavior for a process that receives a message for a request-response operation and finishes without replying. In BPEL 2.0, such a scenario would have trigged a new BPEL standard fault called "missingReply" fault.
New activity types:- repeatUntil, validate, forEach (parallel and sequential), rethrow, extensionActivity, compensateScope
Renamed activities:- switch/case renamed to if/else, terminate renamed to exit
Termination Handler:- added to scope activities to provide explicit behavior for termination
Variable initialization
portType attribute:- The attribute "portType" of messaging activities such as "receive," "invoke," "reply," "pick," and "onEvent" is no longer mandatory and can be omitted

The XML element "compensationHandler" and the XML attribute "enableInstanceCompensation" in the top-level "process" element have been removed.Instance (process) level compensation handlers never had any mechanism for being invoked; therefore, because they could not be used instance level compensation handling is no longer supported.Replace XML attribute "variableAccessSerializable" with "isolated"

The URI used to specify XPath 1.0 as the expression/query language of choice has been changed, so replace the attribute value "http://www.w3.org/TR/1999/REC-xpath-19991116" of the attributes "expressionLanguage" and "queryLanguage" with the attribute value "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"
Replace the XML attribute "variableAccessSerializable" with "isolated" .
XSLT for variable transformations (New XPath extension function bpws:doXslTransform).
Locally declared messageExchange (internal correlation of receive and reply activities) .
XPath access to variable data (XPath variable syntax $variable[.part]/location).