I can't get the Request Approval UI Action to Work

robinf_chadwick
Giga Contributor

We're on Istanbul Patch 9a

Am trying to insert new steps into our Change workflow to allow for assessment of risk before approvers are asked to approve changes.

I have added a stage in the Process Flow called assess_risk to show in the Process Formater

find_real_file.png

I have added a choice called Assess Risk to the state field for change requests

find_real_file.png

I have added 2 steps to the workflow to set the state to "Assess Risk" and then wait for the state to move to Assess (for approval)

find_real_file.png

find_real_file.png

find_real_file.png

The UI Action for Request Approval says this

find_real_file.png

When I click on the Request Approval button on the change record, nothing happens. However, when I manually change the state on the change form to assess, the workflow progresses and approvers are asked to approve the change.

Thanks In advance.

5 REPLIES 5

Tyler_MTech
Tera Contributor

When you set the value of a state from a script, you must use the value not the name of the state. In this situation you could either do:



current.state = 9;                   OR             current.setValue('state',9);



I got the 9 value from your second snippet. You shouldn't need to set the approval field in your UI Action. This should be handled in the workflow.


Thanks Tyler



I get that I should set the state in the workflow instead of the UI action.   I'm not sure how that will work in this case.


The process is as follows:


  • Fill in Change Record and Save it
  • Complete the Risk Assessment
  • Calculate Risk
  • Submit the Change for approval

I need the workflow to wait until the risk assessment and risk calculation is done before going to get approval.   Hence the Wait for condition in the workflow (see the image below).   Since the workflow is waiting for the state to be Assess, I need some kind of event that causes the state to change to that value.   I can have the user manually change the state from Assess Risk to Assess, which works fine, but was looking for something more intuitive to trigger the change in state. Hence the Request Approval button.



find_real_file.png


I don't see a problem with changing the state in the UI action. But the current.approval = 'requested'; seems like it would go better in the workflow.



We implemented the risk assessment a bit differently. Our first two states are Draft and Submitted. While in Draft you can edit the change request. After the initial save you get a UI Action called Risk Assessment which lets the user fill out a survey and then calculates the risk. We prevent them from moving forward by having an onSubmit script check if they have a value in the risk field.


That's great food for thought Tyler and has caused a change in direction.   i'm no longer using the Request Approval UI Action.


In the first Set Values action, I'm setting the state to Assess Risk and setting the Risk value to None.


The wait condition waits for the risk value to be any one of the possible values, other than none.   With the field read only, the only way to get a risk value in the field is to fill out the Risk Assessment and calculate the risk.