Bernardc
(Bernard Chiew)
January 24, 2026, 5:22am
1
Which IIQ version are you inquiring about?
8.4
Hi Sailors,
I am getting below error when the access request adding entitlement to identity is completed.
An unexpected error occurred: The collection, array, map, iterator, or enumeration portion of a for statement cannot be null. : at Line: 19
Found out the error happened during execution of below block of code in ApproveAndProvisionSubprocess :
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.ObjectRequest;
import sailpoint.object.ManagedAttribute;
import sailpoint.object.ManagedAttribute.Type;
import sailpoint.integration.*;
import sailpoint.api.ManagedAttributer;
import sailpoint.object.Application;
import java.util.*;
import sailpoint.workflow.*;
Boolean provisioningFailed = false;
System.out.println("Entitlement Request Project = " + project.toXml());
//System.out.println("Start getting result");
//List <ProvisioningPlan> pplans = project.getPlans();
//System.out.println("List provisioning plan " + pplans);
//System.out.println("pplans.size = " + pplans.size());
for(ProvisioningPlan pplan: project.getPlans()){ // <<<<< error happen here
for(AccountRequest acr : pplan.getAccountRequests()){
if(acr.getResult() != null){
if(acr.getResult().getStatus().equalsIgnoreCase("Failed")){
wfcontext.setVariable("trackingId", acr.getArguments().get("provisioningTransactionId"));
//System.out.println("Provisioning failed");
return true;
}
}
}
}
return false;
Clearly it was because the pplan is null causing this error, wonder what could cause the pplan a null
amit_1140
(Amit Kumar)
January 24, 2026, 7:16am
2
@Bernardc -
it’s not “pplan is null” — it’s project.getPlans() returning null. So the real question becomes: why would project.getPlans() be null at that point in ApproveAndProvisionSubprocess?
Do you see anything printed on logs when the code is executing below lines -
System.out.println("Entitlement Request Project = " + project.toXml());
Also, Is there any customization done from your end for this sub process?
Awaiting your response
Bernardc
(Bernard Chiew)
January 24, 2026, 7:26am
3
Hi @amit_1140 ,
Thanks for the clarification. Yes, there is something printed:
Entitlement Request Project = <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE ProvisioningProject PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<ProvisioningProject identity="Chiew, Desmond">
<Attributes>
<Map>
<entry key="disableRetryRequest">
<value>
<Boolean>true</Boolean>
</value>
</entry>
<entry key="optimisticProvisioning" value="false"/>
<entry key="requester" value="spadmin"/>
<entry key="source" value="LCM"/>
</Map>
</Attributes>
<MasterPlan>
<ProvisioningPlan trackingId="eaef9939649d424faaf38ea42d19bcdc">
<Attributes>
<Map>
<entry key="identityRequestId" value="0000000192"/>
<entry key="requester" value="spadmin"/>
<entry key="source" value="LCM"/>
</Map>
</Attributes>
<ProvisioningTargets>
<ProvisioningTarget application="Active Directory" assignmentId="8811943568d446f583d38e01ca76749e" attribute="memberOf" value="CN=RDS Endpoint Servers,CN=Builtin,DC=masked,DC=info">
<AccountSelection applicationId="0ac9c80298161dfd8198179fbba90235" applicationName="Active Directory" selection="CN=Desmond Chiew,OU=masked,DC=acw,DC=info">
<AccountInfo displayName="CN=Desmond Chiew,OU=masked,DC=acw,DC=info" nativeIdentity="CN=Desmond Chiew,OU=masked,DC=acw,DC=info"/>
</AccountSelection>
</ProvisioningTarget>
</ProvisioningTargets>
<Requesters>
<Reference class="sailpoint.object.Identity" id="0ac9c803981619c28198165a74e900ff" name="spadmin"/>
</Requesters>
</ProvisioningPlan>
</MasterPlan>
<ProvisioningTarget application="Active Directory" assignmentId="8811943568d446f583d38e01ca76749e" attribute="memberOf" value="CN=RDS Endpoint Servers,CN=Builtin,DC=masked,DC=info">
<AccountSelection applicationId="0ac9c80298161dfd8198179fbba90235" applicationName="Active Directory" selection="CN=Desmond Chiew,OU=masked,DC=acw,DC=info">
<AccountInfo displayName="CN=Desmond Chiew,OU=masked,DC=acw,DC=info" nativeIdentity="CN=Desmond Chiew,OU=masked,DC=acw,DC=info"/>
</AccountSelection>
</ProvisioningTarget>
</ProvisioningProject>
Yes, this is an custom step I manually created in this subprocess as preparation for next step for notification
amit_1140
(Amit Kumar)
January 24, 2026, 7:37am
4
Hi @Bernardc -
If you closely observe the output, there is no plan Object inside your Project.
Your ProvisioningProject has a MasterPlan, but it has no Plans section. That’s why:
project.toXml() prints a valid project (so project is not null)
but project.getPlans() returns null , because no executable ProvisioningPlan list was generated.
This usually happens when plan compilation / expansion hasn’t occurred yet.
Could you share the full custom workflow for further troubleshooting the issue.
Thank you!
can you try the below code ?? he issue is that project.getPlans() is returning null instead of an empty list or a list with plans. Looking at your XML output, the project has a MasterPlan but no plans collection .
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.ObjectRequest;
import sailpoint.object.ManagedAttribute;
import sailpoint.object.ManagedAttribute.Type;
import sailpoint.integration.*;
import sailpoint.api.ManagedAttributer;
import sailpoint.object.Application;
import java.util.*;
import sailpoint.workflow.*;
Boolean provisioningFailed = false;
System.out.println("Entitlement Request Project = " + project.toXml());
List<ProvisioningPlan> pplans = project.getPlans();
// Add null check
if (pplans != null && !pplans.isEmpty()) {
for(ProvisioningPlan pplan : pplans) {
for(AccountRequest acr : pplan.getAccountRequests()) {
if(acr.getResult() != null) {
if(acr.getResult().getStatus().equalsIgnoreCase("Failed")) {
wfcontext.setVariable("trackingId", acr.getArguments().get("provisioningTransactionId"));
return true;
}
}
}
}
} else {
// If plans is null, check the masterPlan instead
ProvisioningPlan masterPlan = project.getMasterPlan();
if (masterPlan != null) {
for(AccountRequest acr : masterPlan.getAccountRequests()) {
if(acr.getResult() != null) {
if(acr.getResult().getStatus().equalsIgnoreCase("Failed")) {
wfcontext.setVariable("trackingId", acr.getArguments().get("provisioningTransactionId"));
return true;
}
}
}
}
}
return false;
msingh900
(Manish Singh)
January 24, 2026, 9:08am
6
Always perform a null check before looping.
Use the below code and try
Boolean provisioningFailed = false;
List plans = project.getPlans();
if (plans == null) {
plans = new ArrayList(); // avoid null in for-loop
}
for (ProvisioningPlan pplan : plans) {
List accReqs = pplan.getAccountRequests();
if (accReqs == null) {
accReqs = new ArrayList();
}
for (AccountRequest acr : accReqs) {
if (acr.getResult() != null &&
"Failed".equalsIgnoreCase(acr.getResult().getStatus())) {
wfcontext.setVariable(
"trackingId",
acr.getArguments().get("provisioningTransactionId")
);
return true;
}
}
}
return false;
1 Like
msingh900
(Manish Singh)
January 24, 2026, 9:09am
7
@Bernardc Try this and let me know.