<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question execution order of ritm in a order guide in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829397#M401176</link>
    <description>&lt;P&gt;hi all, i wan to control the execution stages of requested items in service catalog via flow design? can anyone help me. like first will be id creation. after the sctask is set to close complete then laptop request should show , after laptop sctask is set to close complete then the next ritm will show like this. i want this to be done in flow design.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 11:42:24 GMT</pubDate>
    <dc:creator>RC12</dc:creator>
    <dc:date>2021-07-22T11:42:24Z</dc:date>
    <item>
      <title>execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829397#M401176</link>
      <description>&lt;P&gt;hi all, i wan to control the execution stages of requested items in service catalog via flow design? can anyone help me. like first will be id creation. after the sctask is set to close complete then laptop request should show , after laptop sctask is set to close complete then the next ritm will show like this. i want this to be done in flow design.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 11:42:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829397#M401176</guid>
      <dc:creator>RC12</dc:creator>
      <dc:date>2021-07-22T11:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829398#M401177</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Flow design supports stages. But you have it add it differently. Refer this article to configure stages in Flow designer.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/flow-designer/task/add-stages.html"&gt;https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/flow-designer/task/add-stages.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Palani&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 12:57:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829398#M401177</guid>
      <dc:creator>palanikumar</dc:creator>
      <dc:date>2021-07-22T12:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829399#M401178</link>
      <description>&lt;P&gt;You would need to create (most likely hidden) variables that act as a pause at the very beginning of each flow. Then whenever a catalog item is closed, it must look up (best in a business rule) those other requested items that might be waiting for it to finish and update that flag, signaling the appropriate flow, that it is good to continue.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 13:01:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829399#M401178</guid>
      <dc:creator>-O-</dc:creator>
      <dc:date>2021-07-22T13:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829400#M401179</link>
      <description>&lt;P&gt;I mean in the Laptop request you would need a hidden-flag-variable (perhaps called &lt;EM&gt;ID created&lt;/EM&gt;) that had the initial value &lt;EM&gt;false&lt;/EM&gt; and the Flow for it had as the first step a wait one. The condition would be wait till the hidden-flag-variable &lt;EM&gt;ID created&lt;/EM&gt; is false.&lt;/P&gt;
&lt;P&gt;Then you would need a BR on Requested Item (or perhaps Catalog Task) that would be triggered when the Requested Item (or a specific Catalog Task) is closed, would look up the Laptop request under the same parent Request and would update its hidden-flag-variable ID created to &lt;EM&gt;true&lt;/EM&gt;. That would let the Laptop Flow go on.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 13:06:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829400#M401179</guid>
      <dc:creator>-O-</dc:creator>
      <dc:date>2021-07-22T13:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829401#M401180</link>
      <description>&lt;P&gt;if you could give me the script i would be obliged. i am very new to this.if u could help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 15:43:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829401#M401180</guid>
      <dc:creator>RC12</dc:creator>
      <dc:date>2021-07-22T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: execution order of ritm in a order guide</title>
      <link>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829402#M401181</link>
      <description>&lt;P&gt;Something like this might do it:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;	var sys_id_of_common_request = 'a0005bc10721741043e9f7d08c1ed081';
	var sys_id_of_catalog_item_waiting_for_user = 'b3f90f4507ed341043e9f7d08c1ed0b9';
	var name_of_flag_variable = 'user_has_been_created';

	update_flag_variable(sys_id_of_common_request, sys_id_of_catalog_item_waiting_for_user, name_of_flag_variable);
	nudge_flow_by_adding_a_useless_work_note(sys_id_of_common_request, sys_id_of_catalog_item_waiting_for_user);

	function update_flag_variable (sc_request‿sys_id, sc_cat_item‿sys_id, item_option_new‿name) {
		var sc_item_option = new GlideRecord('sc_item_option');

		var jq = sc_item_option.addJoinQuery('sc_item_option_mtom', 'sys_id', 'sc_item_option');

		jq.addCondition('item_option_new.name', item_option_new‿name);
		jq.addCondition('request_item.request', sc_request‿sys_id);
		jq.addCondition('request_item.cat_item', sc_cat_item‿sys_id);

		sc_item_option._query();

		while (sc_item_option._next()) {
			sc_item_option.value = true;
			sc_item_option.update();
		}
	}

	function nudge_flow_by_adding_a_useless_work_note (sc_request‿sys_id, sc_cat_item‿sys_id) {
		var sc_req_item = new GlideRecord('sc_req_item');

		sc_req_item.addQuery('request', sc_request‿sys_id);
		sc_req_item.addQuery('cat_item', sc_cat_item‿sys_id);

		sc_req_item._query();

		while (sc_req_item._next()) {
			sc_req_item.work_notes = gs.getMessage('User creation is done.');
			sc_req_item.update();
		}
	}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here you would have a checkbox variable named &lt;EM&gt;user_has_been_created&lt;/EM&gt; in the Laptop requested item, that would be hidden and &lt;EM&gt;false&lt;/EM&gt; by default. An the 1st step in its Flow (or the 1st action in its Workflow) would be a Wait Condition for that variable being &lt;EM&gt;true&lt;/EM&gt;. Of course you can name your variable whatever you want, just update it in the code.&lt;/P&gt;
&lt;P&gt;In the the user creation Flow or Workflow you would execute the code above, adjusting of course, the variable values to match real life conditions. If you need to signal several sibling catalog items that the user creation is done, repeat the two function calls for each requested item - in fact for each catalog item of each requested item; don't forget to also update the name of the flag variable - if needed.&lt;/P&gt;
&lt;P&gt;E.g:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;update_flag_variable(sys_id_of_common_request, sys_id_of_catalog_item_1, name_of_flag_variable);
nudge_flow_by_adding_a_useless_work_note(sys_id_of_common_request, sys_id_of_catalog_item_1);

update_flag_variable(sys_id_of_common_request, sys_id_of_catalog_item_2, name_of_flag_variable_2);
nudge_flow_by_adding_a_useless_work_note(sys_id_of_common_request, sys_id_of_catalog_item_2);

update_flag_variable(sys_id_of_common_request, sys_id_of_catalog_item_n, name_of_flag_variable_n);
nudge_flow_by_adding_a_useless_work_note(sys_id_of_common_request, sys_id_of_catalog_item_n);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Before doing all that, 1st update the &lt;EM&gt;Requested for&lt;/EM&gt; field of the &lt;EM&gt;Request&lt;/EM&gt; to the newly created user. Otherwise all requested items would be ordered for the person who submitted the order guide.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 10:08:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/execution-order-of-ritm-in-a-order-guide/m-p/829402#M401181</guid>
      <dc:creator>-O-</dc:creator>
      <dc:date>2021-07-23T10:08:29Z</dc:date>
    </item>
  </channel>
</rss>

