Setting sunset date and provision entitlements through a standalone rule

Which IIQ version are you inquiring about?

8.4

Share all details about your problem, including any error messages you may

Is there anyway that I can write a standalone rule to provision entitlements with a sunset date? I have tried the following below but the date is not getting created. Am I missing anything?

SimpleDateFormat sdf=new SimpleDateFormat("ddMMyyyy");
	 String stringDate = "30112024";
   Date sunset = sdf.parse(stringDate);
  
   		ProvisioningPlan sfPlan = new ProvisioningPlan();
      sfPlan.setIdentity(identity);
  
    		AccountRequest accountRequest = new AccountRequest();
        accountRequest.setApplication(appName);
        accountRequest.setOperation(AccountRequest.Operation.Modify);
        accountRequest.setNativeIdentity(nativeIdentity);
        AttributeRequest attrReq = new AttributeRequest(entName, ProvisioningPlan.Operation.Add, entValue); 
    		attrReq.setRemoveDate(sunset);
  
        Attributes attrb = new Attributes();
        attrb.put("assignment","true");
        attrReq.setArgs(attrb);      

        accountRequest.add(attrReq);

        sfPlan.add(accountRequest);
  
    	Provisioner provisioner = new Provisioner(context);
      provisioner.setNoLocking(true);
      ProvisioningProject project = provisioner.compile(sfPlan);

      provisioner.execute(project);
  context.saveObject(identity);
      context.commitTransaction();
      context.decache(identity);

Hi @infamous,

into the plan that you have generated, is there the remove date attribute?

Also but I am not sure at all, can you try to execute the rule without the 3 last commands?

context.saveObject(identity);
context.commitTransaction();
context.decache(identity);

you are overriding the

with

put setRemoveDate after setArgs.

1 Like

Hi Naresh,

Thanks for the information. I have managed to get this showing in the UI with the deactivate date. However, as this is just a standalone rule for creating the provisioning plan, I noticed that there is no request object being created where it will deprovision on the sunset date. Could you advise the additional steps needed for the scheduled request object to be created so that it will be deprovisioned on the sunset date?

Thank you.

Hi @Andy

It created for me, i have below code

import java.text.SimpleDateFormat;
  
   SimpleDateFormat sdf=new SimpleDateFormat("ddMMyyyy");
	 String stringDate = "30112024";
   Date sunset = sdf.parse(stringDate);
  
  Identity identity = context.getObjectByName(Identity.class,"Susan.Martin");
   		ProvisioningPlan sfPlan = new ProvisioningPlan();
      sfPlan.setIdentity(identity);
  
    		AccountRequest accountRequest = new AccountRequest();
        accountRequest.setApplication("Finance");
        accountRequest.setOperation(AccountRequest.Operation.Modify);
        accountRequest.setNativeIdentity("115");
        AttributeRequest attrReq = new AttributeRequest("groupmbr", ProvisioningPlan.Operation.Add, "AuditMgmt"); 
    		
  
  //return attrReq;
  
        Attributes attrb = new Attributes();
        attrb.put("assignment","true");
  
        //attrReq.setArgs(attrb);      

  attrReq.setRemoveDate(sunset);
        accountRequest.add(attrReq);

        sfPlan.add(accountRequest);
  
  //return sfPlan;
  
    	Provisioner provisioner = new Provisioner(context);
      provisioner.setNoLocking(true);
      ProvisioningProject project = provisioner.compile(sfPlan);

      provisioner.execute(project);
  return project;
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.