Hello,
For our client we have implemented Access roles with custom field containing the approvers. Please find screenshot below for same :-

Approver 1 here contains the value which corresponds to the location attribute of the approver.
Approver 2 here contains value of Access Role.
It is to be noted that Value in these two above mentioned attributes are different for different roles.
Client wants us to implement workflow approval on "AssignAccessRoleEvent" in a way that approvers are resolve based on the entries in the above mentioned field for the role requested in task. That is suppose a user requests role "T_FIL_AD_Basis_0904" then approvers should be resolved as the users which have location attribute as 0904 and are members of access role T_App_Basic.
For this we are trying to implement a custom participant resolver. We have gone through the sample code shipped with product. Taking cues from that we are trying to code below but we are facing following issues :-
1. Since this is a user event (AssignAccessRoleEvent) , how can we fetch the Access role which is being requested in the task?
2. Suppose we are able to fetch the role as well , then to fetch the approver attribute will this statement work :-
String approver1= role.getCustomField(01);
String approver1= role.getAttribute("custom01");
3. The search expression that we have coded is as follows:-
SearchExpression exp= new SearchExpression("roomNumber", OperatorType.EQUALS, approver1);
SearchExpression exp1= new SearchExpression("imString02", OperatorType.CONTAINS, approver2);
Vector searcVector=new Vector();
searcVector.addElement(exp);
searcVector.addElement(exp1);
Can we use this for finding users in directory ?
Sample code can be like this-- user.getUserProvider().findUsers(searcVector, , _attributes.elements());
or is there better way of doing this because it says we need to include OrganizationConstraint in here as second argument. And this also does not take searcVector as argument as it is not UserFilter type.
What can be the best approach to constitute the search query here ?
Can anyone here help us in this customized code requirement? Any assistance is highly appreciated.
Thanks,
Shashank