Map Input Data
To define input mapping, click Inputs Mapping, and enter or select the appropriate information for the following fields:
Field
|
Description
|
Source Type
|
The type of entity to map data from. This can be an event, thing, thing template, or thing shape.
|
Source
|
The actual source instance, if the source type is thing, thing shape, or thing template.
|
Properties to be Mapped
|
The left tree panel that lists the properties of the selected source or event to map data from.
|
Input Data Shape
|
The right tree panel that lists the selected analysis model input data shape to which the source properties are mapped.
|
Source for Mapping
Every event in ThingWorx has an associated data structure and when the event is triggered, this data structure is populated and sent with the event. When the Event source type is selected, the system locates the data structure associated with the event and shows it in tree form on the Properties to be Mapped panel as source. The format of the data is attribute name[Data type]=Default value. The default value is shown only if applicable.
If the source type Thing is selected, a thing can be browsed and selected as source of the inputs. If the analysis event has a thing as the source of the event, it is pre-selected. The properties of the selected thing are listed in tree form on the Properties to be Mapped panel. Mappings can be defined from multiple things to a single analysis job.
The Thing Template or Thing Shape option is available only when the analysis event has either a thing template or thing shape as the source. The name of the source is pre-selected. The properties of the template or shape are listed in tree form on the Properties to be Mapped panel.
Target for Mapping
The Input Data Shape panel contains the input data structure displayed as the receiver of the mapping. The format of the data is attribute name[Data type]=Default value. The default value is shown only if applicable. The data structure is derived from the input data structure associated to the model which is the target for the selected analysis trigger.
Fields Mapping
If a given field is not mapped, the system sends the default value for that field to the analysis job.
|
The inputTimestamp field of the input data shape is reserved. If the analysis model has this field in the input data shape, it is not available for mapping. For every analysis job, the agent automatically receives the input timestamp, and it specifies the time at which the event occurs.
|
To map a property and an input data shape, complete the following steps:
1. Select a source property from the Properties to be Mapped list and a field from the Input Data Shape list.
2. Click Map to map the input.
|
Only those fields with matching base types can be mapped.
|
3. Alternatively, click Map All to map all properties to the input data shape.
|
Under the Properties to be Mapped or Input Data Shape section or both, select an infotable (if available), and click Map All to map all rows of the infotable.
|
Only those properties that fulfill the following conditions are mapped:
◦ The name of the property to be mapped to a field of the input data shape is case-sensitive.
◦ The property name must match the name of the field of the input data shape, or the property name must be the same as the field name of the input data shape prefixed by ‘ia_’.
So, field ‘a’ of an input data shape can be mapped to a property name, ‘a’ or ‘ia_a’, defined on the thing.
If you want to map property names with a different prefix, you can use the
CreateAutoMappingFromEvent service or the
CreateAutoMappingFromEntity service. For more information, see
Managing Data Mapping.
◦ The base type of the property to be mapped must match the base type of the field of the input data shape.
4. Repeat steps 1 and 2 to map the remaining properties.
A single property can be mapped to only one field of an input data shape. If you want to map a different property, you must remove the mapping. To remove the mapping, complete the following steps:
1. Select the field of the input data shape that has been mapped from the Input Data Shape list.
2. Click Remove to remove the mapping.