Oracle SOA Suite 11g, Setting and Getting Preferences

In Oracle Bpel 10g we had the functionality to add preferences to your bpel process.
By adding the next xml to the bpel.xml file we could get the value as variable into our process and change the value from the console.

<preferences>
  <property name="myPref">MyCurrentValue</property>
</preferences>

In the new Oracle SOA 11g things changed a little but. Like Marc already described in his blog we now need to add the preferences to the composite.xml of our Composite Application.

Add the next xml to the composite.xml :

  <component name="BPELProcess1">
    <implementation.bpel src="BPELProcess1.bpel"/>
    <property name="bpel.preference.myPref">MyCurrentValue</property>
  </component>

Now we can use the function ora:getPreference(myPref) in our bpel process to retrieve the value of the preference.
Watch the naming convention. It expects it to start with “bpel.preference”.

Create the composite application and deploy it.
We only added an assign to the flow which will get assign the value of the preference to the outputVariable.
Run the bpel and check if the value of ‘MyCurrentValue’ is in the outputVariable.
current_value

In Oracle SOA Suite 10g we could change the value of the preferences from the bpel console.
In Oracle SOA Suite 11g things changed a but, we got a new fancy console to manage all the components.
To change to values from the prefences go to the ‘Enterprise Manager’ (http://localhost:7001/em).

On the left go to :
Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select ‘System MBean Browser’.
mbean
Navigate to Application Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > your_project > SCAComposite.SCAComponent > your bpel_process.
Select the Attribute ‘Properties’.
properties
Change the value of our preference and click apply.
preference

Run the bpel again to see if the new value got used in the process.
new_value

Advertisements

Oracle Service Bus, JMS Request/Response pattern

Inspired by the article of Edwin about JMS Request Reply Interaction Pattern in Soa Suite 11g, i will show a little example of what functionality Oracle Service Bus supplies to implement the jms request/response (reply) pattern.
The solution is quiet simple.

Create the wls resources

  • Create JMS Server, MyJMSServer
  • Create JMS Modules, MyJMSResources
  • Create a Connection Factory, MyConnectionFactory
  • Create 2 queues, MyQueueIn (request message), MyQueueOut (response message)

wls_resources

Create the osb resource

  • Create a new proxy service, JMSRequestResponsePS
  • ps_1
    ps_2
    For the Endpoint URi, insert the url to In-queue
    ps_3
    Check the ‘Is Response Required’ option.
    We will use JMSCorrelationID for the Response Correlation Pattern.
    For the Response URI, insert the url to the Out-queue
    ps_4

Testing
Now test the flow by insert a little xml message in the MyQueueIn queue, wait a few seconds and check the MyQueueOut queue.
Only thing what’s left is to fill in the message flow of the proxy service and add some logica.

Oracle Service Bus, transporting large files fails

Error

weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '20000160' bytes exceeds the configured maximum of: '20000000' bytes for protocol: 't3'.
weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '20000160' bytes exceeds the configured maximum of: '20000000' bytes for protocol: 't3'
        at weblogic.socket.AbstractMuxableSocket.incrementBufferOffset(AbstractMuxableSocket.java:262)
        at weblogic.rjvm.t3.MuxableSocketT3.incrementBufferOffset(MuxableSocketT3.java:343)
        at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:910)
        at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:859)
        at weblogic.socket.EPollSocketMuxer.dataReceived(EPollSocketMuxer.java:215)
        at weblogic.socket.EPollSocketMuxer.processSockets(EPollSocketMuxer.java:177)
        at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
        at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:11

Solution
Goto the Weblogic Console > Servers > AdminServer (or Managed Servers) > Protocols
Change the value of ‘Maximum Message Size’ to something which will succeed in your case.

Evaluating xpath expressions

This week we were messing around with a routing problem in one of the Oracle Service Bus projects.
We had an if-then-else construction which selects on the payload to see what transformation is needed and which business service it needs to call.

Example payload

<EDI>
  <CONF_UNB>
    <SYNTAX_ID>VALUE1</SYNTAX_ID>
    <SYNTAX_VERS>1</SYNTAX_VERS>
    <SENDER_ID>VALUE2</SENDER_ID>
    <SEND_QUAL>10</SEND_QUAL>
  </CONF_UNB>
</EDI>

test1 : /EDI/CONF_UNB/SYNTAX_ID
result : node SYNTAX_ID with value ‘VALUE1’

test2 : count(/EDI/CONF_UNB/SYNTAX_ID) = 1
result : xs:boolean = true

test3 : /EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’
result : xs:boolean = true

test4 : count(/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’)
result : xs:integer = 1
This is the approach we used, but looking at the result of test5, you will see it will always evaluate to true or 1 in this case.

test5 : count(/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE2’)
result : xs:integer = 1

test6 : count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE2’])
result : xs:integer = 0

test7 : count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE1’])
result : xs:integer = 1

So for evaluation the xpath expression without being it embedded in an xquery function you can just select the node and compair it with a textvalue (/EDI/CONF_UNB/SYNTAX_ID = ‘VALUE1’).
When you want to compair the xpath expression with a textvalue from within a call to a xquery function you need to select the text-value of the node to which you compair (count(/EDI/CONF_UNB/SYNTAX_ID[text() = ‘VALUE2’])).

Routing works again!