State Data Model
Advertencia
Esta página aún no se encuentra traducida al español.
Description
States are different statuses or stages a task goes through in a workflow or state machine. The COTSMState data model contains a state's settings which detail how it passes to a next state.
JSON Sample
{
"__v": 3,
"_id": "61825dc53d5a23c4de1c5891",
"company": "61825e70d775394b54bc9801", //COTCompany
"createdAt": "2021-02-23T11:59:09.774Z",
"isActive": true,
"modifiedAt": "2021-10-29T18:07:56.959Z",
"next": [
{
"canChange": [
"manual"
],
"permissions": null,
"_id": "61825e3c4f81079320a7f394",
"target": "61825e4d2e6213cc574404ed", //COTSMState (Workflow)
"triggers": [], //COTParametrizedBot (Routine)
"requiredSurvey": null //COTSurvey (Survey)
},
],
"property": "61825e1fdf69d71cd50f28d5", //COTProperty (Element)
"stateMachine": "61825e1288d560b8d79c4bd5", //COTSMStateMachine (Workflow)
"subtask": {
"target": null, //COTSMStateMachine (Workflow)
"triggers": [] //COTParametrizedBot (Routine)
},
"surveyTriggers": [
{
"surveyId": "618261e9b754d9b1132b5a15", //COTSurvey (Survey)
"triggers": [] //COTParametrizedBot (Routine)
}
],
"taskGroup": "61825e1ab0a7fb03de08bdc2", //COTTaskGroup (Workflow Group)
"type": "new",
}
Fields
Field | Description | Type | Note |
---|---|---|---|
company | The ID of the company the state is found in. | ObjectId<COTCompany> | |
createdAt | Indicates when the state was created | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
isActive | Indicates if the state is active or not. | boolean | |
modifiedAt | Indicates the last time the state's configuration was modified. | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
next | List of the possible states the task can change into from the current state. | object[ ] | Each object in the array represents a state the task can assume. |
next[index].canChange | Indicates if and how a state change can occurr. | string[ ] | Enum: ["survey", "manual", "none"] [Option details.] (/docs/documentation/admin/workflows/settings_panels/create_edit_state/#state-changes) |
next[index].requiredSurvey | Points to a survey used for changing a task's state. Option available only is canChange is set to survey. | ObjectId<COTSurvey> | Setup information for [State Start Forms] (/docs/documentation/admin/workflows/admin_workflow_required_survey#required-survey-for-modifying-task-states) |
next[index].target | The state the task changes into. | ObjectId<COTSMState> | |
next[index].triggers | Configuration of the routine that accompanies the state change. | COTParametrizedBot[ ] | NOTE: If this routine is set, it is up to the routine to change the state. |
property | The state's property or element ID. | ObjectId<COTProperty> | |
stateMachine | The state machine or workflow the state belongs to. | ObjectId<COTSMStateMachine> | |
subtask | Represents an available subtask. | object | |
subtask.target | Points to a workflow used as a subtask. | ObjectId<COTSMStateMachine> | |
subtask.triggers | Configuration of the routine that accompanies the subtask creation. | COTParametrizedBot[ ] | |
surveyTriggers | Surveys that accompany a workflow's state change. | object[ ] | |
surveyTriggers[index].surveyId | Survey ID | ObjectId<COTSurvey> | |
surveyTriggers[index].triggers | Configuration of the routine that accompanies the survey trigger. | COTParametrizedBot[ ] | |
taskGroup | The task group or workflow group the state belongs to. | ObjectId<COTTaskGroup> | |
type | Indicates the state type. | string | Enum: ["new", "in-progress", or "closed"] Option details |
Deprecated
Field | Description | Type | Note |
---|---|---|---|
icon | string | DEPRECATED |
Additional Resources
- Workflow State Configuration: Worflow configurations through the Administrative Panel
- Create Workflow Tutorial: Basic tutorial on how to create 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