Saltar al contendio prinicipal

State Machine Data Model

Advertencia

Esta página aún no se encuentra traducida al español.

COTSMStateMachine

Description

The COTSMStateMachine data model explained below stores a state machine's (workflow's) settings.

State machines, also know as workflows, are definitions of how tasks behave. They define a workflow's initial state, the other states they can change to, what triggers are executed, if reminders are sent, and more.

JSON Sample

{
"__v": 3,
"_id": "6179f1900f434fa685f7a857",
"allowedExtensions": [ //Additional Fields
"6179f1f6bb1f957abdd723b5" //COTPropertyType (Collection)
],
"asset": {
"propertyType": "6179f1d155753e932b4cb08c", //COTProperyType (Collection)
},
"code": "taskmanagerflow_05",
"company": "6179f1ee6ec8b62d2406ec46", //COTCompany
"createdAt": "2021-02-23T11:54:44.287Z",
"dynamicPropertyTypes": { //Additional fields
"status1": "6179f19c0af69ae6681dbba0", //COTPropertyType (Collection)
"status2": "6179f1a2963af3b56fd04d93", //COTPropertyType (Collection)
"status3": "6179f1a963b531035f7e5065", //COTPropertyType (Collection)
"status4": null,
"status5": null,
"isActive": [
"status1",
"status2",
"status3"
]
},
"hooks": {
"onCreate": [] //COTParametrizedBot (Routine)
},
"initialState": "6179f1b9ff2235eb2120565e", //COTSMState
"isActive": true,
"taskGroup": "6179f1b04f04ff1c7f7cf01a", //COTTaskGroup (Workflow Group)
"name": "Task Manager Flow",
"propertyType": "6179f1cb4f1389218162fe05", //COTPropertyType (States' Collection)
"requiredSurvey": { //Workflow Start Form
"surveyId": "6179f1df620c1bc7c7865862", //COTSurvey
"permissions": null,
"parametrizedBot": [] //COTPrametrizedBot (Routine)
}
}
FieldDescriptionTypeNote
allowedExtensionsAn array of collections used as additional fields for the workflow.ObjectId<COTPropertyType>[ ]The additional fields created by these collections are similar to the additional fields created by the collections in the dynamicPropertyTypes field. But the later should be preferred. See "Best Practices" for more information.
assetIndicates the asset used to represent the tasks created through the workflow (state machine).object
asset.propertyTypeThe collection (property type) associated with the asset. The indicated collection can store relavant task data.ObjectId<COTPropertyType>Furthermore, the collection's additional fields are shared with all the tasks beloning to the task group.
codeThe state machine's unique identification name.stringMaximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique.
companyIndicates the company the survey is found in.ObjectId<COTCompany>
createdAtDate the workflow was created.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
dynamicPropertyTypesIndicates the collections (property types) set as statuses in the additional fields section of workflow settings. Users will be able to select elements from the collections to give further details about the task.objectThis option can be used to filter tasks, establish permissions, set priorities, among others.
dynamicPropertyTypes
.isActive
Lists the statuses associated with a collection (property type).string[ ]Enum: [ "status1", "status2", "status3", "status4", "status5"]
dynamicPropertyTypes
.status1
Collection used as an additional field.ObjectId<COTPropertyType>
dynamicPropertyTypes
.status2
Collection used as an additional field.ObjectId<COTPropertyType>
dynamicPropertyTypes
.status3
Collection used as an additional field.ObjectId<COTPropertyType>
dynamicPropertyTypes
.status4
Collection used as an additional field.ObjectId<COTPropertyType>
dynamicPropertyTypes
.status5
Collection used as an additional field.ObjectId<COTPropertyType>
hooksUsed for running routines triggered by an event.object
hooks.onCreateRoutine that runs on the creation of a task.COTParametrizedBot[ ]
initialStateIndicates the state the workflow begins in.ObjectId<COTSMState>
isActiveIndicates whether the workflow is active or not.boolean
modifiedAtIndicates the last time the workflow was modified.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
nameThe workflow's display namestring
propertyTypeIndicates the collection (property type) that contains the elements that represent the workflow's states.ObjectId<COTPropertyType>
requiredSurveyRepresents a start form, used for initializing a workflow.object
requiredSurvey
.parametrizedBot
Configuration of the routine that accompanies the start form.COTParametrizedBot[ ]
requiredSurvey
.permissions
List of start form permissions users need to initiate the workflow.string[ ]Users need at least one of the permissions listed. Users are designated permissions through their access roles.
requiredSurvey
.surveyId
Workflow start form IDObjectId<COTSurvey>
taskGroupThe workflow group thats hosts all the tasks created upon the workflow.ObjectId<COTTaskGroup>

Deprecated

FieldDescriptionTypeNote
asset.propertyThe asset's property (element) ID.ObjectId<COTProperty> DEPRECATED
asset.typeUse the generic type for tasks that need to be repeated. Use unique for one-time tasks.stringDEPRECATED
taskChannelTypeRefers to the relationship task's and their channels.
Enum: ["bound", "unbound", "unbound-hierarchy"]
SHOULD ALWAYS BE ON BOUND
stringDEPRECATED.

Additional Resources

Help