Wednesday, 25 January 2012

Deploying BPEL process to multiple environments

BPEL process can be directly deployed into Development instance from JDeveloper using the ANT script created by it. However this is not good practice to deploy into multiple environments (like TEST, QA, PRE-PROD & PROD) as the configuration properties typically vary from environment to environment. For example, the common error handling web service partner link URL for the production Environment is typically different from the one used in the testing environment.

Beginning with release of SOA suite, customize ANT feature is provided using which we can specify property values for different environments in a single build file location. This task can be used as subtask of bpelc.

Below is sequence of steps to define the ANT ‘customize’ task and deploy BPEL to multiple environments:

Step1: Create environment specific .properties files:
1.Create configuration properties files for each environment with file names following notation of “build_$”:

2.In each of these properties files, provide all the environment specific variables as follows:

# environment – TEST/QA/PRE-PRD/PRD
#Parameters for common Error handling
# --------------------------------------------------

Step2: Create build.xml with ant customization:
1.Copy build.xml from main folder to BPEL sub-folder

2.Modify this build.xml in BPEL sub-folder to point to the properties file:
Find the below property tag in build.xml:
<!--property file="${process.dir}/"/>Replace the above XML with the following:
<!--property file="${process.dir}/build_${env}.properties"/>
3.Define ANT ‘customize’ task to change the WSDL URL of a PartnerLink
Find the following target XML tag in the build.xml file under BPEL sub-folder:
<!--target name="compile">
Compiling bpel process ${
}, revision ${rev} 
<!--bpelc input="${process.dir}/bpel/bpel.xml" out="${process.dir}/output"
rev="${rev}" home="${bpel.home}"/>

Replace the above XML with the following to create customize task for all partner links in BPEL process
<!--target name="compile">
<!--bpelc input="${process.dir}/bpel/bpel.xml" out="${process.dir}/output"
<!--partnerLinkBinding name="CommonErrorHandling">
<!--property name="wsdlLocation">
<!--partnerLinkBinding name="CustomerUpsertProcess">
<!--property name="wsdlLocation">


Step 3: Create custom target in main build.xml to direct to build.xml created & modified in Step2 above:
1. Add following target to {BPEL Process}/build.xml file
<!--target name="compile1">
Compiling bpel process with following ${}/bpel/build.xml file
<!--ant dir="${process.dir}/bpel"/>

2.Modify process-deploy target to invoke the new compile1target created in above:
Find following target xml tag in {BPEL Process}/build.xml file
<!--target name="process-deploy"
depends="validateTask, compile, deployProcess, deployTaskForm, deployDecisionServices" />
Replace it with the following:
<!--target name="process-deploy"
depends="validateTask, compile1, deployProcess, deployTaskForm, deployDecisionServices" />
3.Change property file value of XML in the build.xml file under {BPEL Application} folder:
Find following property xml tag in {BPEL Process}/build.xml file
<!--property file="${process.dir}/"/>Replace it with the following:
<!--property file="${process.dir}/build_${env}.properties"/>
Step4 : Use ANT and deploy the BPEL process to respective environment:
Make sure to modify the ant property env= test/qa/pre-prod/prod depending on environment before deploying

No comments:

Post a Comment