It is possible to access JMS application properties in BusinessWorks while sending or receiving JMS messages.
This article explains how to define a set of JMS application properties and how to use it in common JMS activities.
In fact there are two approaches to do this, one is to use Dynamic Properties and the other is to use a JMS application properties schema.
The first approach, use of Dynamic Properties is to be preferred while it is more simple to use. This approach was not available in early releases of BusinessWorks.
# USING DYNAMIC PROPERTIES
# Use of Dynamic properties in JMS Send Message activity
. In the Input tab and in the ‘DynamicProperties’ structure map the properties as needed
For reference elements about Dynamic Properties you can refer to the BusinessWorks documentation (check the ‘Input’ section):
https://docs.tibco.com/pub/activematrix_businessworks/6.10.0/doc/html/Default.htm
# Use of Dynamic properties in JMS Receive Message activity
The properties are available in the output of the activity.
Dynamic Properties in the output of the JMS Receive activity
To read values of Dynamic properties you have use xpath code like this:
$JMSReceiveMessage/DynamicProperties/ns:property[ns:name=”MyProp1"]/ns:value
Using a Dynamic Property in a mapping
# USING A JMS APPLICATION PROPERTIES SCHEMA
# Definition of a set of JMS application properties
. Right click on the Schema folder of the application and select ‘JMS Application Properties’
Create a schema to manage the application properties
. Enter the name of the schema and the name of the Root Type and click Finish
Enter the name of the schema and the root type name
. Edit the XML schema according to your needs
Edit the XML Schema
Note that as per the JMS specification, JMS application properties must be any of the following Java types: boolean, byte, short, char, long, int, float, double, string, or byte[].
Once the JMS application properties schema has been defined you can use it in the JMS palette activities.
# Use of JMS application properties in JMS Send Message activity
. In the Advanced tab select the JMS Application properties schema to be used:
Select the JMS Application Properties schema to use
. Then in the Input tab in the ‘OtherProperties’ structure map the properties as needed
Map the JMS application properties as needed
# Use of JMS application properties in JMS Receive Message activity
. In the Advanced tab select the JMS Application properties schema to be used :
Select the JMS Application Properties schema to use
. The JMS Application Properties are now available in the output of the activity
JMS application properties are available in the output of the activity
Useful elements
Example of an XML schema defining JMS application properties :
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://com.tibco.bw.plugin.jms.properties.MyJMSApplicationProperties" xmlns:tns="http://com.tibco.bw.plugin.jms.properties.MyJMSApplicationProperties" elementFormDefault="qualified">
<complexType name="jmsAppPropType">
<sequence>
<element name="name" type="string"/>
<element name="gender" type="string"/>
<element name="age" type="int"/>
</sequence>
</complexType>
</schema>
Additional elements
You can refer to the attached sample project.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now