The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to make RITM workflow wait for Request Approval in Order Guide

Bruler1230
Tera Expert

Hello,

 

I have an order guide that requires approval, which will be done in the sc_request workflow. Depending on what the user chooses, there could up to 3 RITMs that come out of this order guide. Each RITM has its own workflow. The problem i am having is how to make the RITMs workflow not run until the approval is complete in the Request workflow. Right now, as soon as i submit the order guide, the Request workflow is waiting for approval, but the RITMs start running through their workflows before the approval is granted. Do i need to put some kind of wait for condition at the beginning of the RITM workflows? Is it possible to get values from the Request workflow into the RITM workflow? Does anyone have any ideas of how i could handle this?

 

thanks

13 REPLIES 13

actually..nevermind, disregard that last question. I figured that out. My next problem is that the RITM is getting stuck on the wait condition. It wont move past this point. I have read that I have to update the RITM somehow, but not sure how to do that. Business rule? or can it be done in the workflow itself?

Do you mean the wait for condition stuck in RITM workflow after adding the above script? If yes, Request has to be approved for RITM workflow to proceed to next activity.

The wait for condition in the RITM is hit as soon as the order guide is submitted, so once the request is approved, how would I make the RITM workflow hit the wait for condition again? Do I have to update the RITM workflow somehow? Right now it just sits there forever.

Bishnu Prasad
Kilo Explorer

It’s a workaround instead of configuring approval on Request level.

Lets say we have 2 RITMs under an Order guide, you want to run the approvals/not to set approvals of 2nd RITM based on first RITM.

Create a business rule to query the current request number in requested item table, condition =   after update.

Sample  :

var item1 = current.cat_item.getDisplayValue();

                if (item == 'First item name where you want to put approval’)

                                {

                                                var REQ = current.request.sys_id;

                                                var stage = current.stage;

                                               

                                                if(stage == 'fulfillment')

                                                                {

                                                                                var item2 = new GlideRecord('sc_req_item');

                                                item2.addQuery('request',REQ);

                                                item2.addQuery('short_description','2nd item name, where ');

                                                item2.query();

                                                if(item2.next())

                                                                {

                                                                               

                                                                                var number = item2.number;

                                                                                item2.state = '168'; // it will set the 2nd RITM’s state into In progress

                                                                                item2.update();

                                                       }

                                                      }

 Now in 2nd RITM’s workflow, put a timer of your choice, and check for the condition (if state == ‘In progress), so once the first RITM will be approved, it will set the 2nd RITM state into In progress and hence your tasks will be triggered without asking for any approval.

 

 

find_real_file.png

So, in short you will have to approve your One RITM , and for rest of RITMs you can directly create catalog tasks.