AssessmentResponses Class
Namespace
Usage
To save assessment responses from the runtime Omniscript on the Omni Assessment Task page to the AssessmentResponses class, implement the VlocityOpenInterface interface.
Specify the implemented Apex class name in the Remote Actions section of the OmniScript page. A Remote Action calls the specified Apex class and its method to save the assessment form in the Assessment and AssessmentQuestionResponse Salesforce objects.
This screenshot shows the Apex class name and its method as specified in the Omniscript Remote Action Properties section:

Special Access Rules
Public Sector and Dynamic Assessment permission sets are required to use this Apex class.
Example
global class OmniSave implements <Vlocity_Namespace>.VlocityOpenInterface {
public Boolean invokeMethod(String methodName, Map<String,Object> input, Map<String,Object> output, Map<String,Object> options){
PublicSectrSltn.AssessmentResponses.storeResponses(input,output,options);
return true;
}
}
For more information on the VlocityOpenInterface interface, see OmniStudio Foundation Guide.
AssessmentResponses Methods
The following is a method for AssessmentResponses.
storeResponses(input, output, options)
Signature
public static void storeResponses(Map<String,Object> input, Map<String,Object> output, Map<String,Object> options)
Parameters
- input
- Type: Map<String,Object>
- Contains the context ID, assessment response in JSON format, and extra payload details from configurations from Vlocity OmniScript.
- output
- Type: Map<String,Object>
- Reserved for future use.
- options
- Type: Map<String,Object>
- Contains the assessment name and assessment status that are configured in OmniScript.
Return Value
Type: Void