# How to split requests

**URL:** <https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850>\
**Category:** IIQ Discussion and Questions\
**Created:** [April 18, 2022, 10:36am UTC](https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850 "2022-04-18T10:36:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LewisSPoint](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/lewisspoint/32/487_2.png) [@LewisSPoint](https://developer.sailpoint.com/discuss/u/LewisSPoint)\
**Post date:** [April 18, 2022, 10:36am UTC](https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850/1 "2022-04-18T10:36:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adam\_creaney](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/adam_creaney/32/8971_2.png) [@adam\_creaney](https://developer.sailpoint.com/discuss/u/adam_creaney)\
**Post date:** [April 18, 2022, 4:30pm UTC](https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850/2 "2022-04-18T16:30:41Z")

</div>

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](https://community.sailpoint.com/t5/Technical-White-Papers/Lifecycle-Manager-Workflows/ta-p/71301)

and

[LCM Subprocesses](https://community.sailpoint.com/t5/Technical-White-Papers/LCM-Subprocess-Workflows/ta-p/75856)

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

---

<div class="post-metadata">

**Author:** ![LewisSPoint](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/lewisspoint/32/487_2.png) [@LewisSPoint](https://developer.sailpoint.com/discuss/u/LewisSPoint)\
**Post date:** [April 19, 2022, 11:01am UTC](https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850/3 "2022-04-19T11:01:32Z")

</div>

Hello @adam_creaney and thank you for your quick response.

Our current variable in “approvalScheme” is a rule.

```auto
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?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:25pm UTC](https://developer.sailpoint.com/discuss/t/how-to-split-requests/3850/4 "2023-07-19T14:25:34Z")

</div>

Closed on July 19, 2023, 2:25pm UTC


