Friday 25 October 2013

BPEL DB Adapter Polling With Update Sequencing Table

Sometimes we required to poll a table depending upon last polled date time or last polled sequence id. To handle this scenario BPEL DB adapter gives after poll option as given below,

  • Update a Sequencing Table
  • Update an External Sequencing Table on a Different Database
  • Update a Sequencing File
To use the Update a Sequencing Table need to create another table which minimum have two columns. One contains the polling table name and 2nd column contain the last value(ID/Last fetch date). Please follow the below snapshots.
  • Create a BPEL process and use a DB adapter to poll the corresponding database records.

  • Choose the Table you want to poll.

  • After Polling choose the option as Update a Sequencing Table.

  • Fill the Details of Sequencing table as mentioned in the comments of the below snapshot.

  • The above configuration generates the Polling DB adapter SQL query as given below.

  • Now this DB adapter is ready to poll the records depending upon last modify date.


Friday 18 October 2013

WLST Script : SOA Process Deployment

We can deploy a SOA process using the following ways.

  • JDeveloper by connecting to corresponding Weblogic Server
  • ANT Script
  • WLST Script (Web Logic Scripting Tool)
  • Weblogic Enterprise manager by accessing the SAR file
  • Hudson tool
WLST Script :
It is command-line scripting interface which can be used to manage and monitor Weblogic server instances and domains. We can execute WLST commands one by one on the command line, it will display the corresponding results. Otherwise we can club all the commands into a python (.py) file and execute it programatically i.e we can use loops,conditions etc.
We can use this interface in two different modes as mentioned below.
  • Online Mode : Connected to a running weblogic administration server
  • Offline Mode : Not connecting to administration server   
To connect to WLST interface online we need to execute the below steps.
  • Goto : cd /u01/Middleware/oracle_soa1/common/bin/
  • Execute command :     ./wlst.sh
  • It will connect to the WLST interface in offline mode.
  • Execute command :    connect('username','password',"t3://host:7001");
  • Now it will connected to the Weblogic admin server with Online mode.
We can use the following command in Online mode to deploy SOA processes and SOA MDS.

Export MDS : 
exportMetadata(application='soa-infra',server='soa_server1',toLocation='/u01/temp1/MDSData', docs='/apps/**');

Import MDS : 
importMetadata(application='soa-infra', server='soa_server1',fromLocation='/var/tmp/MDSData',docs="/apps/**");

Plan File Generate :               
sca_generatePlan("/var/tmp/MMpoRequest.xml",composite="/var/RequestorABCS/composite.xml",overwrite=true);

Plan File Validate : 
sca_validatePlan("/u01/temp1/myValRep.xml", "/u01/myplan1.xml",composite="/u01/RequestorABCS/composite.xml");
sca_validatePlan("/u01/temp1/myValRep.xml", "/u01/myplan1.xml", sar="/u01/ProivderABCS_rev1.0.jar");

Deploy Composite : 
sca_deployComposite("http://wlsHost:8001","/u01/RequestorABCS/deploy/RequestorABCS_rev1.0.jar",overwrite=true, user="weblogic",password="admin123",forceDefault=true,partition="default",configplan="/u01/myplan1.xml");

Undeploy Composite :
sca_undeployComposite("http://wlsHost:8001","VarSensor", "1.0", partition='POC');

We can use a configplan file at the time of deploying a SOA process which depends upon another wsdl deployed on a WLS server and we try to deploy it on a different server which not same as the calling wlst resides. The plan file search the location of the wsdl location and replaces with the current deploying wls server location. We can create a single plan file for multiple soa processes.

Deploy Multiple SOA processes using WLST:
For this we need to create a soa bundle SAR file at first by using following steps on Jdeveloper.




Choose those projects which are you need to bundle from the application projects.


Now again go to the Application tab-> Deploy. Here you will get the created SOA Bundle file.


We can deploy the SOA bundle file directly on application server or to the SOA Bundle file(It will create a corresponding JAR file on the Application->Deploy folder. This jar file can be deploy to a remote server using WLST script.).





Also Check : Generate Config Plan File For SOA Composite



Happy Coding :)





Friday 4 October 2013

Fetch and Display BPEL Validate Activity Fault Message

On using Validate Activity for a BPEL variable, if the values are failed against corresponding XSD it always raises InvalidVariable Runtime Exception, but the actual message is shown on the Audit Trail on Enterprise Manager.

To get the Detail message about the fault which element value or rule is failed against the XSD please follow the below steps.


  • Create Mediator whose source type is the message is the corresponding validator XSD type.   
  • Pass the variable which you want to validate as input to the mediator.
  • Check the Validate XSD option on the  mediator routing rule.
  • It will validate the input message against the xsd and raises RemoteFault.
  • After that we need to capture the RemoteFault with Catch block. 
        
  • Create a Fault variable in the Catch block. It will include Runtime.wsdl automatically into the project.
  • Change the Variable type as Rutime.wsdl message type as {http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage.



  • Now on executing the BPEL process if any Validation fail the Fault variable part Detail has the actual message.