Thursday 26 January 2012

Migrating Oracle BPEL 10.1.3.3.X To Different Environments

  • Initial Setup 
    • Not Required. Out of the box available with SOA Setup. JDeveloper creates a build.xml under each BPEL project which you create. Simply need to alter build.xml to make it suitable for migration across different environments. 
  • Project Setup 
    • Create a copy of build.properties (with the names mentioned below) file for each environment and save it at the same location as build.properties (it’s generally located at the root folder of JDeveloper project) 
      • build_dev.properties 
      • build_tst.properties 
      • build_prd.properties 
      • build_prf.properties 
  • As of now assumption is we have Development (dev), prf (performance), tst (test) and Production (prd) environments. 
  • Make the following changes into build_<env>.properties 
    ############### Add (Mandotory) ############### 
    # Application specific variables to be used during the build 
    bpel_host= <bpel server VIP name> ## (put the host name which will be substituted in WSDL URLs in respective environments) 
    bpel_port=<bpel server VIP port> 
    ############### Update (Mandatory) ############### 
    # Make sure admin.user, admin.password is correct for appserver 
    admin.user = oc4jadmin ## or the user name who has access to BPELAdmin console) 
    # http.hostname and http.port should point to BPEL Server’s host and http port 
    http.hostname = <hostname> ## hostname of the server where we are deploying 
    http.port = <port> ## port where server is running 
    # Change below if deploying in domain other than "default" 
    domain = <bpel domain> 
    # Change below if deploying with process revision other than 1.0 
    rev = <current revision> 
    ############### Update (Mandatory for Clustered Environment) ############### 
    cluster = true 
    j2ee.hostname = <physical node where bpel process will be deployed>
  • Copy build.xml at <app root> to bpel subfolder 
    • copy <app root folder>\build.xml <app root folder>\bpel\build.xml 
  • Make the following changes into <app root folder>\bpel\build.xml 
    • Add <customize> task under bpelc task 
      <target name="compile"> 
      <echo> 
      ————————————————————– 
      | Compiling bpel process ${process.name}, revision ${rev} 
      ————————————————————– 
      </echo>
      <bpelc input="${process.dir}/bpel/bpel.xml" out="${process.dir}/output" 
      rev="${rev}" home="${bpel.home}"/> 
      </target>
      ############### Change it to the following ############### 
      ## You have to put <partnerLinkBinding> tag for each partner link to be modified 
      ## below is illustration for SampleProcess defined in bpel.xml as sample_pl we have to do similar 
      ## task for other processes
      <target name="compile"> 
      <echo> 
      ————————————————————– 
      | Compiling bpel process ${process.name}, revision ${rev} 
      ————————————————————– 
      </echo>
      <bpelc input="${process.dir}/bpel/bpel.xml" out="${process.dir}/output" 
      rev="${rev}" home="${bpel.home}"> 
      <customize> 
      <partnerLinkBinding name="sample_pl"> 
      <property name="wsdlLocation"> 
      http://${bpel_host}:${bpel_port}/orabpel/${domain}/SampleProcess/{rev}/SampleProcess?wsdl 
      </property> 
      </partnerLinkBinding> 
      <configurations> 
      <property name="propName">propValue</property> 
      </configurations> 
      <activationAgents name="actAgentName"> 
      <property name="propName">propValue</property> 
      </activationAgents> 
      <preferences> 
      <property name="propName">propValue</property> 
      </preferences> 
      </customize> 
      </bpelc> 
      </target>
    • If you have to make changes into other files apart from bpel.xml like WSDLs or XSDs or XSLs please use "replace" ant task. Insert this text inside "compile" target before <bpelc> tag. 
      <replace file="<fileName>" token="<searchText>" value="<replaceText>"/> 
      For example: 
      <replace file="sample.wsdl" token="search_text" value="${replace_text}"/>
    • Refer to the environment specific build_<env>.properties file 
      <!– First override from build.properties in process.dir, if available –> 
      <property file="${process.dir}/build.properties"/> 
      ############### Change it to the following ############### 
      <!– First override from build.properties in process.dir, if available –> 
      <property file="${process.dir}/build_${env}.properties"/>
  • Make the following changes into build.xml (at application root folder). 
    • Create a new compile target that redirects execution to the target within the build file within the bpel subdirectory 
      <target name="compileEnv"> 
      <echo> 
      ————————————————————– 
      | Compiling bpel process using ${process.name}/bpel/build.xml 
      ————————————————————– 
      </echo> 
      <ant dir="${process.dir}/bpel"/> 
      </target>
    • Modify the process-deploy target to invoke this new compile target 
      <target name="process-deploy" 
      depends="validateTask, compile, deployProcess, deployTaskForm, deployDecisionServices" /> 
      ############### Change it to the following ############### 
      <target name="process-deploy" 
      depends="validateTask, compileEnv, deployProcess, deployTaskForm, deployDecisionServices" />
    • Refer to the environment specific build_<env>.properties file 
      <!– First override from build.properties in process.dir, if available –> 
      <property file="${process.dir}/build.properties"/> 
      ############### Change it to the following ############### 
      <!– First override from build.properties in process.dir, if available –> 
      <property file="${process.dir}/build_${env}.properties"/>
  • Deployment 
    • Upload your Project to build server under deployment folder for example: /apps/orabpel/deploy/<env>/<domain>/<app>. 
    • Start BPEL Developer Prompt / Shell
      • <ORACLE_HOME>/bpel/bin/devprompt.sh
    • Go to the application folder 
      • cd /apps/orabpel/deploy/<env>/<domain>/<app> folder (as mentioned in step 01) 
    • Execute obant.sh from your <app root folder> and pass appropriate values depending upon the environment you want to deploy
      • obant.sh -Denv=dev -Dadmin.password=<oc4jadmin password> or
      • obant.sh -Denv=qa -Dadmin.password=< oc4jadmin password > or
      • obant.sh -Denv=test-Dadmin.password=< oc4jadmin password > or
      • obant.sh -Denv=prod -Dadmin.password=< oc4jadmin password >
  • Validation Step 
    • Obant script should say "Build Successful" i`n the end. Also test deployment from BPEL Console.

No comments:

Post a Comment

xslt padding with characters call template for left pad and right pad

  Could a call-template be written that took two parameters ?   a string, and a   number) return the string with empty spaces appended t...