You are here:
Automatic State Model Transitions
In Spring '20 and later releases, you can automate state transitions in your State Model. This makes manually clicking on a state to advance to it unnecessary, although it's still an option.
For example, if you are using the Report Card State Model, you can schedule the Completed to Passed transition so that grade notifications are sent to all students at a specific time.
You can invoke the automated transition from an OmniScript, an Integration Procedure, a Vlocity Card, an Apex class, and so on. Note that you don't invoke the automation from within the State Model itself. The State Model user interface operates on individual base object records, while the automation operates on multiple records at once.
For example, to invoke the Completed to Passed transition in the Report Card State Model from an OmniScript or Integration Procedure, set the following properties in a Remote Action:
Property | Value |
|---|---|
Remote Class |
InsScheduledAutomatedTransitionService |
Remote Method |
scheduleAutomatedTransition |
Send JSON Path |
RAInput |
Provide input to the Remote Action in the following format:
{
"RAInput": {
"objectName": "vlocity_ins__Report_Card__c",
"fieldName": "vlocity_ins__States__c",
"fromState": "Completed",
"toState": "Passed",
"typeName": "vlocity_ins__Type__c",
"typeValue": "Student",
"schedule": {
"pattern": "WEEKLY",
"dayOfTheWeek": "FRI",
"startTime": "14:00"
}
}
}These input values specify that grade notifications are sent on Friday at 2 pm.
The input in this topic uses the namespace vlocity_ins for custom objects and fields. If your org has a different namespace, vlocity_cmt or vlocity_ps, use that instead.
If a State Model has a Type Field Name and a Type Field Value, you must specify typeName and typeValue parameters when invoking an automated transition. This prevents state transitions in base object records of the wrong type from occurring.

