Configure Groovy Scripts to Enable Agenting Orchestration
You need to use Groovy scripts to orchestrate Triage Agent and Resolution Agent. However, if you want to use the Triage Agent and the Resolution Agent individually, then Groovy scripts are not needed.
Here's how you can create a Groovy script:
- Navigate to .
- Create a sandbox and select Application Composer.
- Navigate to Triggers. and select
- Create a new trigger and add the following Groovy script in the trigger's
body.
// Before insert trigger on message object. if (MessageTypeCd == 'ORA_SVC_AI_SYSTEM_NOTE') { def msgContent = MessageContent if (msgContent != null && msgContent.toString().contains("\"workflowCode\":\"sr.triage.agent.workflow\"")){ if(msgContent.toString().contains("\\\"vague\\\":\\\"no\\\"") && (msgContent.toString().contains("\\\"additionalInformation\\\":null") || msgContent.toString().contains("\\\"additionalInformation\\\":[]"))){ ServiceRequest?.StatusCd = 'TRIAGE_DONE' } else { ServiceRequest?.StatusCd = 'TRIAGE_WAITING' } } } // This groovy script is needed for Workflow Orchestration. The intent is to update SR Status to TRIAGE_DONE, when Customer replies with additional information requested by Triage Agent, which will kick off other workflow. if ((MessageTypeCd == 'ORA_SVC_CUSTOMER_ENTRY') && (ServiceRequest?.StatusCd == "TRIAGE_WAITING")) { ServiceRequest?.StatusCd = "TRIAGE_DONE" }
- Click and after validating the script, save and close.
- Publish the sandbox.