JsonMessageRouter (Json Message Router)

This component transfers inbound messages to an onward component that is suitable for processing or handling the message.

This allows the cloud (or other external system) target to assign it’s own identifier or primary key to export-marked points in the station, which can be used to locate them in future or included in exports to that cloud system.

Figure 76.   JsonMessageRouter properties
Image

You add this router to a station by expanding the Inbound > Routers in the palette and dragging this component to the Config folder in the Nav tree.

In addition to the standard property (Enabled), these properties support the JsonMessageRouter.

Property Value Description
Last Result read-only Reports the results of the alarm acknowledgment to allow for logging or post-processing activity. Example output:

Unable to find messagge key:

Problem parsing messageType

Last Result Time read-only Reports when the handler ran last.
Last Input read-only Reports the last message routed to a component.
Status read-only Reflects the current status of the component.

Ok indicates the JSON processed successfully.

fault indicates the JSON did not process for any reason, such as invalid JSON or missing expected values in the JSON.

Learn Mode true or false (default) true configures the JSON to add a dynamic slot on input for any newly-found message key.
Key text (defaults to messageType) Defines which part of the incoming message to switch on)
Resend With Blank true or false (default) Turns on and off the resending of a message if a duplicate or matching message is received.

true causes the router to send an empty string to the target slot, then resend the output.

Without injecting an empty message, the link does not propagate the change, which could be an issue if the handler needed other values in place to respond to this message.

false does not send the empty string to the target slot, which does not resend the output.

Actions

These actions are available when you right-click on the JsonMessageRouter.

Figure 77.   JsonMessageRouter action buttons
Image
  • Route causes this component to process the String parameter and update the Out slot.
  • Run Last Input executes the last input again.
  • Clear Output sets the Out slot of this component to an empty string.
  • Add Slot creates a new slot that appears as a row on the slot sheet.