Version 1.9.1.08 Changes
Last updated
Last updated
Please review SapProperty Routers in the manual to fully understand how they work and the changes to how they work described below. A thorough understanding of SapProperty Routers is expected to understand these changes.
This is very much a beta feature so report any problems that you may encounter.
This version adds additional translators that may be used at either the Source and/or Destination level to add more specific customization to the value as it transitions through a Source to Destination route in a SapProperty Router. For example if the SapProperty router's sources were Gpios, and the destinations were rest API commands, the translation might look something like:
In this case we have made the translation as described in the manual for SapProperty routers. Every source to destination route in the router will use this same translation. But what if the rest API message required including an id (perhaps a Guid) for the original source? In that situation we need to change the translated message differently for each source the trigger originated on. To do this we have added an additional translation at the source and destination level. For example, instead of clicking on the translation button in the Sap Property main points tab, click edit on the source or destination in that tab.
A new Translation button now exists when editing an existing source or destination. The source must exist in the router before this button will exist. And there must be at least one source and destination in the router before it will be available. Clicking on that translation button will bring up the normal translation dialog and allow you to configure a source or destination specific translation list. The three translation points (Source, Router, and Destination) funnel into each other. For example:
Source | Router | Destination | Result |
l=PUT /MyPath/src1/* | *=* | *=* | PUT /MyPath/src1/l |
*=* | l=PUT /MyPath/* | *=* | l=PUT /MyPath/l |
*=* | *=* | PUT /MyPath/dst1/* | PUT /MyPath/dst1/l |
l=src1/* | *=PUT /MyPath/*/CMD | *=*/DestData | PUT /MyPath/src1/l/CMD/DestData |
In the first example we are defining the translation in the source and passing the output value from the source through to whatever destinations the source is routed to. This requires setting up a translation in each and every source in the router. This allows source specific data to be built into the output value.
The second example does the translation at the router level. This is how Sap Property routers have worked prior to this version and how existing routers will continue to work unless modified. The advantage of setting up the translation at the router level is that you can define it once and it applies to all sources and destinations. But that does not easily allow for modifying the translation differently per source or destination.
The third example passes the value from source through to the destinations which defines the translation to create the final output. This allows destination specific data to be included in the end result.
In the last example changes are made at each stage in a kind of pipeline. The source's "l" becomes "src1/l", and then that becomes the value of * in the router translation, and the output of that translation becomes the value for * in the Destination translation. This allows for translations to be changed at each stage of the process.
In most cases you will be choosing to do the translation at the Source, Router, or Destination level and leaving the other translations as *=*. But sometimes it can be useful to chain the translations together to build more complex output messages.
When editing the translation on an IO, there is the same Destination Clear Value field as is present in the router translation. In the source, this field will have no effect and in fact should probably be hidden in future versions. In the destination, by default is will be set to <DefinedByRouter>. This means that the clear value when the destination is cleared will be defined by the router translation. This can be overridden to customize the clear value on a per destination basis if needed.
In order to improve the diagnosis of translations especially when chaining as described above, each SapProperty Destination now has a DestinationBeingSent property. This will momentarily spit out the final value change Sap message that gets sent via the destination each time a routed source value changes. So for example using the API on port 9600:
This subscription will subscribe to any value changes being sent such that you can see the results of the translations.