Context is an object model containing all data that may affect Decision tables’ or Functions’ values. Once we design a context model, we can make our parameterization depends on any data from the context.
Let’s use an example from the Introduction to Context section:
[ROOT] // root elements in context
- policy : Policy
- cover : Cover
[Policy] // Policy type definition
- policyNo : string
- productCode : string
- insured : Client
- covers : Cover[]
[Client] // definition of Client type
- firstname : string
- lastname : string
- address : Address
...
[Cover] // definition of Cover type
- code : string
- sumInsured : number
- basePremium : number
- startDate : date
- endDate : date
...
The above context definition introduces 3 types: Policy, Client, Cover.
These types have attributes (or fields) that have values.
For example, Policy type has 4 attributes:
policyNoof simple typestring(text) contains insurance policy numberproductCodeof simple typestringcontains insurance product’s codeinsuredof compound typeClientcontainsClientobject with all its fieldscoversis a collection ofCoverobjects
It is important to define some concepts here:
| Concept | Meaning |
|---|---|
| simple type | one of Higson built-in data types: string, integer, number, boolean, date, datetime |
| compound type | user-defined type in context (entity type) |
| attribute | a field in user-defined type, can be of simple type, compound type or a collection of compound type objects |
| multivalue | by selecting multi value checkbox we mark attribute as a collection of compound type objects |
In order to see Context, select Context in Main Toolbar.
After you enter Context you will see screen of all Types:
| No. | Column / Action name | Description |
|---|---|---|
| 1. | Name | Full type name. You can filter this column by providing any string. |
| 2. | Description | Full description of type. You can filter this column by providing any string. |
| 3. | Last update | The last modification date of the type. |
| 4. | Actions | List of quick access actions. Currently only Remove action (bin icon) is available here. Remove action deletes the desired type. To learn more about removing a specific Context Type, go here. |
| 5. | Download Types | Downloads a TXT file that contains all Types and Attributes of Types. To learn more about downloading Types, go here. |
| 6. | Upload Types | Allows uploading Types from a TXT file. To learn more about uploading Types, go here. |
| 7. | + New type | Allows creating new Types. To learn more about adding Types, go here go here. |
| 8. | Delete all types | Deletes all Context Types. |
Context - Add New Type#
If you want to add a new context type, follow these steps:
-
Choose Context in Main toolbar.
-
Choose + New type.
a. Choosing + New type opens a step-by-step Context Type wizard.
-
In step 1. Name you need to provide unique Type name. Name can contain only characters from collection a-z; 0-9; “-”; “_” and it can’t start with “-”.
a. If you enter illegal characters, then borders will be highlighted with red color. Hover on the field to see tooltip with more information.
-
Choose Next.
-
In step 2. Description you may add Type’s description. Description can contain only characters from collection a-z; A-Z; 0-9; “.”; “-”; “,”; “_” and white-space characters. This data is not
a. If you choose Previous you will go back to step 1. Name.
b. If you enter illegal characters, then borders will be highlighted with red color. Hover on the field to see tooltip with more information.
-
Choose Next.
-
In step 3. Attributes you may add/remove attributes. This data is not necessary to save a type.
a. If you decide to add attributes, you:
i. must provide unique name. Name can contain only characters from collection a-z; 0-9; “-”; “_”; and it can’t start with “-”;
ii. must select a type from a drop-down list.
iii. can check/uncheck multi value.
iv. can provide Attribute description. Description can contain only characters from collection a-z; A-Z; 0-9; “.”; “-”; “,”; “_” and white-space characters.
b. You can sort attributes by left-clicking on arrows next to each Column name.
c. If you enter illegal characters in name field for any attribute, then borders will be highlighted with red color, and you will not be able to save a type.
d. If you enter illegal characters in the description field for any attribute, then borders will be highlighted with red color, and you will not be able to save a type.
-
Choose Save.
a. Type with data you provided is created.
b. If in step 3. Attributes you entered the same name in at least two attributes, then validation error will appear.
Context - Remove Context Type#
If you want to remove a specific context type, follow these steps:
-
Choose Context in Main toolbar.
-
Choose Remove action (bin icon) for type you want to delete.
a. Action is greyed out for ROOT type.
b. After choosing Remove action, confirmation pop-up will appear.
-
Choose Delete.
a. Specific Type is being removed from the environment. This action is irreversible.
Context - Download Context#
If you want to download context, follow these steps:
-
Choose Context in Main toolbar.
-
Choose Download.
a. Choosing Download a TXT file that contains the whole Context.
Context - Upload Context#
If you want to upload context, follow these steps:
-
Choose Context in Main toolbar.
-
Choose Upload.
a. Choosing Upload brings up Import context screen.
-
Drag&drop desired file or Click to upload a file and choose file in File explorer.
a. If you choose a file with extension other than TXT, then validation error will pop up.
b. If there is something wrong with data in TXT file, then validation error will appear.
-
Choose Upload
-
When the progress bar reaches 100%, it means that context was uploaded correctly
a. If a validation error occurs (see above), then an upload process is being aborted.
Context - Delete All Types#
If you want to delete all types in context, follow these steps:
-
Choose Context in Main toolbar.
-
Choose Delete all types.
a. After choosing Delete all types button, confirmation pop-up will appear.
-
Choose Delete.
a. The Entire Context excluding ROOT is deleted from the environment.
Context Type Details Screen#
You can access Context Type details by left-clicking on the specific type in the screen of all Types.
An important difference in Context is that changes made in Types are instant, without session mechanism.
| No. | Name | Description |
|---|---|---|
| 1. | Type details section | Contains information such as: Type’s name and Type’s description. |
| 2. | Attributes section | Contains information about all attributes created in Type. |
| 3. | Name | Full attribute name. |
| 4. | Type | Data type used in the attribute. |
| 5. | Multi value | If multi-value is checked, then it allows providing a list of elements. If unchecked, then only single elements can be provided. |
| 6. | Description | Full description of the type. |
| 7. | Edit | Enables Edit mode for Type details section. To learn more about editing type details, go here. |
Context Type details - Edit Type Details#
If you want to edit data in a Type details section, follow these steps:
-
Choose Context in Main toolbar.
-
Left-click on a type you wish to edit.
a. Left-clicking on type opens Context Type details screen.
-
Choose Edit .
a. Highlighted borders indicate that edit mode is active.
-
Edit any data you need in Type Details section.
a. If you enter illegal characters in type’s name, then validation error will appear.
-
Edit any data you need in Attributes section.
-
Choose Save changes to save all changes made in context type.
a. Cancel reverts all changes made in context type.
b. If you change type’s name to name that is already used by another type, then validation error will appear.