Approval Group : Condition based script

Raghu Loganatha
Kilo Guru

Hi,

I added a new condition on the Approval Group workflow activity called "Need More Info"( Ref: Image 1).   Assume a scenario where there are 5 different approval groups in the request and now here is the requirement.

a) When some one clicks on "Approve"   on one from the requested approvals remaining approval requests from that group should be changed to "No Longer Required" and wait for update on other groups. When one from each group is approved then answer = 'approved'.

b) When anyone from any group "Rejects" then answer = "reject".

c) When anyone from any group clicks "Need More Info" then answer = "Need More Info".

Ca you help me with the Condition based script for this requirement ? Your help is much appreciated.

1)

Screen Shot 2017-07-25 at 11.20.37 AM.png

Thanks,
~Raghu.

4 REPLIES 4

Raghu Loganatha
Kilo Guru

Even if you change the Wait for in the Approval Group workflow activity to Condition Based on Script, it's still expecting either Approved or Rejected. Not sure there is an option to add another condition: Approval - Group workflow activity


I don't think we can add an option on wait condition. But we can chose wait for script based condition and write script to return "need more info". My current issue is that i have to write condition where if any one approval record changes to "Need More Info" state i should return "need more info".


Javier Arroyo
Kilo Guru

Need More Info needs to be broadcasted to the workflow.



OOB only "approved", "rejected" and "skipped" are handled at the Approval Level, other state changes must be broadcasted.    



if Need More Info approval state has already been defined at the sysapprover_approval object, then copy and paste Business Rule Run parent workflows (Approval) to fire when More Info is selected.


Perhaps it is also a good idea to adjust any needed sibling approvals to display the state of More Info Requested within that business rule



A combo from the below should do it



var util = new WorkflowApprovalUtils();


var msg= "some message or comments";



util.setGroupApprovalsByTask(current.sysapproval.sys_id, 'more_info_required', msg);


util.setUserApprovalsByTask(current.sysapproval.sys_id,'more_info_required', msg);