Introduction
Prioritization algorithms are available within the process engine so tasks can be sorted in the work list. The value resulting of the algorithm will be stored in the process engine database. The element will be connected to an external source.
Element
The studio priority algorithm element looks as follows:
We differentiate internal from external priority algorithms.
Internal priority algorithms
Internal priority algorithms are part of the core product. The following internal priority algorithm is available:
CustomFieldPriority
The Custom Field Priority Algorithm can be used to define the priority of a task based on an expression. The expression that is to be used is added to the model of a task as the value of a custom field with the name Priority
. When a task based on the model is created, the expression is evaluated. The resulting value is used as the priority value for that task. No re-evaluation of the expression is available - expressions will be evaluated on creation only.
Note that custom fields store text-based values only. Make sure that the custom field value is a text value that is a representation of an integer value, for example by using the TEXT function: TEXT(MyEntity.NumericPriority)
To use this algorithm, create a priority algorithm in studio and give it the name 'CustomFieldPriority'.
External priority algorithms
External algorithms are developed as a customization of the product. You can find information on how to implement such an algorithm here: 10. APIs for authorization, routing and priority.
Re-evaluation
Re-evaluation take two parameter:
- Reevaluation time indicates how often the value for prioritization is reevaluated.
- Reevaluation event indicates whether the algorithm should re-evaluate the priority if a value in the domain has changed.
On domain change
also evaluates when the task is created.
Customize re-evaluation
The priority algorithm re-evaluation can be done every:
- WEEK,
- DAY,
- HOUR,
- MINUTE
- or NEVER.
It is also possible to customize the priority re-evaluation by specifying the start date-time of the first evaluation of the priority algorithm.
Start Time
In studio a new field is introduced in the Priority Algorithm studio model. This is a date time expression field, which is evaluated by the Runtime. In case the reevaluation time is 'NEVER', this field will be disabled.
Evaluation Rules
The Runtime evaluates the expression modeled in Studio and sets the start date-time of the priority job first evaluation. A few situations exist concerning reevalution:
- If the evaluation results in a date in the future, the priority algorithm reevaluation will start in the future at that exact modeled time.
- If the start time evaluation results in either a date in the past or it was not modeled at all, the following rules will apply:
- If start time was not modeled in studio, the Runtime evaluates the expression to the current date (This is due to backwards compatibility).
- If start time is in the past at Runtime evaluation and:
- Reevaluation time is a 'WEEK': priority algorithm start date is set to current date plus 7 days, with the same time from Start time.
- Reevaluation time is a 'DAY': priority algorithm start date is set to current date, with the same time from Start time.
- Reevaluation time is an 'HOUR': priority algorithm start date is set to current date, current hour, with the same minute and second from Start time.
- Reevaluation time is a 'MINUTE': priority algorithm start date is set to current date, current hour and minute, with the same second from Start time.