ClassificationService
Classifications are meant to classify business objects. Taskana uses them to classify tasks and task attachments (e.g. documents), but the classifications can be used to classify more kind of objects.
Classifications are defined by:
- KEY
- DOMAIN
- TYPE
- CATEGORY
- SERVICE_LEVEL
- PRIORITY
SERVICE_LEVEL and Priority details
The SERVICE_LEVEL of a classification is a duration, specified in ISO-8601 format. ISO-8601 format looks like "PnDTmHoMr.sS" where n is the number of days, m is then number of hours, o is the number of minutes and r.s is the number of seconds. However, Taskana supports only full days specified in the format "PnD" where n is the number of days. As an example, P5D means 5 days. Taskana interprets these days as working days. "P4D" therefore means 4 working days. If an interval starts with Thursday, 4 working days later is Wednesday of the following week, provided there is no holiday in between (Saturday and Sunday are not calculated as working days).
Tasks have a 'planned' and a 'due' property. Both properties are timestamps that differ by the duration value of the SERVICE_LEVEL. Taskana calculates the service level of a task by checking the task's Classification as well as the classifications of all attachments of that task. It then takes the shortest duration from those Classifications and uses it as the difference between the 'planned' and the 'due' timestamp of the task. If a task is created or updated, taskana performs the following checks / actions:
- if only the 'planned' property is specified (with a createTask call) or modified (with an updateTask call), taskana calcucates the 'due' property by adding the smallest SERVICE_LEVEL of the involved classifications to the 'planned' timestamp.
- if only the 'due' property is specified (with a createTask call) or modified (with an updateTask call), taskana calculates the 'planned' property by subtracting the corresponding SERVICE_LEVEL from the 'due' property.
- if both properties are specified (with a createTask call) or modified (with an updateTask call), taskana calculates the corresponding service level and adds the resulting duration to the 'planned' timestamp to obtain the correct 'due' timestamp. If this 'due' timestamp differs from the 'due' timestamp specified in the api call, taskana throws an InvalidArgumentException.
Similar considerations apply to the task's priority. It cannot be set from externally, but rather is calculated by taskana when a task is created or updated. For the task's priority the largest priority value of all involved classifications (this is: the classification of the task and the classifications of all attachments of this task) is taken.
If the service_level or priority property of a classification is changed by an administrator, taskana starts a job that iterates through all affected tasks and updates the due dates of these task so that they comply with the new service level.