SLA Data Model
Description
The COTSMSLA data model contains the settings of a service-level agreement (SLAs) within a workflow.
JSON Sample
{
"_id": "61827e0978b92cfb95ce66b6",
"start": {
"types": [],
"states": [
"61827e102e8b30db66f7ef63" //COTSMState (Workflow State)
]
},
"end": {
"types": [],
"states": [
"61827e6ede16c588a66e3b42", //COTSMState (Workflow State)
"61827e74fe6d5bde4134a1f1" //COTSMState (Workflow State)
]
},
"data": {
"timeType": "dynamic",
"time": "DATE|endDate",
"baseDate": "startDate"
},
"isActive": true,
"reset": false,
"repeat": true,
"stateMachine": "61827e81855c63e18d38be7a", //COTSMStateMachine (Workflow)
"taskGroup": "61827e87b9c09c7f7e121596", //COTTaskGroup (Workflow Group)
"code": "reminder_00",
"display": "Reminder",
"pb": {}, //COTParametrizedBot (Routine)
"company": "61827e8fb10fe5e98e1438ef", //COTCompany
"createdAt": "2021-03-27T21:29:16.756Z",
"modifiedAt": "2021-10-27T13:07:38.906Z",
"__v": 0
}
Fields
Field | Description | Type | Note |
---|---|---|---|
code | The SLA's code name | string | Maximum 60 characters; only lowercase letters, numbers, and underscores allowed; must be unique. |
company | The ID of the company the SLA is found in. | ObjectId<COTCompany> | |
createdAt | Date the SLA was created. | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
data | Date and time configuration for the SLA. | object | |
data.baseDate | Sets static and dynamic time reference. | string | Enum: ["endDate", "startDate", "resolutionDate", "default"] Details availible here. |
data.time | Specifies the date or time that the task is supposed to go from its initial to final state. | string | Details available here. |
data.timeType | Indicates how time is calculated. Options are dynamic or static . | string | Details available here. |
display | The SLA's display name | string | |
end | Specifies when an SLA should be considered completed. | object | Either states or types can be used to specify SLA completion, but it is not recommended to use both. |
end.states | Specifies the task states in which the SLA is completed. | ObjectId<COTSMStates>[ ] | |
end.types | Specifies the task types in which the SLA is completed. | string[ ] | Enum: ["new", "in-progress", "closed"] |
isActive | Indicates if the SLA is active or not. | boolean | |
modifiedAt | Indicates the last time the SLA was modified. | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
pb | Contains the routine that sets off with the SLA. | COTParametrizedBot | |
repeat | If "true", time will cycle infinitely until the condition is met. Therefore, the SLA routine will be executed as many times as necessary. Otherwise, the SLA will only run once. | boolean | Use with precaution to avoid undesired looping activity. |
reset | If "true", time will start again when the task returns to start.states or start.types . | boolean | |
start | Specifies when an SLA should initiate. | object | Either states or types can be used to specify SLA initiation, but it is not recommended to use both. |
start.states | Specifies the task states in which the SLA is initialized. | ObjectId<COTSMStates>[ ] | |
start.types | Specifies the task types in which the SLA is initialized. | string[ ] | Enum: ["new", "in-progress", "closed"] |
stateMachine | The state machine or workflow the state belongs to. | ObjectId<COTSMStateMachine> | |
taskGroup | The task group or workflow group the state belongs to. | ObjectId<COTTaskGroup> |
Additional Resources
- SLA Routine: How to add an SLA Routine to a workflow
- "State Machines" REST API documentation: basic "State Machines" API requests
- API documentation in Swagger: complete with data models (schemas)
- COTLang: use COTLang for extracting data from models in routines
- Triggers and Contexts: more information on using data models within routines
Help
- Cotalker Platform Community: post your questions or search for previous answers given in the forum