SOA Suite 12c: Using Domain Value Map (DVM) in Service Bus projects

Domain Value Maps are still DVMs in SOA Suite 12c. Create them in JDeveloper, use them in Transformations and Assignments in Mediator and BPEL. Inspect them and edit them at run time using SOA Composer. Nothing really new there.

What is new:

  • In 12c, we can use XQuery in BPEL and Mediator – and in these XQuery functions we can use Domain Value Map as well.
  • In 12c, we can use both XQuery and XSL Map in Service Bus – and here we can use Domain Value Maps as well
  • In 12c, we can inspect and edit Domain Value Maps also at runtime in the Service Bus Design Composer/Console
  • In 12c, we can create Domain Value Maps in Service Bus projects, publish them to the MDS Design Time Repository as well as import them into Service Bus projects from that repository

So as of now, in SOA Suite 12c we can leverage Domain Value Map from Service Bus components.

Lees verder

How to create an if-then-else expression (aka ternary operator) in an XPath 1.0 expression?

There are situations where I have to create an XPath expression that performs something like if-then-else logic (similar to a CASE or DECODE expression in SQL or a ternary operator in Java or JavaScript). Unfortunately, XPath 1.0 – a version still widely found – does not support the XPath 2.0 if-then-else logic. So something else is needed.

I encountered a great trick in a forum post; this post also referred to Becker’s Method. In short, the trick uses the fact that the numerical evaluation of (Boolean) true = 1 and of false = 0. It also makes use of the fact that substring( somestring, 1, 0) returns an empty string.

The abstract XPath expression used for

if C1 then R1 else R2

becomes

concat( substring( R1, 1,number (C1) * string-length(R1), substring( R2, 1, number(not(C1)) * string-length(R2)

when R1 and R2 are not of type string, then some type conversion to and from string are required.

An example of using this trick:

In a Mediator component I want to assign the value ‘LONG’ when the input string is longer than 6 characters. When the stringlength is 6 or less, then I want to assign the value not long.

With the ternary expression, this would be something like:

result = (input.length() > 6? ‘LONG’: ‘NOTLONG’)

The corresponding XPath expression is this:

concat(

  substring( ‘LONG’, 1, ( number(string-length($in.payload/client:process/client:input)  > 6)  * 4))

, substring( ‘NOTLONG’, 1, ( number(string-length($in.payload/client:process/client:input)   <=  6)  * 7))

)

image