How do I get to the Approval - Group's actual group value from a sysapproval_approver record?

treycarroll
Giga Guru

I want to find the approval group for a sysapproval_approver record that was created from a Approval - Group WF Activity.     Though I can get from the approval to the wf_activity, I'm not seeing how to get to the actual values that were filled in on the WF activity form.

6 REPLIES 6

rajesh73_k
Kilo Expert

Hi,


"sysapproval_group" in this table you can find the group name of the approver.



Regards


Rajesh


treycarroll
Giga Guru

What I'm trying to do here is to look up how approvals got created.  



Some of my service catalog approvals will be ad hoc, others will be created via Approval - User WF activities, others will come from Approval - Group activities.  



If they come from Approval - Group activities, I want to move from the approval back to the Approval - Group activity that created that approval, so I can see what the settings on that activity are: specifically I want to know if a single approval from a group member will result in the activity advancing, or if all group members' approvals are required.



Thanks,



Trey


Hi Trey


Probably you may want to look at sysapproval_approver.group field which is a reference to sysapproval_group (Group Approval) table from sysapproval_approver (User Approval). This is the path you should go to get to the Group Approvals.



There is inactive field wf_activity in both sysapproval_group, sysapproval_approver tables. This field point to the workflow activity (Group Approval in your case). I guess this is the real think you are seeking and good news - you can access that Group Approval workflow activity even from sysapproval_approver table (just activate the field but make sure no one except admins can modify it). In the end, walking the path sysapproval_approver.wf_activity you will be to land on the workflow activity definition.



However I do not personally see any advantage of going there as the workflow fully controls Group Approval wf activity and you'll do not need to put your hands on it What I mean is that depending on our approval strategy (defined in the workflow) you will get the desired result. Can you explain a bit more on what you are trying to achieve knowing if a single approval from a group member will result in the activity advancing, or if all group members' approvals are required? I suspect you want to know that when something happens with the User Approval? Probably when user approves the request? Kind of letting the user know if someone else should still approve the request? In thank case, maybe it would be just enough to have "After" BR over sysapproval_approver table running with order higher than 1000 which would check the state of the parent Group Approval (sysapproval_approver.group) taskL if Group Approval is inactive then Group Approval activity is over, else tt still waits for more approvals.


Hi Nikita,



Thanks for the background information.     + 1 for the helpful answer.  



I think that I'm almost there.   I figured out how to use



current.wf_activity.activity_definition.name



successfully (from sysapproval_approver) to get to the name of the activity, such as "Approval - Group", but I am still lacking one piece.       I don't really want to pick properties off of the Activity Definition, more like the "workflow activity instance" (I'm pretty sure I just made that up, but it communicates the idea.)   While the features of the definition (like the name) are static and defined only once, there will be many instances for the state of "wait for", created each time someone adds the "Approval - Group" activity to a WF and sets these properties.



To be specific, I need to be able to get the value from this drop down:



Screenshot 2015-02-23 at 10-2.png



In case anyone is wondering why I would ever want this...   I'm trying to craft a notification which tells the user "Your item is pending approvals from these people..."     In one case, the notification will say   "Only one of these people needs to approve."     Or alternatively, "All of the following users must approve your request."



Thanks In Advance,



Trey Carroll