How to split requests

Hello,

We are working on a custom workflow for approvals and we have an issue with the split requests.

If we have: <Variable initializer="any" input="true" name="approvalMode"> and the user sends a request with two or more approvers in the same request, the request travels as one and will be approved or rejected for any of the approvers even if the approver is not an owner of the entitlement.

Please, anyone can help me with how to split the requests when the initializer is equal to “any” and there are different requests with different approvers?.

Thank you so much in advance.

Hi Luis, there are a couple control variables for how approvals behave in the LCM Provisioning workflow.

Have you had a change to review the guides on this workflow (and its subprocesses) on Compass?

LCM Workflows

and

LCM Subprocesses

What is your current variable for ‘approvalScheme’ set to?

Hello @adam_creaney and thank you for your quick response.

Our current variable in “approvalScheme” is a rule.

import sailpoint.object.Identity;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import sailpoint.object.ApprovalSet;
import sailpoint.object.ApprovalItem;
import sailpoint.workflow.IdentityApprovalGenerator;
import sailpoint.object.Workflow;
import sailpoint.object.Workflow.Approval;
import sailpoint.object.ApprovalSet;
import sailpoint.object.WorkItem.State;
import sailpoint.object.WorkflowLaunch;
import sailpoint.object.*;
import sailpoint.api.SailPointContext;

String identityName = workflow.get("identityName");
Identity identity = context.getObjectByName(Identity.class, identityName);
boolean hasOwner = false;
String salida = "none";

if (plan != null) {
	List listRequest = plan.getAllRequests();

	try {
		for (AccountRequest request: listRequest) {			
		if(listAttrReq == null){ continue;}

			if(AccountRequest.Operation.Modify.equals(request.getOperation())){
				
				List listAttrReq = request.getAttributeRequests();				
				String appName = request.getApplication(); 											
				
				for(AttributeRequest attRq : listAttrReq){
					if(attRq.getOperation() == ProvisioningPlan.Operation.Add){

						QueryOptions qo = new QueryOptions();
						qo.addFilter(Filter.eq("value", attRq.getValue()));
						
						List listManaged = context.getObjects(ManagedAttribute.class, qo);

						if(appName.equalsIgnoreCase("IIQ")){							
                                                salida = "owner,securityOfficer";
						}						
						if(listManaged == null){ continue;}
						for (ManagedAttribute ma : listManaged){																											
							Identity owner = ma.getOwner();					
							if(owner != null){								
                	                                salida = "owner,securityOfficer";
							}else{
								Identity manager = identity.getManager();
								salida = "manager,owner,securityOfficer";
							}
						}
					}
				}													
			}					
		}		
	} 
	catch (Exception e) {
		log.trace("Error:: "+e.getMessage());
	}    
}

return salida;

Could we add something here to split the plan and send individual requests?