Adding Oracle ODI Agent execution under OPMN control

I was talking to a customer and explaining opmn and it's role acting as main process control for OracleAS and custom components. While talking also about Oracle Data Integrator (ODI) agents and how to start them up, it occured to my mind to test how to place agent startup/shutdown under opmn control.

Adding your own scripts and executables under opmn control as part of the whole OracleAS package is supported and described in the OPMN manual.

Here is how it goes when adding ODI Agent:

Modify and edit following XML fragment and paste it on $ORACLE_HOME/opmn/conf/opmn.xml


<ias-component id="OdiAgent" status="enabled" id-matching="false">
       <variable id="ODI_JAVA_HOME"
                 value="D:\product\\OracleAS_1\jdk" append="false"/>
       <variable id="ODI_HOME"
                 value="D:\product\odiclient\oracledi" append="false"/>
    <process-type id="OdiAgent" module-id="CUSTOM">
       <process-set id="OdiAgent" restart-on-death="true" numprocs="1">
             <category id="start-parameters">
                <data id="start-executable" value="D:\product\odiclient\oracledi\bin\agent.bat"/>
                <data id="start-args"
                      value="-PORT=20900 -NAME=MYAGENT"/>
             <category id="stop-parameters">
                <data id="stop-executable"
                <data id="stop-args" value="-PORT=20900"/>


Starting the ODI agent is done by:

opmnctl startproc process-type=OdiAgent


Stopping the ODI agent is done by:

opmnctl stopproc process-type=OdiAgent


After restarting or reloading the opmn you can see ODI agent starting up and showing up in the status list:

D:\product\\OracleAS_1\opmn\bin>opmnctl status

Processes in Instance: soasuite.hkaukovu-fi
ias-component                    | process-type       |     pid | status
OdiAgent                         | OdiAgent           |   20780 | Alive
ASG                              | ASG                |     N/A | Down
OC4JGroup:default_group          | OC4J:home          |   31364 | Alive


Switching BPEL Process File Based Decision Service to WebDAV Based

You might get into a situation where you have started the BPEL Process development using file based business rule repository and noticed later on that you should have been using WebDAV instead.


Once you have defined the file based business rule service in BPEL process, the file repository is actually copied under the deployment structure:

<BPEL process>/decisionservices/<servicename>war/WEB-INF/repository

Please note that making any changes on the original rule file will not have any effect on the rule repository deployed and copied with the BPEL process. This is why using WebDAV repository has it's clear role as central place for business rule repository.


How to change file repository to WebDAV?

It is possible to replace the file based repository definition to use WebDAV based repository, with surgical operation on BPEL decision service deployment files.


0. Make a backup of the BPEL process you intend to modify.

1. Make sure you have the latest business rule repository imported in the WebDAV location. If you don't have that, you can just connect to WebDAV repository from the rule author application and press "Import" to import the file repository file as such. This will extract the file repository contents into WebDAV file structure. Do not copy the file repository "as is" into WebDAV folder as this will not work. You need to import it using rule author.


2. (Optional) Create an empty BPEL process and drag&drop a decision service to the process. Define a decision service to use the wanted WebDAV rules connection. Please note that this step is only done to get the needed XML fragment from decisionservices.decs -file.

<repository type="WebDAV">
    <password encrypted="true">dsIJkj9898dh</password>

3. Open up the actual BPEL process project. Navigate to the file system level to see the decision service deployment directory that was created behind the scenes the first time you defined the decision service using file based repository.


Look for decisionservices.xml under:

<BPEL process directory>\decisionservices\<servicename>\war\WEB-INF\classes


The file has the configuration info for the decision service, among others something like this:

<repository type="File">

Replace that with (extracted from an existing decisionservices.decs -file from step 2):

<repository type="WebDAV">
    <password encrypted="true">dsIJkj9898dh</password>

... and save.


What I did was also removed the rules repository from:

<BPEL process directory>\decisionservices\<servicename>\war\WEB-INF\repository

just to make sure the service is not using the file based rule repository any more.


4. Redeploy the BPEL process.

5. Test.

You should now be using the WebDAV based rules repository with your BPEL decision services.