エージェント・オーケストレーションを有効にするためのGroovyスクリプトの構成
トリアージ・エージェントおよび解決エージェントを編成するには、Groovyスクリプトを使用する必要があります。 ただし、TriageエージェントとResolution Agentを個別に使用する場合は、Groovyスクリプトは不要です。
Groovyスクリプトを作成する方法を次に示します。
- に移動します。
- サンドボックスを作成し、「アプリケーション・コンポーザ」を選択します。
- にナビゲートし、「トリガー」を選択します。
- 新しいトリガーを作成し、トリガーの本文に次のGroovyスクリプトを追加します。
// 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" } - をクリックし、スクリプトを検証した後、保存して閉じます。
- サンドボックスを公開します。