You are here:
Custom Rule Evaluator Class
If the Rule Evaluation Class Name and Rule Evaluation Method Name settings of the State Model Version are blank, a default algorithm evaluates the State Transition Rules.
If you are an Apex developer, you can create a custom class to evaluate these rules. This class must:
-
Implement VlocityOpenInterface2.
-
Be declared
globalin its signature. -
Account for a transition's State Transition Completion Criteria setting of Any True or All True for evaluation of multiple rules.
-
Invoke the actions associated with the rules.
-
Accept JSON input in the following format:
{ "objId":"a045w000045ZNPBAA4", "stateTransition": { "Id":"a1b5w00000DNkcKAAT", "Name":"Tran 2", "vlocity_ins__IsDefaultTransition__c":false, "vlocity_ins__From__c":"a1c5w000003DMRoAAO", "vlocity_ins__StateModelVersionId__c":"a1Y5w0000097UgxEAE", "vlocity_ins__To__c":"a1c5w000003DMRqAAO", "vlocity_ins__TransitionCompletionCriteria__c":"AnyTrue" }, "transitionRules": [ { "Id":"a1a5w00001DWv4FAAT", "IsDeleted":false, "Name":"Tran 2 Rule 1", "vlocity_ins__StateTransitionId__c":"a1b5w00000DNkcKAAT", "vlocity_ins__Conditions__c":true, "vlocity_ins__ExecutionSequence__c":1, "vlocity_ins__FailureMessage__c":"Fail", "vlocity_ins__IsActive__c":true, "vlocity_ins__Message__c":"Pass", "vlocity_ins__RuleVlocityActionId__c":"a1L5w000008mPrMEAU" } ] } -
Return JSON output in the following format:
{ "result": true }
To use your custom class, specify the class name and method in the Rule Evaluation Class Name and Rule Evaluation Method Name settings of the State Model Version.

