Sunday, March 20, 2011

How to get the deleted files in project content

This problem I faced after mistakenly deletion of my transformation file from project and while retrieving the file back in JDeveloper Project view. We can follow the same procedure for any other types of files present in BPEL Project.

1. Go to source of your BPEL project .jpr file
2. Search for the deleted file name
3. Delete the entries for  <string v="-<<fileName>>"/>
4. close the project, refresh and check for the files in contents.

Friday, March 4, 2011

Best Practices to Improve Performance of BPEL Process

On the basis of my experience till date I am sharing some of the best practices, for improving performance of a BPEL process. I am not sure how much will these impact the performance but I think the system performance will get improved at least by some milliseconds.

Below are some of the key points which I have explored during my day today tasks.
  • We all usually use databases for our configurations like we create a configuration databases and create some tables to store error logs, some name value mappings etc. to avoid hard coding in our code. I have also used the same during my projects, but If we use DVM's (for those records for which there are very less chances to be changed) inspite of database will improve the performance of the BPEL Process, as there is reduction in Partner link call. The Function which we usually use for DVM's is orcl:lookup-dvm().
  • Cleanup/Purging of instances from BPEL console and dehydration database at regular Interval of time like we can have the backup of the schema and use Oracle API's to clean up instances in dehydration database.
  • There are some XSLT functions, which improve the processing of BPEL processes. Below are some of those.
    • Use of "for-each-group" in place of for-each
    • Very less use of "if" conditions and use of conditional statements under square brackets "[]"
    • One of the important point I have noticed is removal of comments provided in starting of XSLT but then the design view of xsl is not visible.
    • For the situations where one for-each condition is been used for multiple mappings, inspite of having similar for-each statement multiple times, use of multiple mapping statements in a single for-each. Like 
                      <xsl:for-each test="">
                             <A>
                  <xsl:value-of select="">
                             </A>
                             <B>
                                 <xsl:value-of select="">
                             </B>
                      </xsl:for-each>
  • Use of Assign activities, inspite of Transformation (wherever possible) will also improve the performances. If we use ora:processXSL() function in assign for transformation rather than using transformation activity will improve the performance.
There are many more best practices which will improve the performance, which I will include those later on....

Tuesday, February 15, 2011

Oracle SOA Interview Questions



SOA/BPEL basic questions

1.    Explain SOA architecture?
2.    Explain WSDL structure?

3.    What is the use of SOA in IT industry and how it resoves the problem?

4.    Why we use BPEL and ESB in SOA?

5.    What is the main concept behind ESB?

6.    What builds up Oracle Fusion Middleware?

7.    What are various parts of Oracle SOA Suite?

8.    What is the main function of Business Rules?

9.    Why we use Web service Manager?

10.  How can we secure our web services using Oracle SOA Suite?


Project Question


11.  Explain about your project Architecture?

12.  How you are using SOA in your architecture (Flow of BPEL--> ESB)?


BPEL Technical’s


13.  What is the use of PICK activity in BPEL PM?

14.  Why we use Decision service?

15.  How can we improve the performance of an XSL file? –

Answer: - By avoiding use of various if statements and using choose, and by using for-each group in place of for-each.

16.  How to deploy an XSL file without deployment of BPEL Process?

Answer: - we will directly deploy the XSLT, options: -

    ü  Using ANT script by file replacement in TMP folder.

    ü  By creating a folder in BPEL PM installation folder and specifying its location in our BPEL code with http        
                 call and replacing our xslt to that location



Question on Dehydration Database


17.  What is the use of Work_Item table?

18.  How can we clear the instances using dehydration database?


ESB Technical’s


19.  How can you call a web service or BPEL process in an ESB?

Answer: -

    ü  By selecting the service of deployed BPEL process -- It creates problem while deployment as it has
                dependencies.

    ü  By copying the wsdl of deployed process and then creating a SOAP service of that process.

20.  What are DVM's and how are they helpful in SOA?

