Additional Condition on Approval User Activity

Rishi18
Kilo Expert

Hi Everyone,

My requirement is to add another condition like 'Approved' and 'Rejected', called 'Partially-Approved' in the Approval User Activity,

so I have created the condition 'Partially-Approved' in the workflow activity

and added the same in Choices of State field on Approval(sys_approval_approver) table.

And in the condition field added : activity.result =='partially_approved'

Now, when I select approve or reject the workflow goes to the next activity but not when I select Partially Approved in the

approval table record, it gets stuck in the same activity and doesn't proceed.

I am sure I am missing something, I don't know how does the activity.result gets set to the state(like in case of approve and reject)

Can someone please help me on this.

Thanks in advance

1 ACCEPTED SOLUTION

The workflow approval activity will return Approved or Rejected, regardless of the extra choice.



In your Approval - User workflow activity, you need to switch to a script to monitor results:


Screen Shot 2018-01-23 at 3.00.32 PM.png



Then find the business rule: SNC - Run parent workflows (Approval), and duplicate it.


Change the condition to be: current.state.changesTo('partially_approved')



Test it out


View solution in original post

12 REPLIES 12

Michael Fry1
Kilo Patron

There are 2 business rules named: SNC - Run parent workflows (Approval) - with different conditions. You will need to modify the one and add your new state into the conditions.


Hi Michael,



Thanks for the reply, I didn't understand how modifying the condition will help me, but I tried it anyway and added



|| current.state.changesTo('partial_approval') in the condition of the Business Rule "SNC - Run parent workflows (Approval)"



and it didn't work.



Can you please elaborate on this one, how this will work? do I have to change the script includes   WorkflowApprovalUtils, Workflow etc?


The business rule should trigger the workflow to continue if the activity results matches.



Make sure the value on your new choice is lower case.


I am not sure how activity results are calculated, is it simply the value of new state on approval record?


The new choice value is in lower case only and condition is added to the "SNC - Run parent workflows (Approval)" still no luck.