Creating listener map
with map message payload
You can also create a listener map that uses a map message format. The map message payload will be comprised of name value pairs that have a type associated with them. If your enterprise application program uses map messages, you will want to add a map message format to the payloadlistener map messagelistener map. Unlike an XML format (which is always a String), specifying Map as the format will allow you to specify a data type for the variable such as integer, String, float, and so forth.
Follow these steps:
- On the Listener Map Definition Map window, click
the Listener down-arrow, and then
select the appropriate listener. The map message format
is only available for JMS-based listeners.
- Using the Input tab, create the
input map variables. The completed
Input tab might look like this:
The next step is to create the payload. You will associate the Input map variables with Property Name values.Arrays: You cannot use arrays with map message. Input and Output map variables must have a count of 1. The Transaction Server will not allow a transport map definition with Input and Output map variables with a count greater than one when the format is Map - Under the From Enterprise section, click
Add. Notice the
Format for this example is Map.
The New Item window appears.
The values from these parameters will appear in the map message:
Name — This parameter provides a list of the map variables from the Input tab. When the listener map is specified for use by the trigger, the map variable is associated with a PLC device variable or constant value.
Property — A name you specify as the property identifier.
DefaultValue — A value that will be used whenever the incoming request does not have a Property value specified. - Click Add.
The information is added under the From Enterprise section. - Repeat steps 4 through 5 for the remaining map variable. For this example, LocalCount. Set Property as Count. For this example, no default value is set.
Output tab
The next step is to use the Output
tab.
- From the Output tab, under
From Trigger, click
Add.
The New Item window appears. - Type a name for the output map variable, select
INT2 as the type, and accept the count as one.
- Click Add.
The map variable is added under the From Trigger section. - Repeat steps 7 through 9 as appropriate for the
second output map variable.
A row is inserted under the second row. The completed Output tab might look like this: - Under the To Enterprise section,
click the Format down-arrow, and then
select Map.
- Click Add.
The first row in the table becomes active. - Under Field, click the column to
display a drop-down list, and then select the
appropriate map variable (for this example,
replyCount).
- Set the data type as an integer and type
ReplyCount for Property
Name.
- Repeat steps 12 through 14 for the remaining map
variable (for this example,
replyProject).
- Accept the default value of String for the
Details column and type
ReplyProject for Property
Name.
A row is inserted under the second row. The completed To Enterprise section might look like this: - Click Validate.
- A message will indicate whether or not the listener
map definition is correct. Click
OK.
- Click Save.
The name of the listener map is added to the Listener Maps tab.