Using Virtual Mappings within Cloud242

//Using Virtual Mappings within Cloud242

Using Virtual Mappings within Cloud242

Virtual Mapping is a technique within Cloud242 that allows an object to define its own data generation process. For example, an object could create the total of all its children or pull data from an external source via a REST api.

Creating a Script

A virtual mapping script provides a number of input variables that can be used to extract the correct data from a source:

Field Name Description
currentObject This is the current object being referenced by the script. It can be used as a source for finding children/parents/types etc. It is an InsightObject type.
dataFieldName The String name of the data field from the main object’s data store. e.g. interval or consumption
dateStart Data query range – start. Is a joda DateTime type object.
dateEnd Data query range – end. Is a joda DateTime type object.
dataSet This is the InsightDataSet that will be returned from the script. It will be a created data set from the script.

Functions within VM Script

To automatically build a data set from child objects (including other virtual mapped objects) the following function should be used in the VM script:

cloud242.addCompatibleChildrenToDataSet ( currentObject, dataSet, dateStart, dateEnd );
By | 2017-06-24T10:55:52+00:00 October 11th, 2016|cloud242|0 Comments