metadata: platformVersion: "1.0" main: true name: "PizzaBot" parameters: age: 18 context: variables: size: "PizzaSize" type: "PizzaType" crust: "PizzaCrust" iResult: "nlpresult" liveChatInfo: "map" states: intent: component: "System.Intent" properties: variable: "iResult" transitions: actions: LiveChat: "setupProfileFirstName" HandleProblems: "handleProblems" OrderPizza: "resolvesize" CancelPizza: "cancelorder" unresolvedIntent: "unresolved" resolvesize: component: "System.SetVariable" properties: variable: "size" value: "${iResult.value.entityMatches['PizzaSize'][0]}" transitions: {} resolvecrust: component: "System.SetVariable" properties: variable: "crust" value: "${iResult.value.entityMatches['PizzaCrust'][0]}" transitions: {} resolvetype: component: "System.SetVariable" properties: variable: "type" value: "${iResult.value.entityMatches['PizzaType'][0]}" transitions: {} askage: component: "System.Output" properties: text: "How old are you?" transitions: {} checkage: component: "AgeChecker" properties: minAge: 18 transitions: actions: allow: "crust" block: "underage" crust: component: "System.List" properties: options: "Thick,Thin,Stuffed,Pan" prompt: "What crust do you want for your Pizza?" variable: "crust" transitions: {} size: component: "System.List" properties: options: "${size.type.enumValues}" prompt: "What size Pizza do you want?" variable: "size" transitions: {} type: component: "System.Text" properties: prompt: "What Type of Pizza do you want?" variable: "type" transitions: {} done: component: "System.Output" properties: text: "Your ${size.value} ${type.value} Pizza is on its way." transitions: return: "done" underage: component: "System.Output" properties: text: "You are too young to order a pizza" transitions: return: "underage" cancelorder: component: "System.Output" properties: text: "Your order is cancelled" transitions: return: "cancelOrder" unresolved: component: "System.Output" properties: text: "I don't understand. What do you want to do?" transitions: return: "unresolved" ##################################### # Service Cloud Live Chat Integration ##################################### setupProfileFirstName: component: "System.SetVariable" properties: variable: "profile.firstName" value: "your first name" #Set this property transitions: next: "setupProfileLastName" setupProfileLastName: component: "System.SetVariable" properties: variable: "profile.lastName" value: "your last name" #Set this property transitions: next: "setupProfileEmail" setupProfileEmail: component: "System.SetVariable" properties: value: "first.last@example.com" #Set this property variable: "profile.email" transitions: next: "setupLiveChatInfo" setupLiveChatInfo: component: "System.SetVariable" properties: variable: "liveChatInfo" value: customerInformation: categoryID: id: 61 #Set this property transitions: next: "agentInitiation" agentInitiation: component: "System.AgentInitiation" #Set this property properties: agentChannel: "ServiceCloudIntegration" #Set this property nlpResultVariable: "iResult" waitingMessage: "Let me connect you with a customer service agent who can further assist you." resumedMessage: "Please wait, someone will be with you shortly." customProperties: "${liveChatInfo.value}" transitions: actions: accepted: "agentConversation" rejected: "reject" error: "agentSystemError" agentConversation: component: "System.AgentConversation" properties: agentChannel: "ServiceCloudIntegration" #Set this property nlpResultVariable: "iResult" exitKeywords: "bye, good bye, good night, end, quit" conclusionMessage: "Have a nice day." transitions: next: "endPrompt" endPrompt: component: "System.Output" properties: text: "Connecting you back to the skill. What do you want to do next?" keepTurn: false transitions: next: "intent" reject: component: "System.Output" properties: text: "Sorry, no one's available now. Please try again later." transitions: return: "done" agentSystemError: component: "System.Output" properties: text: "Oops! We are having system issues. We're sorry, but we can't connect you with an agent right now. Please try again later." transitions: return: "agentSystemError" ################# # Handle problems ################# handleProblems: component: "System.List" properties: prompt: "I don't seem to be able to help you. Would you like to speak with someone?" options: - label: "Yes, I want to speak with someone" value: "SpeakToAgent" - label: "No, let's start over" value: "StartOver" autoNumberPostbackActions: true transitions: actions: SpeakToAgent: "setupProfileFirstName" StartOver: "startOver" startOver: component: "System.Output" properties: text: "I can help you order a pizza, cancel your order, or let you speak to someone. What would you like to do?" keepTurn: false transitions: next: "intent"