Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

Counter limiters

Counter limiters allow using single counter for several situations or allow only some counter values according to other conditions.

Limiters are used only by front-end application, not by back-end (at least their usage by back-end does not have support from framework).

Example:

{  "name":"defLifeCycle",  "fields": [
   {"name":"proposed","short":"PR",
      "systemObject":"=['tskInfItem', 'tskObligation', 'tskPolicy'].includes(obj.myObjName)" },
   . . . 
} 

Part of the counter Default life cycle with single field show usage of the limiter: Limiter is a definition of the attributes, that is evaluated during the system run and only these fields from the counter, that fulfil the condition, are valid and could be used.

Limiters should be defined for object fields, that uses the counter and apply the limiter. For hereinbefore mentioned example, the related object field definition is:

‘ ‘ ‘ json
"lifecycleStatus":{
"type":"enum",
"enum":"tsk/defLifeCycle",
"enumLimit":"systemObject",
"default":"UN"
}


The field _enumLimit_ says, which field in the counter fields is used to check the field validity.

## Simple usage
In the simplest example, values in the fields contain only true / false values and the limiter in the field definition defines value used to check fields.

__Example:__

```json
{  "name":"itemIcons", "type":"icon", "fields": [
   {"icon":"improvement", "action":false, "infItem":true, "area":true},
   {"icon":"company",  "action":false, "infItem":true, "area":true},

The example presents part of the counter with icons. Each field contain names where the icon is offered for selection. Counter is used for selection using the following definition:

"icon": { 
   "order":"I", 
   "type":"optEnum",
   "enum":"tsk/itemIcons", 
   "enumLimit":"action"
}

Example is an attribute in the definition of the detail view for action. It says that user can select item from the counter tsk/itemIcons but only those that has filed action = true.

Sophisticated usage of the counter limiters

Counter limiter might be defined methods or even recursively evaluated methods that are applied when fields are selected.

  • Field enumLimit in the attrib.ute definition could contain method evaluated before user selects the counter field. It can limit the available fields according to the current status of the object. E.g. it can allow only forward-direction of the status change (only next states are allowed to select, not backward states.)
  • Field in the counter can contain method (see the first example). The method is evaluated upon the object for which the counter is used.

Using limiter for value selection

Limiter can be also used when used select a value during the orchestrated script execution.

{
   "a":"window.selectFromEnum
      (msg=qSelAggreeStatus,
      enum=tsk/defLifeCycle,
      retValName=newAgree)",
   "attrs":[ 
      {
         "name":"enumLimit", 
         "value":"='=attr.systemObject.includes( `tskActivityRec`)'"
      } 
   ]
}

Defines the request to select value from counter (from the 1st example). Value of the limiter ":"='=attr.systemObject.includes( tskActivityRec)' is evaluated twice

  • At first when accepted by the function as the limiter. The first evaluation “removes” envelope and prepare internal condition for evaluation for each field

=attr.systemObject.includes( tskActivityRec)'.

The condition is evaluated and selects only those fields that have defined attribute systemObject and the attributes contains _ tskActivityRec_ value.