![Page 1: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/1.jpg)
![Page 2: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/2.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Digital Assistant The Complete Training
2
Custom Components Overview
Image courtesy of pixabay.com
![Page 3: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/3.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Safe Harbor StatementThe following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
3
![Page 4: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/4.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Topic agenda
4
Overview
Custom component architecture
Deployment options
Design considerations
1
2
3
4
![Page 5: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/5.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Topic agenda
5
Overview
Custom component architecture
Deployment options
Design considerations
1
2
3
4
![Page 6: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/6.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
About custom components• Like system components, just custom• Use cases– Backend system calls– Integrate custom code logic into a bot conversation
• Developed using Node.js• Hosted in custom component services–One or many components per service– REST Service built with Node Express
6
![Page 7: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/7.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Custom component service development basics• A custom component is simply a REST API– Always GET and POST which "plug" into Oracle
Digital Assistant– Custom component typically calls an external API
• You can "package" related custom components together– Called a component service
• Oracle provides– A "starter" which has most of the code for a custom
component– SDK to simplify bot interaction
![Page 8: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/8.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Custom component service development basics• Most of the code is boilerplate (at least when you start)• Exceptions are:– Component service name– Component name– Component properties– Component return action strings– Typically, a backend API call
![Page 9: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/9.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 9
Oracle provides Oracle Bots Node.js SDK, a free utility that makes custom
component development and deployment easy
Image courtesy of pixabay.com
![Page 10: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/10.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Topic agenda
10
Overview
Custom component architecture
Deployment options
Design considerations
1
2
3
4
![Page 11: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/11.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
GET
POST
Component Service (REST)
Skill Bot
11
Custom component service architecture
/components
/components/{component}
Component 1
Component 2
Component <n>
![Page 12: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/12.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 12
Custom component service architecture
GET
POST
Component Service (REST)
Skill Bot
Component Router
Component 1
Component 2
Component <n>
![Page 13: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/13.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 13
Custom component service architecture
GET
POST
Component Service (REST)
Skill Bot
Component Router
Component SDK
Message Model
Component 1
Component 2
Component <n>
![Page 14: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/14.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 14
Custom component service architecture
GET
POST
Component Service (REST)
Component 1
Component 2
Component <n>JavaScript
metadata: ()=>({…}),
Invoke(conversation, done) => {…}Invoke(conversation, done) =>
Skill Bot
Component Router
Component SDK
Message Model
![Page 15: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/15.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Role of the custom component SDK• Expose functions to – Read from the bot payload–Write to the component response payload
• Support for conversational message model responses– Simplifies creation of rich UI responses similar to System.CommonResponse– Supports attachments, card layouts, location, actions and more
• Supports developers detecting the type of an incoming message– E.g. actions need to be handled differently than text messages
15
![Page 16: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/16.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Oracle Bots Node.js SDK• Development and test tools for custom
components and webhook• Available on GitHub and NPMJS• Requires Node Package Manager (NPM)• Command Line Interface (CLI)– Creates component service and components– Provides custom component SDK to project– Integrated runtime for testing
16
![Page 17: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/17.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 17
Oracle Bots Node.js SDK
GET
POST
Component Service (REST)
Component 1
Component 2
Component <n>JavaScript
metadata: ()=>({…}),
Invoke(conversation, done) => {…}Invoke(conversation, done) =>
Skill Bot
Oracle Bots Node.js SDK
Component Router
Component SDK
Message Model
![Page 18: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/18.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Topic agenda
18
Overview
Custom component architecture
Deployment options
Design considerations
1
2
3
4
![Page 19: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/19.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Custom component deployment options• Local Component Container – Custom component service resides in skill bot– Single instance deployment
• Mobile Hub–Multi-channel environment with mobile extras–Mobile or multi-channel requirement – Shared instance deployment
• Node Container– If you don't need Mobile Hub but want a shared deployment
19
![Page 20: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/20.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Remote deployment
• Pro– Single point of maintenance– Easy to push custom component
changes– Leverage server features like access
protection
• Con– Dependency to remote configuration
needs to be tracked
Local deployment
• Pro– Skill bots can run different versions of a
custom component service– Custom component service deployed
with skill bot (import / export)– Easier to use with skills published to skill store
• Con– Harder to maintain, e.g. pushing
custom component changes
20
Remote deployment vs. local deployment
![Page 21: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/21.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Topic agenda
21
Overview
Custom component architecture
Deployment options
Design considerations
1
2
3
4
![Page 22: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/22.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 22
Think of custom component services as the equivalent of
libraries in Java
Image courtesy of pixabay.com
![Page 23: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/23.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Design custom component services as libraries• Build custom components with reuse in mind– Don't repeat yourself (DRY) principle
• Group related components in a single service–Managing user accounts– Transactions in a specific business area– Product catalog interactions– Utility functions– etc.
• A widely understood concept
23
• ListProducts• DeleteProduct• ProductCatalog
Product Component
Service
• AuthenticateUser• GetUserInfo• SetUserInfo
User Action Component
Service
![Page 24: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/24.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Custom component naming convention• Choose a descriptive component name– Good component name describes what the component does
• Use naming convention that ensure component names are unique– JavaScript doesn't know of name spaces– Expect your component to be used together with 3rd party components– E.g. com.oracle.bots.financials.AccoutBalance
24
![Page 25: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/25.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 25
![Page 26: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/26.jpg)
![Page 27: Oracle Digital Assistant · 2020-05-25 · Custom component naming convention •Choose a descriptive component name –Good component name describes what the component does •Use](https://reader035.vdocuments.net/reader035/viewer/2022062921/5f0467497e708231d40dccfc/html5/thumbnails/27.jpg)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 27
Oracle Digital Assistant Hands-On
TBD