Here is our process flow:
Once the package is generated we go to our environment and deploy the package.
Upon package generation we need to create the trigger to call the automation.
Now that API trigger has been created you can create an API token for the trigger access. Please copy the key to be used later in the chatbot skill's action .
Now add the intent 'rbp' with a singular expression 'Create role'
Now for the sake of this proof of concept we hardcode some memory variables needed as input parameters to invoke our iRPA API Trigger
Now let us configure our iRPA API trigger call from the chatbot. We add the action of Create External Service - Consume API Service and add the 3 Header fields as shown in the picture below. Also please see that we will add the service key we generated in iRPA:
{
"invocationContext": {"conversationId":"{{conversation_id}}"
},
"input": {
"password": "{{memory.pp}}",
"username": "{{memory.us}}",
"role":"{{memory.role}}"
}
}
var i = 0;
var temp ="";
var cookieField ="";
if(cookie!=""){
for(i=0;i<cookie.length-1;i++)
{
temp = cookie[i].split(";");
cookieField = cookieField + temp[0] + "; ";
}
temp = cookie[i].split(";");
cookieField = cookieField + temp[0];
}
var data = {
"__metadata": {
"uri": "RBPRole",
"type": "SFOData.RBPRole"
},
"roleDesc": "Created from Irpa;",
"roleName": role
};
var payload = {
resolveBodyOnly : true,
method: 'POST',
url: 'https://apisalesdemo4.successfactors.com/odata/v2/upsert',
headers: {
'Authorization': 'Basic '+ cred,
'Cookie' : cookieField,
'Content-Type': 'application/json',
'x-csrf-token' : csrf_token
},
ignoreClientCertificate: true,
body: JSON.stringify(data)
};
return payload;
Now we need to create a Web Client for the CAI chatbot in order to call the iRPA API. This is easy to do from the connect tab.
You can access the webclient from the provided url
For creating notifiers for the API trigger we go back to our iRPA environment.
Choose notifier of type CAI.
Next we need to add the CAI chatbot conversation id metadata to send messages back to the chatbot
Next we need to add the CAI chatbot client credentials and developer token to the notifier.
Lets see this working below
We see the response from our notifier above and also below you see the role created in the SuccessFactors instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
6 | |
6 | |
6 |