{"id":23811,"date":"2020-07-03T16:49:20","date_gmt":"2020-07-03T15:49:20","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-1\/?p=23811"},"modified":"2021-01-04T10:24:05","modified_gmt":"2021-01-04T10:24:05","slug":"working-with-the-logic-node","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-logic-node\/","title":{"rendered":"Working with the Logic Node"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>The Logic Node provides a simpler experience to developers, primarily business users to use context variables and define complex transition conditions. Its two primary functions are:<\/p>\n<ol>\n<li>Ability to manage variables and values of variables in the context object.<\/li>\n<li>Ability to define nested transition conditions.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3 id=\"d-step1\"><span class=\"ez-toc-section\" id=\"Add_a_Logic_Node_to_the_Dialog_Task\">Add a Logic Node to the Dialog Task<\/span><\/h3>\n<ol>\n<li>Open the dialog task in which you want to add the Logic node.<\/li>\n<li>Click the<b> <\/b><img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-9160\" src=\"\/wp-content\/uploads\/sites\/18\/DIYDialogTaskPlusIcon.png\" alt=\"diydialogtaskplusicon\" width=\"15\" height=\"15\" \/> icon next to the respective node.<\/li>\n<li>Select <b>Logic<\/b> &gt; <strong>New logic node<\/strong>. You can also select an existing logic node from the available list.<\/li>\n<li>The Logic window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3 id=\"d-step2\"><span class=\"ez-toc-section\" id=\"Define_Component_Properties\">Define Component Properties<\/span><\/h3>\n<ol>\n<li>On the <strong>Component Properties<\/strong> tab, under the <strong>General Settings<\/strong> section, you can modify the <strong>Name<\/strong> and <strong>Display Name<\/strong>.<\/li>\n<li>Use the <strong>Manage Context Variables<\/strong> section to set the context variables by entering a key-value pair.\u00a0Use the full path of the variable in the <em>key<\/em> field i.e. <em>context.BotUserSession.&lt;variable_name&gt;.<\/em><\/li>\n<li>In the <strong>Variable Namespaces<\/strong> section (v8.0), associate the variable namespaces to execute this node and its transitions. This option is visible only when the variable namespace is enabled for the bot. You can go with the task level settings or customize it for this node. For more information, refer to <a href=\"\/v8-1\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">Managing Namespace<\/a>.<\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_Instance_Properties\">Configure the Instance Properties<\/span><\/h3>\n<p>Use the Instance Properties to define any user tags that you want to set.<\/p>\n<div class=\"alert alert-info\"><b>Note:<\/b> The settings in the Instance Properties tab are specific to the current dialog task and do not reflect in other dialog tasks\u00a0that use this entity node.<\/div>\n<div><\/div>\n<ol>\n<li>On the Logic window, click the <strong>Instance Properties<\/strong> tab.<\/li>\n<li>Under the <strong>Custom<\/strong> <strong>Tags <\/strong>section, add tags to build custom profiles of your bot conversations. <a href=\"\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">Click here for more<\/a><\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Configure_the_Connections_Properties\">Configure the Connections Properties<\/span><\/h3>\n<p>From the node\u2019s <strong>Connections<\/strong> tab, you can 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.<br \/>\nTo setup Component Transitions, follow the below steps:<\/p>\n<ol>\n<li>On the Logic window, click the <strong>Connections<\/strong> tab.<\/li>\n<li>Under the <strong>Connection Rules<\/strong> section, you can select a node from the <strong>Default<\/strong> drop-down list.<\/li>\n<li>To configure a conditional flow, 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 using one of these operators: Exists, equals to, greater than equals to, less than equals to, not equal to, greater than, and less than. Select the entity, operator using the respective drop-down lists, and type the number in the <b>Value <\/b>box. For example, <i>PassengerCount (entity) greater than (operator) 5 (specified value).<\/i><\/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.<\/li>\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n<div class=\"alert alert-info\"><b>Note:<\/b> If you want to write multiple <em>If<\/em> conditions, click <strong>Add Else If<\/strong> below the last <em>If<\/em> conditional expression.<\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<div class=\"w-post-elm post_navigation layout_simple inv_false\">\n\t<a class=\"post_navigation-item order_first to_prev\" href=\"https:\/\/developer.kore.ai\/v8-1\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-form-node\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Previous<\/div>\n<div class=\"post_navigation-item-title\"><span>Form Node<\/span><\/div>\n<p>\t<\/a><br \/>\n<a class=\"post_navigation-item order_second to_next\" href=\"https:\/\/developer.kore.ai\/v8-1\/v8-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-message-nodes\/\"><\/p>\n<div class=\"post_navigation-item-arrow\"><\/div>\n<div class=\"post_navigation-item-meta\">Next<\/div>\n<div class=\"post_navigation-item-title\"><span>Message (Bot Response) Nodes<\/span><\/div>\n<p>\t<\/a><\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<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><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"The Logic Node provides a simpler experience to developers, primarily business users to use context variables and define complex transition conditions. Its two primary functions are: Ability to manage variables and values of variables in the context object. Ability to define nested transition conditions. Add a Logic Node to the Dialog Task Open the dialog...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-23811","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/23811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/comments?post=23811"}],"version-history":[{"count":4,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/23811\/revisions"}],"predecessor-version":[{"id":26210,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/posts\/23811\/revisions\/26210"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/media?parent=23811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/categories?post=23811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-1\/wp-json\/wp\/v2\/tags?post=23811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}