Monday, 7 June 2010

Create Sensor and Sensor Actions in Jdeveloper 11.1.1.x

One small change between Jdeveloper 11.1.1.x and 10.1.3.x is different views for updating a bpel file vs setting up sensors for the same.

When we open the bpel file, there is a dropdown at the right side. Select Monitor to create or update sensor and sensor actions.


Sensor and Sensor Actions can be created in the Structure Pane.
Create a Variable Sensor “AuditMessage_Sensor”.


Then create a sensor action “PublishToAuditTopic” to publish the sensor data to the JMS topic “jms/db/AuditTopic”. This JMS topic has been previously configured on the weblogic server.



The Sensor action is configured in the following manner to publish the data to the JMS topic jms/db/AuditTopic.

Assign a bucketset to the output variable of a Business Rule Decision Function

To assign a bucket set to the input variable of a business rule decision function, we can do the same while creating the rule itself. But to assign a bucketset to the output variable, we need to update the fact of the output variable.
1. Open the rules designer
2. Click on Facts.
3. Select the output variable for which we need to assign a bucketset.
4. Click on Edit.
5. In the list of Bucketset, select the appropiate bucketset and click OK.

Now in the rule, in the Actions part, when we assert or modify the output variable message, we should get the bucketset as a dropdown.

How to replace urls and any other text in multiple files

Usually we encounter scenarios where we need to change urls or something else to ensure the composites work in other enviroments as well.
One easy way I managed to do this was by using notepad++. http://notepad-plus-plus.org/

It gives the capability of doing a "Find in files" and then we can replace anything requried at a any folder level.

JDeveloper hangs while using Expression Builder in Assign

Using the Expression Builder to build XPath expressions may cause Oracle JDeveloper to hang. If that happens, perform the following steps:
1. Kill the Oracle JDeveloper process.
2. Restart Oracle JDeveloper.
3. Select Tools > Preferences > SOA, and deselect the Validate Expression checkbox.
After performing these steps, Oracle JDeveloper should no longer hang.

Thursday, 20 May 2010

Replace endpoint URLs in SOA Composites before compilation

The configuration plan doesnot allow to change endpoint URLs in XSLT artifacts. We tried to hack the ant-sca-deploy and managed to use Ant tokens to replace endpoint URLs in all the files in the composite.
The ant-sca-package copies the composite to a tmp dir and then compiles it. In between this we use

<echo>About to find/replace the endpoint URLs in the Composite Package</echo>
<replace dir="${tmp.dir}" value="${server}:${port}">
<replacetoken>devServer:7001</replacetoken>
</replace>

Thus, the jar file created contains the endpoints of the target server which is now compiled and then deployed avoiding any issues with dependant partnerlinks and refernced schemas.

This is the snapshot of the ant-sca-package.xml file

<target depends="scac-validate" name="package">


<available property="compile.source" type="dir" file="${src.dir}">
<antcall target="compile-source">

<property name="tmp.dir" value="${compositeDir}/dist"></property>
<mkdir dir="${tmp.dir}">

<copy failonerror="false" todir="${tmp.dir}" includeemptydirs="false">
<fileset dir="${compositeDir}">
<exclude name="classes/**">
<exclude name="deploy/**">
<exclude name="dist/**">
<exclude name=".designer/**">
<exclude name="**/*.jpr">
<exclude name="**/*.ear">
<exclude name="**/*.zip">
<exclude name="**/*.war">
<exclude name="**/*.jws">
<exclude name="**/*.bin">
</fileset>
</copy>

<replaceregexp file="${tmp.dir}/composite.xml" replace="'revision=" match="revision=&quot;(.*)&quot;revision='(.*)'">

<copy failonerror="false" todir="${tmp.dir}/SCA-INF/classes">
<fileset dir="${compositeDir}/../.adf">
<include name="META-INF/**">
</fileset>
<fileset dir="${compositeDir}/../src">
<include name="META-INF/*">
</fileset>
</copy>

<echo>tmp.dir: ${tmp.dir}</echo>


<echo>About to find/replace the endpoint URLs in the Composite Package</echo>
<replace dir="${tmp.dir}" value="${server}:${port}">
<replacetoken>devServer:7001</replacetoken>
</replace>


<jar destfile="${deploy.composite.name}" basedir="${tmp.dir}">

<delete includeemptydirs="true" deleteonexit="true">
<fileset dir="${tmp.dir}" includes="*/**">
</delete>
<delete dir="${tmp.dir}">
</target>

<target name="compile-source" if="compile.source">
<echo message="deleting contents of ${sca-inf.classes.dir}">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${sca-inf.classes.dir}" includes="*/**">
</delete>
<mkdir dir="${sca-inf.classes.dir}">
<javac debug="true" destdir="${sca-inf.classes.dir}" classpathref="scac.tasks.class.path" srcdir="${src.dir}">
</javac>
</target>

Working with Transactions in Oracle SOA Suite

Some good blogs which talk about working with transactions in Oracle SOA Suite. http://www.oracle.com/technology/architect/soa-suite-series/wli-bpel-transactions.html http://blogs.oracle.com/soabpm/2009/08/soa_suite_11g_-_transactions_b.html

Invoking a Secured Webservice from a BPEL 11g process.

We can invoke a secured webservice from a bpel process by adding the binding properties in the composite.xml. Where as in BPEL 10g, we used to set it in the partnerlink‘s properties.
Invoking a web service which is secured with WSS Username Token
• Create a bpel process in 11g Jdeveloper
• Add a partner link and enter the wsdl location of the secured webservice
• Open the composite.xml from the Application Navigator
• Right click on the external reference service and select “Configure WS policies”
• Under the security tab, click add button and select “oracle/wss_username_token_client_policy”
• Now Open the property Inspector window and click the add button under “Binding properties” tab.
• Include the “oracle.webservices.auth.username” and “oracle.webservices.auth.password properties.