The Device Access module provides usage of scripting in the defined mappings. On Scripting Developer Guide page there is detailed information about Scripting and how to use it. The Device Item Mapping allows to use the scripting syntax for the Device Item properties, Device Item operation parameters, etc. The supported language is JavaScript language. The script expression is found as content on the XML attribute "script". The Device Item Mapping defines custom scripting syntax for accessing the following variables:
Source Device Item property value.Target Device Item property value.Target Device Item operation.For example:
com.prosyst.mbs.services.units.Quantity. The result of this #{targetValue.unit} is com.prosyst.mbs.services.units.Unit of the Quantity. So the execution of this script invokes the convert method of the Unit class and converts the given value #{targetValue.value} to the other Unit. The result is divided by 2.