Questo articolo permette di comprendere come è possibile sfruttare la classe Apex Wrapper per archiviare la risposta all'articolo selezionata dall'utente finale in una conversazione bot.
L'oggetto Risultato risposta selezionata ha una struttura diversa, quindi non sarà possibile passarlo alla classe Apex e mapparlo all'oggetto Knowledge__kav.
La struttura dell'oggetto Risultato risposta selezionata è la seguente:
{
"question": "abc",
"answer": "test",
"confidence": 0.817549,
"id": "kaQ1q0000008OJXEA2",
"title": "test",
"type": "FAQ"
}
Di seguito è riportato un esempio che spiega la creazione dell'oggetto e il passaggio della variabile selezionata alla classe Apex :
Creare un esempio di classe;
public class objectArt {
public string question;
public string answer;
public double confidence;
public string id;
public string title;
public string type;
}
quindi utilizzare questo oggetto in un esempio di variabile invocabile:
public class Requests {
@InvocableVariable(label='Records for Input' description='yourDescription' required=true)
public objectArt article;
}
e l'oggetto Risultato risposta selezionata verrà mappato correttamente e sarà possibile accedere all'ID Knowledge selezionata.
Il metodo invocabile dovrebbe accettare questa variabile invocabile come input, ad esempio,
@InvocableMethod(label='Get article')
public static List<Results> getSkillId(List<Requests> sobj) {....}
Consultare i seguenti articoli della guida pertinenti:
Limitazioni del sistema Bot Einstein (limite di tempo dell'azione Apex: 10 secondi)
003789771

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.