21.  What is end point virtualization?




Monday, February 7, 2011

Oracle SOA Suite Best Practices

As per my day today activities I had discovered some best practices which can be implemented while developing a BPEL, ESB or SOA services. Below are some of the key points.
  • Use of preference variables or deployment descriptors in-spite of hard coding while assigning values.
  • Using ws-addressing schema in Dynamic Partner link while mapping values for header schema or while mapping the URL.
  • Create and copy the commonly used xsl, xsd, wsdl, config xml and other files in a server folder which can be accessed using http call. i.e. create the transformation file and copy it under the location "$ORACLE_HOME/bpel/system/xsd" and access it using "http://<<host:port>>/orabpel/xsd/<<name of file>>"
          Note: - Try avoiding copying the files under Apache location because it might hamper the server performance and in case the server crashes then the file might also get impacted.
  • Designing Integration flow, as all the adapters and routings should come under ESB part and the Implementation logic under the BPEL, so that we can access the adapters and other routings as a web service and whenever an exception is encountered under ESB our BPEL logic would not be impacted. This will also help in system performance.
  • For improving performance of our BPEL/ESB service:-
    • Use assign along with "ora:processXSL" API in place of transform activity or go to source of BPEL code and delete the annotation part under transformation.
    • Implementing conditions as "<xsl:value-of select="<<element node>>[condition]/<<element node>>"/>" rather than using if condition
    • Rare use of for-each and use "for-each group" in place of "for-each", with "version=2.0"

Saturday, February 5, 2011

Transaction Handling in FileAdapter



