You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

What is REM?


To answer this question, we need to provide some theory first.

Thesis 1


In SimpleOne, you can handle with data which is represented as records in tables that have a specified attribute set. Records appear in tables and they have these attribute values given.

Thesis 2


Every table has its own data model stipulated by the business-logic. The data model is represented by the column set (their amount, types, links with another system objects, and so on). This data model can be extended with child table with the same attribute set as a parent one, and an individual attributes inaccessible from the parent table, as an addition.

Attributes extension circuit diagram

Conclusion


To manage the commonalous entities (like ITSM Tasks), we can create a table with appropriate column set and extend from it for Incidents, Change Requests, Problems, and so on, creating respective tables that inherit attributes (columns) from a parent one and besides have their own attributes. For example, attribute overlap in there may be 70%, and unique attributes will be 30% of the total.

In this case, this model works fine (when we do not have many child tables, and the attribute overlap is high). But when the child table number increases, and the attribute overlap decreases, the management of this data model becomes a challenge. A Request Catalog can be taken as an example of such a table (a parent table for the catalog and a record in the table for every request template with specific attributes).

To deal with this issue, another concept has been created and implemented - Record Extended Model.

REM Concept


In this concept, extension concept can be applied for a specified table record giving some featured attributes to it.

Physically, extension model are stored as records of the Models (sys_re_models) table, and they intended to collect specific attributes extending records. Attributes are stored as records of the Attributes (sys_re_attribute) table (extending the Columns (sys_db_column) table).

When a record extension model is applied to a record, it means that an auxiliary record set is created for this record containing information about specific attribute values. So the record has attributes inherited from a table, and in addition, it has attributes sourced from the extension model.

Configuring extension models


Generally, to configure your extension model, you need to:

  1. Create an extension model.
  2. Create attributes (and link it to the model).
  3. (optional) Configure an attribute collection.
  4. Configure RE client script if needed.

Creating models


To create a model, please complete the steps below:

  1. Navigate to Record Extended Model → Models.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Record extended model form fields

FieldMandatoryDescription
NameYThe model name. 
TitleYThe model title. Can be specified in a language other than English.
DescriptionNThe model description. 
TableY

Reference to a table affected by the model.

Please note that you cannot specify a read-only table. To use such a table, please turn off this attribute first.

ActiveNSelect this checkbox to make the model active or inactive.
IconNReduced image intended for the model identification.
After insert scriptNSpecify a script that should be executed after a record is created. Develop it using JavaScript extended by the SimpleOne Server-Side API and Client-Side API methods.
Related lists
AttributeList of the RE attributes linked to this model.
Model client scriptList of the RE client scripts linked to this model.
Model form elementList of the RE model form element linked to this model.

Configuring attributes


To create an attribute, please complete the steps below:

  1. Navigate to Record Extended Model → Attributes.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Attribute form fields

FieldMandatoryDescription
RE modelYReference to a previously created model.
Column typeYSpecify a column type. 
TitleYAn attribute title. Can be specified in a language other than English. Latin, Cyrillic letters, [0..9] numbers and the underscore symbol ( _ ) are allowed.
Column nameYA column system name. Latin letters, [0..9] numbers and the underscore symbol ( _ ) are allowed.
Map to ColumnN

Specify a target field to map the attribute value after the record is created. This option allows nimble transferring of the attribute values to fields.


Please note that if the target field is mandatory, then the value is saved before it is processed by server validation engine.

Also, if the target field is mandatory, it should be not displayed on the form, otherwise the client validation engine may hamper the record saving.

CommentsNPut here some comments describing your attribute.
ActiveNSelect this checkbox to make the attribute active or inactive.
Read onlyNSelect this checkbox to make the field adding by this attribute read-only.
MandatoryNSelect this checkbox to make the field adding by this attribute mandatory.
Full text searchNSelect this checkbox to make the field adding by this attribute indexable.
Display by refNSelect this checkbox to make the field adding by this attribute display its displayValue instead of a value (see the Display by ref description for more information)
UniqueNSelect this checkbox to make the field adding by this attribute unique.
Type Specification tab
Max LengthN(For the columns that have a String or Text type) Specify a maximum value length for this column. The value length cannot exceed allowable length for the specified data type.
Default value tab
Default valueN

Specify a default value that will be populated to the field when creating a new record. This field may be specified by a Javascript scenario as well.

Use dynamic defaultNSelect this checkbox if you want to generate the default value dynamically.
Dynamic defaultN

This field appears only when the Use dynamic default attribute is set to TRUE. Select the script from the Dynamic Default Values (sys_default_value_dynamic) dictionary, so its execution result will be automatically calculated and entered into this field; this value will be the default value for the column specified.

  1. The script must be preliminary created in the Dynamic Default Values (sys_default_value_dynamic) dictionary; otherwise, you will be not able to choose it.
  2. You can choose only active scripts (the Active attribute is equal to Yes).


Configuring attribute collections


Attribute collections are implemented for using Many-to-Many Relationships so they allow reusing the same attributes in various models instead of adding them in every model where necessary.

A simplified usage concept is:

  1. Create a collection record as described below
  2. Fill it with previously created attributes or create new ones using the Attributes related list.
  3. Relate this collection with previously created models using the Used in Models related list.

After that, all attributes contained in this collection are used by all models this collection related with.

To create a collection, please complete the steps below:

  1. Navigate to Record Extended Model → Collections.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Collection form field

FieldMandatoryDescription
TitleYSpecify a collection title.
ActiveNSelect this checkbox to make the collection active or inactive.
Related lists
AttributesOn this related list, you can create a new attribute related to this collection or select an existing one from dictionary.
Form ElementsOn this related list, you can create a new form element related to this collection or select an existing one from dictionary.
Used in ModelOn this related list, you can create a new model related to this collection or select an existing one from dictionary.
Client ScriptsOn this related list, you can create a new model client script related to this collection or select an existing one from dictionary.


Configuring model client scripts


To create a record extended model client script, please complete the steps below:

  1. Navigate to Record Extended Model → Model Client Scripts.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Model client script form fields

FieldMandatoryDescription
NameYClient script name.
RE modelYReference to a previously created model.
TableYReference to a table affected by a model.
TypeY

The script type:

  • onLoad – it starts when the system displays the form for the first time before users will enter data. Generally, onLoad scripts perform manipulations on the client-side with the current form or set default record values;
  • onChange – it starts when the specified field in the form is changed;
  • onSubmit – this client-side script can cancel form submitting by returning false;
  • onCellEdit - this client-side script starts at the moment when some cell is to edit.
    • oldvalue - the old value for the cell that was edited;
    • newValue - the new value for the cell that was edited;
    • table - the table name of the cell being edited (for example, sys_db_table); 
    • sysId - the ID of the record relevant to the cell being edited;
    • callback - if this variable is equated to FALSE, then subsequent scripts will not run; otherwise, they will execute.
RE attributeNReference to a previously created model attribute. This field is mandatory.
DescriptionNClient script description.
ActiveNSelect this checkbox to make the script active or inactive.
OrderNClient script execution order. Scripts are executed in ascending order.
ScriptNSpecify a client script. Develop it using JavaScript extended by SimpleOne Client-Side API methods (the SimpleForm class). 

  • No labels