In this post, you will learn to use Domain Value Maps (DVM) in message flow.
We consider the business requirement of performing Address Validation in message flow based on a configurable property and we use DVM to store this Configurable Property.
Creating Domain Value Map (DVM)
Create a new folder named DVM in XYZCustomer project. Right click DVM folder and select New -> Domain Value Map.
Give Config as File Name and give DVM entries as shown below. The domain name PropertyName represents Configurable Properties and the domain PropertyValue represents configurable property values respectively.
Using this DVM, you can extend the same logic to any number of configurable properties in your Service Bus Application. For our requirement, give property name as ValidateAddress and set it’s initial value as Y.
Click OK to bring up DVM editor.
You can use JDeveloper to modify DVM or you can also modify it in sbconsole. Remember you need to create a session before modifying anything.
Using DVM in Message Flow
Drag Stage node into Stages placeholder of Request Pipeline and set name as AddrValidation in Properties tab.
Drag Assign activity into AddrValidation stage from Message Processing. Bring up expression builder for Value property and give expression as shown below. Alternatively you can select the function from Functions -> Custom XPath Functions -> Dvm functions. Make sure that you give complete qualified path of DVM containing Service Bus Project name too.
Set Variable property as ConfigVar. Now your Properties tab should look like below.
Address Validation business service should be invoked only when the value of this configuration property ‘Y’. So drag If Then activity into AddrValidation stage after Assign from Flow Control and set condition as $ConfigVar=’Y’.
Service Bus provides Service Callout, Routing and Publish activities to route incoming request to an appropriate business service. Routing and Service Callout are used for Synchronous where as Publish activity is used for one-way communication.
Routing node always depicts end of message flow so you can’t place any activities after Routing node. Hence use Service Callout for all intermediate service calls in pipeline. Drag Service Callout from Communication into If Then branch as shown below.
In Properties tab, browse and select AddrValidationServiceBS for Service property.
Hi Siva,
I have a doubt regarding DynamicSplitJoint and ForEach,Both components help us to achieve the same thing.Can you help me in understanding DynamicSplitJoint over ForEach
Regards,
Abhi
Hi siva i am also getting null pointer exception while trying to access dvm i am using lookup value function as {dvm:lookupValue(‘Payment/Transformations/error_servererror.dvm’,’errorcodes’,’OSB-380001′, ‘errordescription’,
‘error not captured please view log for detail’)}
and i have kept dvm im transformation folder.
Is Payment your OSB project name..and did you try just dvm name in function without appending .dvm extension.
pls find the below exception continues to above post
Caused by: java.lang.NullPointerException
at com.bea.wli.sb.functions.dvm.DVMFunctions.stripDvmExtension(DVMFunctions.java:125)
at com.bea.wli.sb.functions.dvm.DVMFunctions.lookupValue(DVMFunctions.java:41)
ANy special characters you are using dvm..and how are you giving path in dvm function
hi Siva I am getting an exception like java NULL Pointer exception. when i am executing dvm