I struggled a lot while implementing transaction handling in file adapter and come to a solution of using compensation handler for implementation of rollback of files.
Below is the scenario for my requirement: -
We have been provided 2 types of files to different partners and as per our scenario if 1st File transfer is success and the second transfer got failed then the first transfer should also get rolled back.
The solution implemented is: -
1. Create an empty BPEL Process.
2. Create File adapter(1) with read operation linked with receive activity
3. Create a Partner1(File Adapter with write Operation) linked with invoke activity
4. Create another File Adapter with Synch Read Operation linked to another Invoke activty and mapped to another Partner2(File Adapter with write Operation) linked with invoke activity
5. For Implementing Transaction handling, Compensation handler is implemented at scope level and in Compensation handler Partner1 is called for synch read operation and file is written back to location of File Adapter(1).
Below is the bpel code for the above requirement: -
<?xml version = “1.0″ encoding = “UTF-8″ ?>
<process name=”BPELProcess3″
targetNamespace=”http://xmlns.oracle.com/BPELProcess3″
xmlns=”http://schemas.xmlsoap.org/ws/2003/03/business-process/”
xmlns:bpws=”http://schemas.xmlsoap.org/ws/2003/03/business-process/”
xmlns:xp20=”http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20″
xmlns:ns4=”http://xmlns.oracle.com/pcbpel/adapter/file/FileAdapter_SynchRead/”
xmlns:ns7=”http://xmlns.oracle.com/pcbpel/adapter/file/File_Compensate_Write/”
xmlns:ldap=”http://schemas.oracle.com/xpath/extension/ldap”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
xmlns:ns5=”http://xmlns.oracle.com/pcbpel/adapter/file/Partner2/”
xmlns:client=”http://xmlns.oracle.com/BPELProcess3″
xmlns:ns6=”http://xmlns.oracle.com/pcbpel/adapter/file/FileCompensate_Rollback/”
xmlns:ora=”http://schemas.oracle.com/xpath/extension”
xmlns:ns1=”http://xmlns.oracle.com/pcbpel/adapter/file/n/”
xmlns:ns3=”http://xmlns.oracle.com/pcbpel/adapter/opaque/”
xmlns:ns2=”http://xmlns.oracle.com/pcbpel/adapter/file/m/”
xmlns:bpelx=”http://schemas.oracle.com/bpel/extension”
xmlns:orcl=”http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc”>
<partnerLinks>
<partnerLink myRole=”Read_role” name=”FileAdapter1″
partnerLinkType=”ns1:Read_plt”/>
<partnerLink name=”Partner1″ partnerRole=”Write_role”
partnerLinkType=”ns2:Write_plt”/>
<partnerLink name=”FileAdapter_SynchRead” partnerRole=”SynchRead_role”
partnerLinkType=”ns4:SynchRead_plt”/>
<partnerLink name=”Partner2″ partnerRole=”Write_role”
partnerLinkType=”ns5:Write_plt”/>
<partnerLink name=”FileCompensate_Rollback” partnerRole=”SynchRead_role”
partnerLinkType=”ns6:SynchRead_plt”/>
<partnerLink name=”File_Compensate_Write” partnerRole=”Write_role”
partnerLinkType=”ns7:Write_plt”/>
</partnerLinks>
<variables>
<variable name=”Receive_1_Read_InputVariable” messageType=”ns1:Read_msg”/>
<variable name=”Invoke_1_Write_InputVariable” messageType=”ns2:Write_msg”/>
<variable name=”Invoke_2_SynchRead_InputVariable”
messageType=”ns4:Empty_msg”/>
<variable name=”Invoke_2_SynchRead_OutputVariable”
messageType=”ns4:SynchRead_msg”/>
<variable name=”Invoke_3_Write_InputVariable” messageType=”ns5:Write_msg”/>
<variable name=”Invoke_4_SynchRead_InputVariable”
messageType=”ns6:Empty_msg”/>
<variable name=”Invoke_4_SynchRead_OutputVariable”
messageType=”ns6:SynchRead_msg”/>
<variable name=”Invoke_5_Write_InputVariable” messageType=”ns7:Write_msg”/>
</variables>
<sequence name=”main”>
<scope name=”Scope_1″>
<faultHandlers>
<catchAll>
<compensate name=”Compensate_1″ scope=”Scope_3″/>
</catchAll>
</faultHandlers>
<sequence name=”Sequence_1″>
<sequence name=”Sequence_1″>
<receive name=”Receive_1″ partnerLink=”FileAdapter1″
portType=”ns1:Read_ptt” operation=”Read”
variable=”Receive_1_Read_InputVariable”
createInstance=”yes”/>
<scope name=”Scope_3″>
<compensationHandler>
<sequence name=”Sequence_2″>
<scope name=”Scope_2″>
<sequence name=”Sequence_3″>
<invoke name=”Invoke_4″
partnerLink=”FileCompensate_Rollback”
portType=”ns6:SynchRead_ptt” operation=”SynchRead”
inputVariable=”Invoke_4_SynchRead_InputVariable”
outputVariable=”Invoke_4_SynchRead_OutputVariable”/>
<assign name=”Assign_3″>
<copy>
<from variable=”Invoke_4_SynchRead_OutputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
<to variable=”Invoke_5_Write_InputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_5″ partnerLink=”File_Compensate_Write”
portType=”ns7:Write_ptt” operation=”Write”
inputVariable=”Invoke_5_Write_InputVariable”/>
</sequence>
</scope>
</sequence>
</compensationHandler>
<sequence name=”Sequence_4″>
<assign name=”Assign_1″>
<copy>
<from variable=”Receive_1_Read_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
<to variable=”Invoke_1_Write_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_1″ partnerLink=”Partner1″
portType=”ns2:Write_ptt” operation=”Write”
inputVariable=”Invoke_1_Write_InputVariable”/>
</sequence>
</scope>
<scope name=”Scope_4″>
<sequence name=”Sequence_5″>
<invoke name=”Invoke_2″ partnerLink=”FileAdapter_SynchRead”
portType=”ns4:SynchRead_ptt” operation=”SynchRead”
inputVariable=”Invoke_2_SynchRead_InputVariable”
outputVariable=”Invoke_2_SynchRead_OutputVariable”/>
<assign name=”Assign_2″>
<copy>
<from variable=”Invoke_2_SynchRead_OutputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
<to variable=”Invoke_3_Write_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_3″ partnerLink=”Partner2″
portType=”ns5:Write_ptt” operation=”Write”
inputVariable=”Invoke_3_Write_InputVariable”/>
</sequence>
</scope>
</sequence>
</sequence>
</scope>
</sequence>
</process>

