Sunday, November 23, 2008

How to get the name of an ESB instance in transformation

A new XPath function was added in Oracle 10.1.3.3 to get instance IDs. If you are running an older version you have to upgrade to get this working. One note of caution is, after making the edits to your xslt, the designer view will not work. This is a limitation of jDeveloper.
Here is an example on how to get the instance id in the transformation.

1. Define a simple ESB project and define a simple File Adapter.
2. Perform a transformation in the routing service.
3 Perform the following steps to get the instance ID:

a. Go to Design View.
b. Select Advanced Functions in the Component Palette.
c. Select xpath-expression and drag it to the middle column.
d. Double-click the function icon.
e. Enter ehdr:getInstanceID() in the XPath Expression field.
f. Click OK

4. Click Yes when prompted with a warning.
5. Map the function to the InstanceID element and save the project.
6. Return to the routing service where the XSL transformation activity is defined.
7. Double-click the routing service.
8. Expand the Properties section and add the following property:
Map the function to the InstanceID element and save the project.
6. Return to the routing service where the XSL transformation activity is defined.
7. Double-click the routing service.
8. Expand the Properties section and add the following property:(Note this property is case sensitive.)
enableAccessBusinessEvent=true

9. Save and deploy the project.

No comments: