Reflection and the Model Schema
The data schema for every scenario in the app is represented by the model schema and model entity objects.
var view = insight.getView(); var app = view.getApp(); var schema = app.getModelSchema(); var myarray = schema.getEntity(‘myarray’);
There are three entity types supported by
Xpress Insight. These are:
- Scalars: Single data items.
- Sets: A single dimension collection of unordered data items.
- Arrays: A single or multi-dimensional associative array of data items where the possible index values for a given dimension of the array are represented by a set entity.
Each scalar, set, and array entity has a further type for the data value or values residing in the entity. The main value types are BOOLEAN, INTEGER, REAL, STRING, DECISION_VARIABLE and CONSTRAINT. Xpress Insight adds several more value types (VARIABLE_TYPE, CONSTRAINT_TYPE, MODEL, and PROBLEM_STATUS) to represent the augmented data it collects. Parameters are represented as an array(string) of strings.
The union of entity and data types is enumerated by the insight.enums.DataType namespace.
The type of an entity is returned by getType. For scalar entities, this returns a value type. For set entities, this returns SET. For array entities this returns ARRAY. In both cases, the value type of the entity can be queried with getElementType.