{"id":22286,"date":"2019-08-16T11:53:07","date_gmt":"2019-08-16T10:53:07","guid":{"rendered":"https:\/\/developer.kore.ai\/?p=22286"},"modified":"2021-08-03T12:30:25","modified_gmt":"2021-08-03T11:30:25","slug":"working-with-the-dialog-node","status":"publish","type":"post","link":"https:\/\/multisite.korebots.com\/v9-0\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-dialog-node\/","title":{"rendered":"Dialog Node"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row via_grid cols_1 laptops-cols_inherit tablets-cols_inherit mobiles-cols_1 valign_top type_default stacking_default\"><div class=\"wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><p>Dialog Node lets you start a new dialog task within an existing dialog task if the user intent changes.<\/p>\n<p>For example, let us consider a travel bot that has the following three dialog tasks: <em>Flight Availability<\/em>, <em>Book a Flight<\/em>, and <em>Book a Hotel<\/em>. You may want to invoke the <em>Book a Flight<\/em> dialog task from the <em>Flight Availability<\/em> dialog task.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Key_Features\"><\/span>Key Features<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The key features of dialog nodes are listed below:<\/p>\n<ul>\n<li>The ability to carry data from the current dialog task to the target dialog task as <em>entity pre-assignments<\/em> described in the later section.<\/li>\n<li>When a target dialog task is invoked, the current dialog flow begins at the root intent of the new dialog task. If you write transitions for the dialog node, then the flow returns to the source dialog task after completing the target. If you do not write transitions, the dialog task ends after executing the target dialog task. This differs from an optional User Intent node, where the dialog flow processes a related user intent and then continues in the same dialog task thereafter.<\/li>\n<\/ul>\n<\/div><\/div><div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Set-Up\"><\/span>Set-Up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Setting up an dialog node in a dialog task involves the following steps:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Add_Node\"><\/span>Add Node<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Open the dialog task to add the Dialog node.<\/li>\n<li>Add dialog node in the designated place. For steps in adding nodes, <a href=\"\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/#Adding_Nodes\">refer here<\/a>.<\/li>\n<li>The dialog window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<\/li>\n<\/ol>\n<\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h2><span class=\"ez-toc-section\" id=\"Configure_Node\"><\/span>Configure Node<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div><\/div><div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"Component_Properties\"><\/span>Component Properties<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The configurations you set up or edit in the Component Properties tab reflects in all the dialog tasks that use this node.<\/p>\n<ol>\n<li>On the <strong>Component Properties<\/strong> tab,\u00a0under the <strong>General Settings<\/strong>, you can modify\n<ul>\n<li>the <strong>Name<\/strong> and<\/li>\n<li>the <strong>Description<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"NLP_Properties\"><\/span>NLP Properties<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>From the <strong>NLP Properties<\/strong> tab, you can perform actions from the below-listed sections:\n<ul>\n<li><a href=\"\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/machine-learning\/user-utterances\/\"><b>Machine Learning<\/b><\/a> settings to provide user utterances to improve the detection for this node.<\/li>\n<li><a href=\"\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/fundamental-meaning\/fundamental-meaning\/#Adding_Bot_Synonyms\"><b>Bot Synonyms<\/b><\/a> or related phrases for this node.<\/li>\n<li><a href=\"\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/fundamental-meaning\/fundamental-meaning\/#Navigating_to_the_Patterns_Tab\"><b>Patterns<\/b><\/a> to capture this node if the user\u2019s utterance contains these specific patterns.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3><span class=\"ez-toc-section\" id=\"Connections_Properties\"><\/span>Connections Properties<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Click the <strong>Connections <\/strong>tab and set the transition properties to determine the node in the dialog task to execute next. You can write the conditional statements based on the values of any Entity or Context Objects in the dialog task, or you can use intents for transitions. If you have defined the <em>Transition Property<\/em> as <em>End the current task<\/em>, then these settings are ignored.\n<ol>\n<li>Under the <strong>Connection Rules <\/strong>section, click <b>Add IF<\/b>.<\/li>\n<li>Configure the conditional expression based on one of the following criteria:\n<ul>\n<li><b>Entity<\/b>: Compare an Entity node in the dialog with a specific value:\n<ul>\n<li>Select the <strong>Entity<\/strong>.<\/li>\n<li>Select an operator from the drop-down lists: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than.<\/li>\n<li>Type the number in the <b>Value <\/b>field.\u00a0 For example, <i>PassengerCount (entity) greater than (operator) 5 (specified value).<\/i><\/li>\n<\/ul>\n<\/li>\n<li><b>Context<\/b>: Compare a context object in the dialog with a specific value using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. For example,<b>\u00a0<\/b><i>Context.entity.PassengerCount<\/i> <i>(Context object) greater than (operator) 5 (specified value).<\/i><\/li>\n<li><b>Intent: <\/b>Select an intent that matches the next user utterance.<\/li>\n<\/ul>\n<\/li>\n<li>In the <b>Then go to<\/b> drop-down list, select the next node to execute in the dialog flow if the conditional expression succeeds. For example, if the <i>PassengerCount (entity) greater than (operator) 5 (specified value), <\/i><b>Then go to <\/b><i>Offers (sub-dialog).<\/i><\/li>\n<li>In the <b>Else <\/b>drop-down list, select the node to execute if the condition fails.\n<div class=\"alert alert-info\"><b>Note<\/b>: If you want to write multiple If conditions, click <b>Add Else If <\/b>below the last <strong>If<\/strong> conditional expression.<\/div>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/div><\/div><div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"d-step3\"><span class=\"ez-toc-section\" id=\"Instance_Properties\"><\/span>Instance Properties<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Instance Properties include the settings for this instance of the dialog.<\/p>\n<ol>\n<li>Click the <strong>Instance Properties<\/strong> tab on the Dialog window.<\/li>\n<li>In the<strong> Entity Pre-Assignments<\/strong> section, you can pre-assign values from this session or node data to the entities required by the Dialog Task. Any remaining required values are handled by the sub-intent.\u00a0 (<a href=\"#entity-preassignment\">see below for details<\/a>)<br \/>\nIf you want to reset the values, you need to use the keyword &#8220;null&#8221;, spaces would be ignored by the platform.<\/li>\n<li>In the<strong> Entity Post-Assignments<\/strong> section, it displays a list of entities available in the current task with an option to add custom variables. These entities are assigned with values from the linked dialogs session data. For example, <em><code>context.entities.<\/code><\/em>lists the entities from the linked sub-dialog for selection. The values are assigned once the linked dialog execution is complete.<br \/>\nNOTE: This option is available only if the <strong>Transition Options<\/strong> is set to return to the current node on task completion.<br \/>\nCurrently, there is a limitation when using URL entity types. URL values with <code>http<\/code> as opposed to <code>https<\/code> or without the <code>www<\/code> suffix will not work.<br \/>\nIf you want to reset the values, you need to use the keyword &#8220;null&#8221;, spaces would be ignored by the platform.<\/li>\n<li>In the <strong>Transition Options<\/strong> section, you can define the flow to be followed once the task completes. You can choose from two options:\n<ul>\n<li>Return to the current node on task completion.<\/li>\n<li>End the current task and initiate this task.<\/li>\n<\/ul>\n<\/li>\n<li>Click <strong>Advanced Controls<\/strong> to set up the below-listed options:\n<ul>\n<li><strong>Interruptions Behavior<\/strong>\n<ul>\n<li><strong>Use the task level &#8216;Interruptions Behavior&#8217; Setting<\/strong>: The bot refers to the <strong>Interruptions Behavior<\/strong> settings set at the dialog task level.<\/li>\n<li><b>Customize for this node<\/b>: You can customize the <strong>Interruptions Behavior<\/strong> settings for this node by selecting this option and configuring the same. Read the <a href=\"\/docs\/bots\/bot-builder-tool\/train-nlp-optimization\/bot-intelligence\/interruption-handling-context-switching-intents\/\" target=\"_blank\" rel=\"noopener noreferrer\">Interruption Handling and Context Switching<\/a> article for more information.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Custom Tags\u00a0<\/strong>defines tags to build custom profiles of your bot conversations. <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">See here for more<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/li>\n<\/ol>\n<\/div><\/div><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h4 id=\"entity-preassignment\">About Entity Pre-Assignments<\/h4>\n<p>You can pre-populate data for the destination dialog task by:<\/p>\n<ul>\n<li>Adding values to the entity keys.<\/li>\n<li>Adding additional custom keys and values to pass data from the current dialog task <code>Context<\/code> object to the destination dialog task as needed.<\/li>\n<\/ul>\n<p>By default, entity nodes defined in the target dialog task are displayed as key\/value pairs. You can then define values for associated entities or add custom keys and values as needed using session and context variables.<\/p>\n<p>Transitioning from the source dialog task to the destination dialog task occurs at the runtime when the user input matches one of any linked dialog tasks. When you map more than one dialog task, you can define which dialog tasks are displayed to the end-users using conditional transitions.<\/p>\n<p>When you call another dialog task, you want to carry information from the first dialog task to the next dialog task. For example, customer information collected in a <em>Book a Flight<\/em> dialog task is passed to the <em>Book a Hotel<\/em> dialog task.<\/p>\n<p>In the Bots platform, you can use the <code>mappedIntents<\/code> variable in the <code>Context<\/code> object which holds the reference of the intent nodes as well as the context of the source dialog task as shown in the following JSON syntax:<br \/>\n<code>{ 'title': 'title of the link', 'link':' url for the link' ,'postbackpayload': 'system generated payload'}<\/code><br \/>\nFor example, a link to <code>GetEmail<\/code> in the <code>Context<\/code> object can be:<\/p>\n<pre>{\r\n   \"title\":\"GetEmail\",\r\n   \"link\":\"https:\/\/app.collab.ai\/wf\/1.1\/market\/users\/bots\/st-bb1eb3da-cfa7-5244-b241-b5042d333e76\/dialogue\/dg-15fd2927-219c-5795-b038-5b830718bea7\/execute?nodeId=message2&amp;contextId=dcx-f9bae173-4d69-53e4-9aa7-21e89aae776d&amp;intent=GetEmail\",\r\n   \"postbackpayload\":\"MappedDialog_dc-f7b42932-dc06-53ac-92c0-1db706794f91_dg-15fd2927-219c-5795-b038-5b830718bea7_dcx-f9bae173-4d69-53e4-9aa7-21e89aae776d\"\r\n}<\/pre>\n<p>You can access and present these variables in a prompt message to a user to display a list of mapped dialog tasks with the link, or as a list of choices. You can pass the source dialog context to the target dialog task even if the source dialog task is no longer actively using the <code>Context<\/code> object.<\/p>\n<p>The value for the <code>postbackpayload<\/code> key is generated by the Bots platform and is used in some channels, such as <em>Facebook<\/em> and <em>Slack,\u00a0<\/em>which defines when a link or choice is made for a target dialog task.<\/p>\n<p>For more information, refer to <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/using-session-and-context-variables-in-tasks\/\" target=\"_blank\" rel=\"noopener noreferrer\">Using Session and Context Variables in Tasks<\/a>\u00a0and the\u00a0<a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/context-object\/\" target=\"_blank\" rel=\"noopener noreferrer\">Context Object<\/a>.<\/p>\n<\/div><\/div><div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>[vc_raw_html]JTNDZGl2JTIwY2xhc3MlM0QlMjJ3LXBvc3QtZWxtJTIwcG9zdF9uYXZpZ2F0aW9uJTIwbGF5b3V0X3NpbXBsZSUyMGludl9mYWxz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kZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLXRpdGxlJTIyJTNFJTNDc3BhbiUzRUVudGl0eSUyME5vZGUlM0MlMkZzcGFuJTNFJTNDJTJGZGl2JTNFJTBBJTNDcCUzRSUzQyUyRmElM0UlM0MlMkZkaXYlM0U=[\/vc_raw_html]<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Dialog Node lets you start a new dialog task within an existing dialog task if the user intent changes. For example, let us consider a travel bot that has the following three dialog tasks: Flight Availability, Book a Flight, and Book a Hotel. You may want to invoke the Book a Flight dialog task from...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/22286"}],"collection":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/comments?post=22286"}],"version-history":[{"count":26,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/22286\/revisions"}],"predecessor-version":[{"id":29381,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/22286\/revisions\/29381"}],"wp:attachment":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/media?parent=22286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/categories?post=22286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/tags?post=22286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}