Workitem not expired!

Hi Team,

We have an requirement that owner approval should be expired after 28 days. In our code we are setting wakeupdate and expiration date.

int exp = 40310;
int wake = 40320;
Date dateExp = Util.incrementDateByMinutes(startDate, exp);
Date dateWake = Util.incrementDateByMinutes(startDate, wake);

			workItem.setExpiration(dateExp);
			workItem.setWakeUpDate(dateWake);
			context.commitTransaction(); 
Date are setting correctly in workitem. After running 'check workitem expire task' workitem is not expired.And while we are checking through the method 'isExpired' it given true. So why it is not showing expired in Sailpoint? is there is some configuration which we are missing? Can anyone please help me out of this. 

We are able to achieve this via workflow using below arguments to fulfill the expiration criteria:

Arg name=“workItemEscalationRule” value=“Expire Rule”
here you can return null in Rule and type of Rule is escalation

Arg name=“workItemHoursTillEscalation”
here we are giving hours before it should get expired

1 Like

Hi @aakashpandita Thanks for reply.

We are using both the argument which you mentioned but still it is not working. In rule we are return null only.

can you share a sample of your code

Hi @sachinty

Please share your code, it will help us to identity the root cause of your problem.

Thanks

Manish Singh

Hi @msingh900 @aakashpandita

Below are the variable which we I have set in the code. And code snippet for owner approval expiration.

Variable initializer=“LCM Work Item Escalation” name=“workItemEscalationTemplate”
Variable initializer="Access Request EscalationRule"name=“workItemEscalationRule”
Variable initializer=“168” name=“workItemHoursTillEscalation”
Variable initializer=“3” name=“workItemMaxReminders”

Variable initializer=“LCM Work Item Reminder” name=“workItemReminderTemplate”
Variable initializer=“168” name=“workItemHoursBetweenReminders”

if(wiDescription.contains(“Owner Approval”)){
if(escalationCount == 0){
NotificationConfig notifConfig = workItem.getNotificationConfig();
notifConfig.setReminderFrequency(7 * 24 * 60 * 60 * 1000);
notifConfig.setRemindersEnabled(false);
EmailTemplate emailTemplate = context.getObject(EmailTemplate.class, “LCM Work Item Reminder”);
notifConfig.setEscalationEmailTemplate(emailTemplate);
Date startDate = notifConfig.getStartDate();
int exp = 40310;
int wake = 40320;
Date dateExp = Util.incrementDateByMinutes(startDate, exp);
Date dateWake = Util.incrementDateByMinutes(startDate, wake);

			workItem.setExpiration(dateExp);
			workItem.setWakeUpDate(dateWake);
			context.commitTransaction();				
			
			if(null != owner){
			newOwner = owner.getName();
			}
			
			return null;
		}
	} else {		
		  if(escalationCount == 0){
			String newOwner = defaultEscalationTarget;
			if(null != owner){
			  if(owner.isWorkgroup()){
				Identity wgOwner = owner.getOwner();
				if(null != wgOwner){
				  newOwner = wgOwner.getName();
				}
			  } else {
				Identity manager = owner.getManager();
				if(null != manager){
				  newOwner = manager.getName();
				}
			  }
			}

			
			return null;
		  }

could you pls share the entire xml.

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