Oracle BPEL Deployment Plan

Overview

* Since 10.1.3.4

Add Deployment Plan Ant Tasks

* Add the following Ant Tasks to ‘build.xml’ file.

    <!--=============================-->
    <!-- Deployment Plan Tasks       -->
    <!--=============================-->
    <!-- Default to planfile_dev.xml -->
    <property name="planfile" value="planfile_dev.xml"/>
 
    <!-- Generate Plan From Project -->
    <target name="generate_plan_from_project">
      <generateplan 
            planfile="${process.dir}/${planfile}"
            verbose="true"
            overwrite="true"
            descfile="${process.dir}/bpel/bpel.xml"/>
    </target>
 
    <!-- Generate Plan From Suitcase -->
    <target name="generate_plan_from_suitcase">
      <generateplan 
            planfile="${process.dir}/${planfile}"
            verbose="true"
            overwrite="true"
            suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
    </target>
 
    <!-- Validate Suitcase -->
    <target name="validate_plan">
      <validateplan 
           planfile="${process.dir}/${planfile}"
           verbose="true" 
           overwrite="true"
           suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"
           reportfile="${process.dir}/output/validate_${planfile}.txt"/>
    </target>
 
    <!-- Attach Plan to Suitcase -->
    <target name="attach_plan">
      <attachplan 
           planfile="${process.dir}/${planfile}"
           verbose="true"
           overwrite="true"
           suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
    </target>
 
    <!-- Extract Plan from Suitcase -->
    <target name="extract_plan">
      <extractplan 
        planfile="${process.dir}/${planfile}"
           verbose="true"
           overwrite="true"
           suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
    </target>

Create a Deployment Template

* Run ant from BPEL developer prompt:
ant -Dplanfile=planfile.xml generate_plan_from_project

Create a Deployment Plan

* Save the created ‘planfile.xml’ for a particular environment such as ‘planfile_test.xml’.
* Edit saved file for needed modifications.
– Use ‘searchReplace’ to replace strings.
* For example:

<?xml version="1.0" encoding="UTF-8"?>
<!--BPELDeploymentPlan for a suitcase, the file is re usable across suitcases-->
<BPELDeplymentPlan xmlns="http://schemas.oracle.com/bpel/deployplan"
 xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/">
  <!-- BPELProcess tag indicates the rules apply to a specific process or all
 processes in the suitcase.
       A '*' indicates all processes. -->
 
  <BPELProcess id="Process1|Process2|Process3">
    <!-- this section applies to the configurations in bpel.xml file -->
 
    <configurations>
      <!-- a '*' in name indicates all properties -->
      <property name="defaultInput">
        <!-- Use this section to provide a search and replace string -->
        <searchReplace>
          <search>http://my.globalcompany.com:9700</search>
          <replace>http://my.oracle.com:1234</replace>
        </searchReplace>
        <searchReplace>
          <search>/autoloan/mybank</search>
          <replace>/allloans//boa/</replace>
        </searchReplace>
      </property>
      <property name="property4">
        <!-- Use this to replace the value of the property4 -->
        <replace>![CDATA[This demo showcases the integration of synchronous and
        asychronous services into an end-to-end business process. This sample
        application.  ]]
        </replace>
      </property>
    </configurations>
 
    <partnerLinkBindings>
        <!-- this section applies to the partnerlink bindings in bpel.xml file.
             Give '*' to apply for all partner link bindings.-->
        <partnerLinkBinding name="LoanService1">
        <property name="*">
          <!-- Use this section to provide a search and replace string -->
          <searchReplace>
            <search>http://mydevserver:9700</search>
            <replace>http://mytestserver:9500</replace>
          </searchReplace>
        </property>
      </partnerLinkBinding>
      <partnerLinkBinding name="AutoLoanService">
        <!-- a '*' in name indicates all properties -->
        <property name="wsdlRuntimeLocation">
          <!-- in this case we are providing a new value for the property,
               there is no search and replace -->
          <replace>
            <value>http://autoloan_test_server:1234/AutoLoan?wsdl</value>
          </replace>
        </property>
      </partnerLinkBinding>
      <!-- Note: we gave specific search and replace rules for some partner
      link bindings and this is the rule for all other partner link bindings-->
      <partnerLinkBinding name="*">
        <property name="*">
          <!-- Use this section to provide a search and replace string -->
          <searchReplace>
            <search>9700</search>
            <replace>9500</replace>
          </searchReplace>
        </property>
      </partnerLinkBinding>
    </partnerLinkBindings>
  </BPELProcess>
 
  <!-- This section applies to all wsdl and xsd files in the suitecase, give
      specific names separated by '|' is need specific replacement-->
 
  <wsdlAndSchema name="FlatStructureOutbound.wsdl|Loademo.xsd">
    <!-- Remember to add xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    in BPELDeploymentPlan if you want to replace jca properties as shown below.
    -->
 
    <jca:property name="PhysicalDirectory">
    <searchReplace>
        <search>/tmp/dev/inbound</search>
        <replace>/tmp/test/inbound</replace>
      </searchReplace>
    </jca:property>
    <jca:property name="FileNamingConvention">
      <searchReplace>
        <search>.txt</search>
        <replace>.doc</replace>
      </searchReplace>
    </jca:property>
 
    <!-- Note: any searchReplace should always be added after jca properties
         section. -->
    <searchReplace>
      <search>http://mydevserver:9700</search>
      <replace>http://mytestserver:9500</replace>
    </searchReplace>
 
    <searchReplace>
      <search>dev.xsd</search>
      <replace>test.xsd</replace>
    </searchReplace>
  </wsdlAndSchema>
</BPELDeplymentPlan>

Validate Plan

* Run ant from BPEL developer prompt:
ant -Dplanfile=planfile_test.xml validate_plan
* View validate_${planfile}.txt

Attach Deployment Plan to a Suitcase

* Run ant from BPEL developer prompt:
ant -Dplanfile=planfile_test.xml attach_plan
* The task will generate a file named ‘bpeldeployplan.xml’ in the BPEL Suitcase using ‘planfile_test.xml’ plan.

Extract Deployment Plan from a Suitcase

* Run ant from BPEL developer prompt:
ant -Dplanfile=planfile_test.xml extract_plan

Modify Ant to Use Deployment Plan

* Add ‘attach_plan’ task as a dependency to the ‘deploy’ task

<target name="process-deploy"
          depends="validateTask, compile, attach_plan, deployProcess,
deployTaskForm, deployDecisionServices" />

* Run ant from BPEL developer prompt:
ant -Dplanfile=planfile_test.xml deploy

References

* http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/bpelrn.htm#BABCEBAA
* http://blogs.oracle.com/reynolds/2008/11/bpel_deployment_framework.html

This entry was posted in bpel, oc4j, oracle. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.