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:

  1. 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.
  2. 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
  3. 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.
  4. Click Add.
    The information is added under the From Enterprise section.
  5. 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.

  1. From the Output tab, under From Trigger, click Add.
    The New Item window appears.
  2. Type a name for the output map variable, select INT2 as the type, and accept the count as one.
  3. Click Add.
    The map variable is added under the From Trigger section.
  4. 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:
  5. Under the To Enterprise section, click the Format down-arrow, and then select Map.
  6. Click Add.
    The first row in the table becomes active.
  7. Under Field, click the column to display a drop-down list, and then select the appropriate map variable (for this example, replyCount).
  8. Set the data type as an integer and type ReplyCount for Property Name.
  9. Repeat steps 12 through 14 for the remaining map variable (for this example, replyProject).
  10. 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:
  11. Click Validate.
  12. A message will indicate whether or not the listener map definition is correct. Click OK.
  13. Click Save.

The name of the listener map is added to the Listener Maps tab.