Datasource Creation using ant script


I worked on a POC for Automated Configurations in ant, and struggled in creating multiple datasource and connection pools at a single go. For that I created an XML file containing all configuration settings as attributes and used for multiple tags.
Below is the part of my XML file and ANT targets.
Configuration XML:-

DataSourceName=”TEST_DataSource” User=”user”
Password=”pass” jndiLocation=”jdbc/TEST_DataSource”
JNDIUrl=”jdbc:oracle:thin:@<>:<>:<>”/>


ANT Target: -

description=”Manage the data sources and database connection pools”>
userid=”${admin.user}”
password=”${admin.password}”
name=”${connPool}”
factoryclass=”oracle.jdbc.pool.OracleDataSource”
applicationname=”default”
dbuser=”${conn.user}”
dbpassword=”${conn.pass}”
url=”${conn.jndi}”/>
userid=”${Configuration-Property.Oracle-Config.Admin_User}”
password=”${Configuration-Property.Oracle-Config.Admin_Pass}”
datasourcename=”${dataSrc}”
applicationname=”default”
jndilocation=”${conn.jndi.location}”
connectionpoolname=”${connPool}”/>
path=”/Configuration-Property/CreateDataSource/DatabaseConnectionPool”

Sunday, August 9, 2009

Building Test Suites in a BPEL Process

Test Suites and Test Cases are used for Automated Unit Testing of a BPEL Process whenever there is any modification in the process or the Work flow activity. They operate on the invoke activities falling in between a flow of a test case (The transition or flow which we are testing).
Below are some steps for creating Manual and Automated Test Suites/Cases using JDeveloper as an IDE for BPEL Process


Steps for Creating Test Suite: -

  1. Got to BPEL Process in JDeveloper.
  2. Right Click on Test Suites, and Click "Create Test Suite"
  3. Enter Name and Click OK

Steps for Creating Test Case: -

Automated Test Case: -

  1. Right click on the above created Test Suite and the Create BPEL Test Case
  2. Go To BPEL Console, and then to the instance of the tested BPEL Process
  3. Click "Test", and then get the Tested XML. Save it as baseline XML in "include" folder of Created Test Suite folder in Physical Location
  4. Now, go to created BPEL Test Case and Click on the icon for import baseline XML
  5. Now, Add the above saved xml (step-3)
  6. Right Click on the last Invoke/Reply activity and Add Assertion to the Invoke activity, so as to get the status of success and failure of the activity.
  7. Save the Test Case and Deploy it to the Server.
Manual Test Cases: -

  1. Right click on the above created Test Suite and the Create BPEL Test Case
  2. Go To BPEL Console, and then to the instance of the tested BPEL Process
  3. Get the Output of all the invoke activities occurring in the flow and save it as ".xml" to the message folder of physical location of BPEL Test Case.
  4. Repeat Step#3 for the Receive activity of the tested instance of BPEL Process (Save input message of Recieve activity)
  5. Now, go to created BPEL Test Case and right click on the recieve activity to enter the message manually and select the saved message.
  6. Now, Repeat Step-5 for all the invoke activities occurring in the flow
  7. Right Click on the last Invoke/Reply activity and Add Assertion to the Invoke activity, so as to get the status of success and failure of the activity.
  8. Save the Test Case and Deploy it to the Server
The above steps will create the test cases, and we can execute these by going to the BPEL Process in BPEL Console and the clicking on Test Suite.

B2B Features with OIC

During last couple of months various new features are getting introduced in Oracle Integration Cloud, out of those there is a new feature f...