JsonDemuxRouter (Json Dmux Router)

Unlike the JsonMessageRouter, which forwards the whole JSON payload to the added slots intact, this component passes a selected part of the message to the added slots. It is a very basic method of selecting data of interest, and likely will become inefficient to use when faced with a large payload and chained routers. An approach with far more features is JSON Path.

The added slots must match the key name and should be either Boolean, numeric or string to match the JSON value.

Figure 78.   JsonDemuxRouter 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 JsonDemuxRouter.

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.
Default Missing true (default) or false Can set a dynamic slot’s value to its default if the value is missing.

true sets the value to its default if the inbound JSON message did not include a value for the slot.

false ignores setting the default value.

Actions

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

Figure 79.   JsonDemuxRouter 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.