{"id":1017,"date":"2022-02-08T19:50:13","date_gmt":"2022-02-08T19:50:13","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=1017"},"modified":"2022-08-10T16:36:10","modified_gmt":"2022-08-10T16:36:10","slug":"call-service","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/call-service\/","title":{"rendered":"Call Service"},"content":{"rendered":"<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p><a name=\"abstract\"><\/a>Requires deployed extension&nbsp;<a href=\"https:\/\/integroscrm.com\/lb-components\/\" rel=\"noreferrer noopener\" target=\"_blank\">LB Services<\/a>&nbsp;into Sugar Environment.<\/p>\n<p>LB Services is used to call logic configured with a flowchart:<\/p>\n<ul>\n<li>from another flowchart<\/li>\n<li>from SugarBPM<\/li>\n<li>from an external system through Sugar REST API<\/li>\n<li>from custom code (e.g. buttons)<\/li>\n<\/ul>\n<\/div>\n\n\n<p>Calls Service from the flowchart. Allows calling a flowchart from the other flowchart. Useful when the same logic is repeated in several flowcharts, so repetitive logic can be separated into flowchart and then called when needed. Also can be used to separate one complex logic into several sub-logics, when instead of one enormous flowchart it will be several smaller and easier to read.<\/p>\n\n\n\n<p>A flowchart that implements a selected service is called when a flow reaches the operator <span style=\"color:#ec8f45;\">Call Service<\/span> and provides a result if the <span style=\"color:#6888c9;\"><em>result <\/em><\/span>was defined.<\/p>\n\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#9ed267;\">service name<\/span> &#8211; select service to call from the list. The list is composed of the records of LB Services Module from Sugar which metadata was imported to the current project.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p>select service arguments that were defined for this service in the record of LB Services Module in the following dropdowns and link them with its values.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: no<\/li><\/ul>\n\n\n\n<p><strong>outputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#6888c9;\">result<\/span> &#8211; value that was set in called service in <span style=\"color:#6888c9;\"><em>result<\/em><\/span> input port of <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-service-result\/\">Set Service Result<\/a><\/p>\n\n\n\n<p><em>Example of usage<\/em><\/p>\n\n\n\n<p>Let\u2019s say there are a bunch of flowcharts with the same steps to create a Task. Instead of performing the same steps in each flowchart, it is possible to create the Service and then re-use it.<\/p>\n\n\n\n<p>Step 1 &#8211; Register Service in Sugar.<\/p>\n\n\n\n<p>For this, just create a record in LB Services module and provide arguments that are needed to be filled to create Task:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-8e92608843c9471a9a37eafd4d8dfd5f-1024x213.png\" alt=\"\" class=\"wp-image-981\" width=\"762\" height=\"159\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-8e92608843c9471a9a37eafd4d8dfd5f-1024x213.png 1024w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-8e92608843c9471a9a37eafd4d8dfd5f-300x62.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-8e92608843c9471a9a37eafd4d8dfd5f-768x160.png 768w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-8e92608843c9471a9a37eafd4d8dfd5f.png 1254w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/figure>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>N.B. Each time you add a new Service into Sugar it is needed to update the Metadata in the Logic Builder project to work with the newly added Service.<\/p>\n<\/div>\n\n\n<p>Step 2 &#8211;&nbsp;Crete a Flowchart starting from On Service Call to create a Task using parameters that will be input in the Service. In a result input the Task ID.<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-49e7a806f67d424c9f2d664b7940da65.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-49e7a806f67d424c9f2d664b7940da65-1024x294.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n\n\n<p>Step 3 &#8211; Deploy the flowchart into Sugar. Now you can use created Service in other flowcharts, e.g when Case with Type Product is added.&nbsp;Also, it is possible to link the Task to other entities using result output port from the Call Service:<\/p>\n\n\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-f54a0198fcd04d66b0b7b6cecaddbaa7.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-135-f54a0198fcd04d66b0b7b6cecaddbaa7-1024x291.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p><div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_1017' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-1017\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-98ec466931cf9' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-98ec466931cf9'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='1017' \n                                      data-rating='0'\n                                      data-rater-starsize='24'\n                                      data-rater-readonly='false'\n                                      data-rater-nonce='60508256f2' \n                                      data-issingular='false'\n                                    ><\/div><div class=\"yasr-vv-stats-text-container\" id=\"yasr-vv-stats-text-container-98ec466931cf9\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"1017\" \n                               id=\"yasr-stats-dashicon-98ec466931cf9\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-98ec466931cf9\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-98ec466931cf9\">0<\/span>  Average: <span id=\"yasr-vv-average-container-98ec466931cf9\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-98ec466931cf9' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-98ec466931cf9' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Requires deployed extension&nbsp;LB Services&nbsp;into Sugar Environment. LB Services is used to call logic configured with a flowchart: from another flowchart from SugarBPM from an external system through Sugar REST API from custom code (e.g. buttons) Calls Service from the flowchart. Allows calling a flowchart from the other flowchart. Useful when the same logic is repeated &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/call-service\/\"> <span class=\"screen-reader-text\">Call Service<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"tags":[],"class_list":["post-1017","page","type-page","status-publish","hentry"],"yasr_visitor_votes":{"number_of_votes":0,"sum_votes":0,"stars_attributes":{"read_only":false,"span_bottom":false}},"_links":{"self":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/comments?post=1017"}],"version-history":[{"count":4,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1017\/revisions"}],"predecessor-version":[{"id":2114,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1017\/revisions\/2114"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=1017"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=1017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}