{"id":23811,"date":"2020-07-03T16:49:20","date_gmt":"2020-07-03T15:49:20","guid":{"rendered":"https:\/\/developer.kore.ai\/?p=23811"},"modified":"2021-08-03T12:37:17","modified_gmt":"2021-08-03T11:37:17","slug":"working-with-the-logic-node","status":"publish","type":"post","link":"https:\/\/multisite.korebots.com\/v9-0\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-logic-node\/","title":{"rendered":"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 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>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<\/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 a logic 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 Logic node.<\/li>\n<li>Add logic 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 Logic window is displayed with the <strong>Component Properties<\/strong> tab selected by default.<\/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\"><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=\"wpb_text_column\"><div class=\"wpb_wrapper\"><h3 id=\"d-step2\"><span class=\"ez-toc-section\" id=\"Component_Properties\"><\/span>Component Properties<span class=\"ez-toc-section-end\"><\/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=\"\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">Managing Namespace<\/a>.<\/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><span class=\"ez-toc-section\" id=\"Instance_Properties\"><\/span>Instance Properties<span class=\"ez-toc-section-end\"><\/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 that use this 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=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\">Click here for more<\/a><\/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><span class=\"ez-toc-section\" id=\"Connections_Properties\"><\/span>Connections Properties<span class=\"ez-toc-section-end\"><\/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<\/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]JTNDZGl2JTIwY2xhc3MlM0QlMjJ3LXBvc3QtZWxtJTIwcG9zdF9uYXZpZ2F0aW9uJTIwbGF5b3V0X3NpbXBsZSUyMGludl9mYWxzZSUyMiUzRSUwQSUwOSUzQ2ElMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtJTIwb3JkZXJfZmlyc3QlMjB0b19wcmV2JTIyJTIwaHJlZiUzRCUyMiUyRmRvY3MlMkZib3RzJTJGYm90LWJ1aWxkZXItdG9vbCUyRmRpYWxvZy10YXNrJTJGd29ya2luZy13aXRoLXRoZS1mb3JtLW5vZGUlMkYlMjIlM0UlM0MlMkZwJTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS1hcnJvdyUyMiUzRSUzQyUyRmRpdiUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tbWV0YSUyMiUzRVByZXZpb3VzJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS10aXRsZSUyMiUzRSUzQ3NwYW4lM0VGb3JtJTIwTm9kZSUzQyUyRnNwYW4lM0UlM0MlMkZkaXYlM0UlMEElM0NwJTNFJTNDJTJGYSUzRSUzQ2JyJTIwJTJGJTNFJTBBJTNDYSUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0lMjBvcmRlcl9zZWNvbmQlMjB0b19uZXh0JTIyJTIwaHJlZiUzRCUyMiUyRmRvY3MlMkZib3RzJTJGYm90LWJ1aWxkZXItdG9vbCUyRmRpYWxvZy10YXNrJTJGd29ya2luZy13aXRoLXRoZS1tZXNzYWdlLW5vZGVzJTJGJTIyJTNFJTNDJTJGcCUzRSUwQSUzQ2RpdiUyMGNsYXNzJTNEJTIycG9zdF9uYXZpZ2F0aW9uLWl0ZW0tYXJyb3clMjIlM0UlM0MlMkZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLW1ldGElMjIlM0VOZXh0JTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS10aXRsZSUyMiUzRSUzQ3NwYW4lM0VNZXNzYWdlJTIwJTI4Qm90JTIwUmVzcG9uc2UlMjklMjBOb2RlcyUzQyUyRnNwYW4lM0UlM0MlMkZkaXYlM0UlMEElM0NwJTNFJTNDJTJGYSUzRSUzQyUyRmRpdiUzRQ==[\/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":"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. Set-Up Setting up a logic node in a dialog task involves...","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\/23811"}],"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=23811"}],"version-history":[{"count":20,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/23811\/revisions"}],"predecessor-version":[{"id":29384,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/posts\/23811\/revisions\/29384"}],"wp:attachment":[{"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/media?parent=23811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/categories?post=23811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisite.korebots.com\/v9-0\/wp-json\/wp\/v2\/tags?post=23811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}