ProvisioningApprovalSubprocess Interceptor Rule Not Sending Reminder Email

Which IIQ version are you inquiring about?

8.4

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

Hi Sailors,

Below is my interceptor rule in the ProvisioningApprovalSubprocess business process. I noticed that the reminder email is not being sent after running the “Check Expired Workitem” task in IIQ.

I have checked the logs and confirmed that the code execution is working as expected. However, when I reviewed Advanced Analytics > Audit > Email Sent and Email Failure, I found that no email was triggered.

I would like to understand what might be preventing the reminder email from being sent.

import sailpoint.api.ObjectUtil;
import sailpoint.api.Provisioner;
import sailpoint.api.SailPointContext; 
import sailpoint.object.ApprovalItem;
import sailpoint.object.EmailTemplate;
import sailpoint.object.Identity;
import sailpoint.object.NotificationConfig;
import sailpoint.object.NotificationConfig.ReminderConfig;
import sailpoint.object.NotificationConfig.EscalationConfig;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.Workflow; 
import sailpoint.object.WorkItem; 
import sailpoint.object.ApprovalSet;
import sailpoint.object.Bundle;
import sailpoint.object.ManagedAttribute;
import sailpoint.tools.GeneralException;
import sailpoint.tools.Util;
import sailpoint.workflow.IdentityRequestLibrary;
import sailpoint.object.Workflow.Approval;
import org.apache.log4j.Logger;
import java.util.*;
import java.lang.Boolean;

if (Workflow.INTERCEPTOR_PRE_ASSIMILATION.equals(method)) {
    // Promote completion to Rejected if all items are rejected
    ApprovalSet aset = item.getApprovalSet();
    if (aset != null) {
        List<ApprovalItem> items = aset.getItems();
        if (!Util.isEmpty(items)) {
            int rejectCount = 0;
            for (ApprovalItem aitem : Util.safeIterable(items)) {
                if (aitem.getState() == WorkItem.State.Rejected) {
                    rejectCount++;
                }
            }
            if (rejectCount == items.size()) {
                item.setState(WorkItem.State.Rejected);
                context.saveObject(item);
                context.commitTransaction();
            }
        }
    }
} else if (Workflow.INTERCEPTOR_START_APPROVAL.equals(method)) {
    // Filter rejects if requested and set previous decisions when requested
    ApprovalSet currentSet = approval.getApprovalSet();
    if (currentSet != null && !Util.isEmpty(currentSet.getItems())) {
        if (Boolean.valueOf(filterRejects)) {
            filterRejectsFromApprovalSet(approvalSet, currentSet);
        }
        if (Util.isEmpty(currentSet.getItems())) {
            approval.setComplete(true);
        } else {
            if (Boolean.valueOf(setPreviousApprovalDecisions)) {
                setPreviousDecisionsOnApprovalSet(approvalSet, currentSet);
            }
        }
    }
} else if (Workflow.INTERCEPTOR_END_APPROVAL.equals(method)) {
    // Propagate rejection state to parent if all children are rejected
    Approval parentApp = approval.getParent();
    if (parentApp != null && approval.getApprovalSet() == null) {
        boolean completeAndRejected = true;
        for (Approval child : Util.safeIterable(approval.getChildren())) {
            if (!(child.isComplete() && child.getState() == WorkItem.State.Rejected)) {
                completeAndRejected = false;
                break;
            }
        }
        if (completeAndRejected) {
            approval.setState(WorkItem.State.Rejected);
        }
    }
}

List approvalItems = approvalSet.getItems();
String approvalType = null;
switch (method) {
    case Workflow.INTERCEPTOR_OPEN_WORK_ITEM:
        int maxExpirationDays = 7;
        List managerConfigs = new ArrayList();
        boolean isTwoTier = false;
        for (ApprovalItem approvalItem : approvalItems) {
            if (approvalItem == null) {
                log.debug("Encountered null ApprovalItem");
                System.out.println("Encountered null ApprovalItem");
                continue;
            }
            String operation = approvalItem.getOperation();
            Object id = approvalItem.getAttribute("id");
            log.debug("Attribute 'id' for ApprovalItem: " + id);
            System.out.println("Attribute 'id' for ApprovalItem: " + id);
            Object operationAttr = approvalItem.getAttribute("operation");
            if (id != null && operationAttr != null) {
                String operationStr = operationAttr.toString();
                if (operationStr.startsWith("Role")) {
                    Bundle role = context.getObjectById(Bundle.class, id.toString());
                    if (role != null) {
                        approvalType = (String) role.getAttribute("approvalType");
                        log.debug("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Role not found for ID: " + id);
                        System.out.println("Role not found for ID: " + id);
                    }
                } else if (operationStr.startsWith("Entitlement")) {
                    ManagedAttribute entitlement = context.getObjectById(ManagedAttribute.class, id.toString());
                    if (entitlement != null) {
                        approvalType = (String) entitlement.getAttribute("approvalType");
                        log.debug("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Entitlement not found for ID: " + id);
                        System.out.println("Entitlement not found for ID: " + id);
                    }
                } else {
                    log.debug("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                    System.out.println("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                }
            } else {
                log.debug("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
                System.out.println("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
            }
            // Update approvalType and maxExpirationDays based on priority
            if (approvalType != null) {
                if ("Manager and Second Level Manager".equals(approvalType) || "Manager and Defined Approvers".equals(approvalType)) {
                    isTwoTier = true;
                    maxExpirationDays = 7;
                } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
                    maxExpirationDays = 14;
                }
            }
        }
        log.debug("Here is the current approvalType: " + approvalType);
        System.out.println("Here is the current approvalType: " + approvalType);
        int expirationDays = maxExpirationDays;
        long twoDayMillis = 2 * 24 * 60 * 60 * 1000; //Original = 2 * 24 * 60 * 60 * 1000 Testing every 5 Minutae = 300000
        if (isTwoTier) {
            System.out.println("HREMINDER FOR DEFINED TWO TIER APPROVAL");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("1");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("2");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("3");
        } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
            System.out.println("HREMINDER FOR DEFINED APPROVERS OR MANAGER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("4");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("5");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("6");
        } else {
            System.out.println("HREMINDER FOR OTHER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("7");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("8");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("9");
        }
        EscalationConfig escalate = new EscalationConfig();
        escalate.setEnabled(true);
        escalate.setEscalationRuleName("Escalation Rule"); 
        //escalate.setEmailTemplateName("Alert Notification");
        escalate.setMillis(expirationDays * 24 * 60 * 60 * 1000);
        escalate.setFrequency(twoDayMillis);
        escalate.setMaxReminders(10);
        managerConfigs.add(escalate);
        NotificationConfig notifConfig = new NotificationConfig();
        notifConfig.setEnabled(true);
        notifConfig.setRemindersEnabled(true);
        Date currentDate = new Date();
        notifConfig.setStartDate(currentDate);
        long timeinMillis = currentDate.getTime();
        Date laterDate = new Date(timeinMillis + expirationDays * 24 * 60 * 60 * 1000);
        notifConfig.setEndDate(laterDate);
        notifConfig.setConfigs(managerConfigs);
        item.setupNotificationConfig(context, null, notifConfig);
        context.saveObject(item);
        context.commitTransaction();
        int hoursTillExpirationInt = expirationDays * 24;
        if (hoursTillExpirationInt > 0) {  
            int minutes = hoursTillExpirationInt * 60;  
            Date dateExp = Util.incrementDateByMinutes(new Date(), minutes);   
            if (item != null && item.getExpirationDate() == null && dateExp != null) {   
                item.setExpiration(dateExp); 
                Date wakeUpDate = Util.incrementDateByMinutes(new Date(), 2 * 24 * 60);
                item.setWakeUpDate(wakeUpDate);
                context.saveObject(item);   
                context.commitTransaction();  
            }  
        }
        break;
}

How you are testing this? using time machine, in that case how many task and UI servers you have?

Regards
Ankush

Hi @shirbhatea ,

firstReminderConfig.setMillis(300000);  

I set reminder 5minutes, 10minutes, 15minutes. for testing.

1 task 1 UI

Great!!

Please try to print the whole NotificationConfig object, like

log.error("notification config : "+notifConfig.toXml());

Share the xml here so that we can inspect and check is it generating the notification as per.

Regards
Ankush

Hi @shirbhatea ,

Got an error when execute the log,

2026-01-22T15:50:17,852 ERROR http-nio-8080-exec-6 org.apache.bsf.BSFManager:451 - Exception: 
java.security.PrivilegedActionException: null
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.apache.bsf.BSFManager.eval(BSFManager.java:442) ~[bsf.jar:?]
	at sailpoint.server.BSFRuleRunner.runScript(BSFRuleRunner.java:347) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.server.InternalContext.runScript(InternalContext.java:1350) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.callInterceptor(Workflower.java:6726) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.start(Workflower.java:7115) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.start(Workflower.java:6315) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.start(Workflower.java:6332) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advanceApproval(Workflower.java:6062) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5151) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advance(Workflower.java:4563) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.startCase(Workflower.java:3149) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchSubcase(Workflower.java:5479) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchSubcases(Workflower.java:5372) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5163) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advance(Workflower.java:4563) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.startCase(Workflower.java:3149) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchSubcase(Workflower.java:5479) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchSubcases(Workflower.java:5395) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5163) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.advance(Workflower.java:4563) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.startCase(Workflower.java:3149) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchInner(Workflower.java:2818) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launch(Workflower.java:2668) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.Workflower.launchSession(Workflower.java:2538) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.IdentityLifecycler.launchUpdate(IdentityLifecycler.java:144) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.api.IdentityLifecycler.launchUpdate(IdentityLifecycler.java:152) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.service.RequestAccessService.runWorkflow(RequestAccessService.java:1500) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.service.RequestAccessService.submitRequest(RequestAccessService.java:444) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at sailpoint.rest.ui.requestaccess.RequestAccessResource.submitRequest(RequestAccessResource.java:90) ~[identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at jdk.internal.reflect.GeneratedMethodAccessor4659.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) [jersey-common-2.35.jar:?]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684) [jersey-server-2.35.jar:?]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) [jersey-container-servlet-core-2.35.jar:?]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) [jersey-container-servlet-core-2.35.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366) [jersey-container-servlet-core-2.35.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319) [jersey-container-servlet-core-2.35.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) [jersey-container-servlet-core-2.35.jar:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) [tomcat-websocket.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.web.SailPointResponseFilter.doFilter(SailPointResponseFilter.java:76) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.rest.jaxrs.MethodOverrideFilter.doFilter(MethodOverrideFilter.java:90) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.rest.RestCsrfValidationFilter.doFilter(RestCsrfValidationFilter.java:71) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.rest.AuthenticationFilter.doFilter(AuthenticationFilter.java:109) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.web.SailPointContextRequestFilter.doFilter(SailPointContextRequestFilter.java:68) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.web.SailPointPollingRequestFilter.doFilter(SailPointPollingRequestFilter.java:151) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at sailpoint.web.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:63) [identityiq.jar:8.4 Build bdd0ed4de58-20230919-192552]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.24.RELEASE.jar:5.2.24.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.24.RELEASE.jar:5.2.24.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) [catalina.jar:9.0.90]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) [catalina.jar:9.0.90]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) [catalina.jar:9.0.90]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) [catalina.jar:9.0.90]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) [catalina.jar:9.0.90]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) [catalina.jar:9.0.90]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) [catalina.jar:9.0.90]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.90]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) [catalina.jar:9.0.90]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:388) [tomcat-coyote.jar:9.0.90]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) [tomcat-coyote.jar:9.0.90]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:936) [tomcat-coyote.jar:9.0.90]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) [tomcat-coyote.jar:9.0.90]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) [tomcat-coyote.jar:9.0.90]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) [tomcat-util.jar:9.0.90]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:9.0.90]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) [tomcat-util.jar:9.0.90]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import sailpoint.api.ObjectUtil; import sailpoint.api.Provisioner; import sailpo . . . '' : Error in method invocation: Method toXml() not found in class'java.util.ArrayList' : at Line: 171 : in file: inline evaluation of: ``import sailpoint.api.ObjectUtil; import sailpoint.api.Provisioner; import sailpo . . . '' : managerConfigs .toXml ( ) 
 BSF info: script at line: 0 column: columnNo
	at bsh.util.BeanShellBSFEngine.eval(BeanShellBSFEngine.java:202) ~[bsh-2.1.8.jar:2.1.8 2018-10-02 08:36:04]
	at org.apache.bsf.BSFManager$5.run(BSFManager.java:445) ~[bsf.jar:?]
	... 102 more
2026-01-22T15:50:17,852 ERROR http-nio-8080-exec-6 sailpoint.api.Workflower:6734 - Problem running script: sailpoint.object.Script@2e5944b4
sailpoint.tools.GeneralException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import sailpoint.api.ObjectUtil; import sailpoint.api.Provisioner; import sailpo . . . '' : Error in method invocation: Method toXml() not found in class'java.util.ArrayList' : at Line: 171 : in file: inline evaluation of: ``import sailpoint.api.ObjectUtil; import sailpoint.api.Provisioner; import sailpo . . . '' : managerConfigs .toXml ( ) 
 BSF info: script at line: 0 column: columnNo

toXml() should be on NotificationConfig object.

import sailpoint.api.ObjectUtil;
import sailpoint.api.Provisioner;
import sailpoint.api.SailPointContext; 
import sailpoint.object.ApprovalItem;
import sailpoint.object.EmailTemplate;
import sailpoint.object.Identity;
import sailpoint.object.NotificationConfig;
import sailpoint.object.NotificationConfig.ReminderConfig;
import sailpoint.object.NotificationConfig.EscalationConfig;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.Workflow; 
import sailpoint.object.WorkItem; 
import sailpoint.object.ApprovalSet;
import sailpoint.object.Bundle;
import sailpoint.object.ManagedAttribute;
import sailpoint.tools.GeneralException;
import sailpoint.tools.Util;
import sailpoint.workflow.IdentityRequestLibrary;
import sailpoint.object.Workflow.Approval;
import org.apache.log4j.Logger;
import java.util.*;
import java.lang.Boolean;

if (Workflow.INTERCEPTOR_PRE_ASSIMILATION.equals(method)) {
    // Promote completion to Rejected if all items are rejected
    ApprovalSet aset = item.getApprovalSet();
    if (aset != null) {
        List<ApprovalItem> items = aset.getItems();
        if (!Util.isEmpty(items)) {
            int rejectCount = 0;
            for (ApprovalItem aitem : Util.safeIterable(items)) {
                if (aitem.getState() == WorkItem.State.Rejected) {
                    rejectCount++;
                }
            }
            if (rejectCount == items.size()) {
                item.setState(WorkItem.State.Rejected);
                context.saveObject(item);
                context.commitTransaction();
            }
        }
    }
} else if (Workflow.INTERCEPTOR_START_APPROVAL.equals(method)) {
    // Filter rejects if requested and set previous decisions when requested
    ApprovalSet currentSet = approval.getApprovalSet();
    if (currentSet != null && !Util.isEmpty(currentSet.getItems())) {
        if (Boolean.valueOf(filterRejects)) {
            filterRejectsFromApprovalSet(approvalSet, currentSet);
        }
        if (Util.isEmpty(currentSet.getItems())) {
            approval.setComplete(true);
        } else {
            if (Boolean.valueOf(setPreviousApprovalDecisions)) {
                setPreviousDecisionsOnApprovalSet(approvalSet, currentSet);
            }
        }
    }
} else if (Workflow.INTERCEPTOR_END_APPROVAL.equals(method)) {
    // Propagate rejection state to parent if all children are rejected
    Approval parentApp = approval.getParent();
    if (parentApp != null && approval.getApprovalSet() == null) {
        boolean completeAndRejected = true;
        for (Approval child : Util.safeIterable(approval.getChildren())) {
            if (!(child.isComplete() && child.getState() == WorkItem.State.Rejected)) {
                completeAndRejected = false;
                break;
            }
        }
        if (completeAndRejected) {
            approval.setState(WorkItem.State.Rejected);
        }
    }
}

List approvalItems = approvalSet.getItems();
String approvalType = null;
switch (method) {
    case Workflow.INTERCEPTOR_OPEN_WORK_ITEM:
        int maxExpirationDays = 7;
        List managerConfigs = new ArrayList();
        boolean isTwoTier = false;
        for (ApprovalItem approvalItem : approvalItems) {
            if (approvalItem == null) {
                log.debug("Encountered null ApprovalItem");
                System.out.println("Encountered null ApprovalItem");
                continue;
            }
            String operation = approvalItem.getOperation();
            Object id = approvalItem.getAttribute("id");
            log.debug("Attribute 'id' for ApprovalItem: " + id);
            System.out.println("Attribute 'id' for ApprovalItem: " + id);
            Object operationAttr = approvalItem.getAttribute("operation");
            if (id != null && operationAttr != null) {
                String operationStr = operationAttr.toString();
                if (operationStr.startsWith("Role")) {
                    Bundle role = context.getObjectById(Bundle.class, id.toString());
                    if (role != null) {
                        approvalType = (String) role.getAttribute("approvalType");
                        log.debug("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Role not found for ID: " + id);
                        System.out.println("Role not found for ID: " + id);
                    }
                } else if (operationStr.startsWith("Entitlement")) {
                    ManagedAttribute entitlement = context.getObjectById(ManagedAttribute.class, id.toString());
                    if (entitlement != null) {
                        approvalType = (String) entitlement.getAttribute("approvalType");
                        log.debug("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Entitlement not found for ID: " + id);
                        System.out.println("Entitlement not found for ID: " + id);
                    }
                } else {
                    log.debug("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                    System.out.println("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                }
            } else {
                log.debug("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
                System.out.println("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
            }
            // Update approvalType and maxExpirationDays based on priority
            if (approvalType != null) {
                if ("Manager and Second Level Manager".equals(approvalType) || "Manager and Defined Approvers".equals(approvalType)) {
                    isTwoTier = true;
                    maxExpirationDays = 7;
                } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
                    maxExpirationDays = 14;
                }
            }
        }
        log.debug("Here is the current approvalType: " + approvalType);
        System.out.println("Here is the current approvalType: " + approvalType);
        int expirationDays = maxExpirationDays;
        long twoDayMillis = 2 * 24 * 60 * 60 * 1000; //Original = 2 * 24 * 60 * 60 * 1000 Testing every 5 Minutae = 300000
        if (isTwoTier) {
            System.out.println("HREMINDER FOR DEFINED TWO TIER APPROVAL");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("1");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("2");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("3");
        } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
            System.out.println("HREMINDER FOR DEFINED APPROVERS OR MANAGER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("4");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("5");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("6");
        } else {
            System.out.println("HREMINDER FOR OTHER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("7");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("8");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("9");
        }
        EscalationConfig escalate = new EscalationConfig();
        escalate.setEnabled(true);
        escalate.setEscalationRuleName("Escalation Rule"); 
        //escalate.setEmailTemplateName("Alert Notification");
        escalate.setMillis(expirationDays * 24 * 60 * 60 * 1000);
        escalate.setFrequency(twoDayMillis);
        escalate.setMaxReminders(10);
        managerConfigs.add(escalate);
        NotificationConfig notifConfig = new NotificationConfig();
        notifConfig.setEnabled(true);
        notifConfig.setRemindersEnabled(true);
        Date currentDate = new Date();
        notifConfig.setStartDate(currentDate);
        long timeinMillis = currentDate.getTime();
        Date laterDate = new Date(timeinMillis + expirationDays * 24 * 60 * 60 * 1000);
        notifConfig.setEndDate(laterDate);
        notifConfig.setConfigs(managerConfigs);
        item.setupNotificationConfig(context, null, notifConfig);
        context.saveObject(item);
        context.commitTransaction();
        int hoursTillExpirationInt = expirationDays * 24;
        if (hoursTillExpirationInt > 0) {  
            int minutes = hoursTillExpirationInt * 60;  
            Date dateExp = Util.incrementDateByMinutes(new Date(), minutes);   
            if (item != null && item.getExpirationDate() == null && dateExp != null) {   
                item.setExpiration(dateExp); 
                Date wakeUpDate = Util.incrementDateByMinutes(new Date(), 2 * 24 * 60);
                item.setWakeUpDate(wakeUpDate);
                context.saveObject(item);   
                context.commitTransaction();  
            }  
        }
		log.error("notification config : "+notifConfig.toXml());
        break;
}

Hi @shirbhatea ,

Here is the object:

2026-01-22T16:23:01,347 ERROR http-nio-8080-exec-10 sailpoint.server.InternalContext:166 - notification config : <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE NotificationConfig PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<NotificationConfig enabled="true" escalationEnabled="true" escalationFrequencyMillis="172800000" escalationMaxReminders="10" remindersEnabled="true" startDate="1769070181284">
  <Configs>
    <ReminderConfig emailTemplateName="LCM Identity Update Approval Reminder" enabled="true" millis="900000"/>
    <ReminderConfig emailTemplateName="LCM Identity Update Approval Reminder" enabled="true" millis="1200000"/>
    <ReminderConfig emailTemplateName="LCM Identity Update Approval Reminder" enabled="true" millis="1500000"/>
    <EscalationConfig enabled="true" escalationRuleName="Intel Escalation" frequency="172800000" maxReminders="10" millis="1209600000"/>
  </Configs>
</NotificationConfig>

This looks good,

first reminder : 1769070181284+900000 (Thursday, January 22, 2026 8:38:01.284 AM GMT)

should send the reminder.

Regards
Ankush

Hi @shirbhatea ,

Unfortunately, given a few try and it still not sending email reminder.

Can you give a try to below code and share the xml again?

import sailpoint.api.ObjectUtil;
import sailpoint.api.Provisioner;
import sailpoint.api.SailPointContext; 
import sailpoint.object.ApprovalItem;
import sailpoint.object.EmailTemplate;
import sailpoint.object.Identity;
import sailpoint.object.NotificationConfig;
import sailpoint.object.NotificationConfig.ReminderConfig;
import sailpoint.object.NotificationConfig.EscalationConfig;
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.Workflow; 
import sailpoint.object.WorkItem; 
import sailpoint.object.ApprovalSet;
import sailpoint.object.Bundle;
import sailpoint.object.ManagedAttribute;
import sailpoint.tools.GeneralException;
import sailpoint.tools.Util;
import sailpoint.workflow.IdentityRequestLibrary;
import sailpoint.object.Workflow.Approval;
import org.apache.log4j.Logger;
import java.util.*;
import java.lang.Boolean;

if (Workflow.INTERCEPTOR_PRE_ASSIMILATION.equals(method)) {
    // Promote completion to Rejected if all items are rejected
    ApprovalSet aset = item.getApprovalSet();
    if (aset != null) {
        List&lt;ApprovalItem> items = aset.getItems();
        if (!Util.isEmpty(items)) {
            int rejectCount = 0;
            for (ApprovalItem aitem : Util.safeIterable(items)) {
                if (aitem.getState() == WorkItem.State.Rejected) {
                    rejectCount++;
                }
            }
            if (rejectCount == items.size()) {
                item.setState(WorkItem.State.Rejected);
                context.saveObject(item);
                context.commitTransaction();
            }
        }
    }
} else if (Workflow.INTERCEPTOR_START_APPROVAL.equals(method)) {
    // Filter rejects if requested and set previous decisions when requested
    ApprovalSet currentSet = approval.getApprovalSet();
    if (currentSet != null &amp;&amp; !Util.isEmpty(currentSet.getItems())) {
        if (Boolean.valueOf(filterRejects)) {
            filterRejectsFromApprovalSet(approvalSet, currentSet);
        }
        if (Util.isEmpty(currentSet.getItems())) {
            approval.setComplete(true);
        } else {
            if (Boolean.valueOf(setPreviousApprovalDecisions)) {
                setPreviousDecisionsOnApprovalSet(approvalSet, currentSet);
            }
        }
    }
} else if (Workflow.INTERCEPTOR_END_APPROVAL.equals(method)) {
    // Propagate rejection state to parent if all children are rejected
    Approval parentApp = approval.getParent();
    if (parentApp != null &amp;&amp; approval.getApprovalSet() == null) {
        boolean completeAndRejected = true;
        for (Approval child : Util.safeIterable(approval.getChildren())) {
            if (!(child.isComplete() &amp;&amp; child.getState() == WorkItem.State.Rejected)) {
                completeAndRejected = false;
                break;
            }
        }
        if (completeAndRejected) {
            approval.setState(WorkItem.State.Rejected);
        }
    }
}

List approvalItems = approvalSet.getItems();
String approvalType = null;
switch (method) {
    case Workflow.INTERCEPTOR_OPEN_WORK_ITEM:
        int maxExpirationDays = 7;
        List managerConfigs = new ArrayList();
        boolean isTwoTier = false;
        for (ApprovalItem approvalItem : approvalItems) {
            if (approvalItem == null) {
                log.debug("Encountered null ApprovalItem");
                System.out.println("Encountered null ApprovalItem");
                continue;
            }
            String operation = approvalItem.getOperation();
            Object id = approvalItem.getAttribute("id");
            log.debug("Attribute 'id' for ApprovalItem: " + id);
            System.out.println("Attribute 'id' for ApprovalItem: " + id);
            Object operationAttr = approvalItem.getAttribute("operation");
            if (id != null &amp;&amp; operationAttr != null) {
                String operationStr = operationAttr.toString();
                if (operationStr.startsWith("Role")) {
                    Bundle role = context.getObjectById(Bundle.class, id.toString());
                    if (role != null) {
                        approvalType = (String) role.getAttribute("approvalType");
                        log.debug("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Role approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Role not found for ID: " + id);
                        System.out.println("Role not found for ID: " + id);
                    }
                } else if (operationStr.startsWith("Entitlement")) {
                    ManagedAttribute entitlement = context.getObjectById(ManagedAttribute.class, id.toString());
                    if (entitlement != null) {
                        approvalType = (String) entitlement.getAttribute("approvalType");
                        log.debug("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                        System.out.println("Entitlement approvalType for ID " + id + ": " + (approvalType != null ? approvalType : "null"));
                    } else {
                        log.debug("Entitlement not found for ID: " + id);
                        System.out.println("Entitlement not found for ID: " + id);
                    }
                } else {
                    log.debug("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                    System.out.println("Operation does not start with 'Role' or 'Entitlement': " + operationStr);
                }
            } else {
                log.debug("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
                System.out.println("ID or operation attribute is null for ApprovalItem: ID=" + id + ", OperationAttr=" + operationAttr);
            }
            // Update approvalType and maxExpirationDays based on priority
            if (approvalType != null) {
                if ("Manager and Second Level Manager".equals(approvalType) || "Manager and Defined Approvers".equals(approvalType)) {
                    isTwoTier = true;
                    maxExpirationDays = 7;
                } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
                    maxExpirationDays = 14;
                }
            }
        }
        log.debug("Here is the current approvalType: " + approvalType);
        System.out.println("Here is the current approvalType: " + approvalType);
        int expirationDays = maxExpirationDays;
        long twoDayMillis = 2 * 24 * 60 * 60 * 1000; //Original = 2 * 24 * 60 * 60 * 1000 Testing every 5 Minutae = 300000
        if (isTwoTier) {
            System.out.println("HREMINDER FOR DEFINED TWO TIER APPROVAL");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
			firstReminderConfig.setFrequency(300000);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("1");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("2");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("3");
        } else if ("Defined Approvers".equals(approvalType) || "Manager".equals(approvalType)) {
            System.out.println("HREMINDER FOR DEFINED APPROVERS OR MANAGER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
			firstReminderConfig.setFrequency(300000);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("4");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("5");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("6");
        } else {
            System.out.println("HREMINDER FOR OTHER");
            // 3rd Day
            ReminderConfig firstReminderConfig = new ReminderConfig();
            firstReminderConfig.setEnabled(true);
			firstReminderConfig.setFrequency(300000);
            firstReminderConfig.setMillis(300000);  
            firstReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(firstReminderConfig);
            System.out.println("7");
            // 5th Day
            ReminderConfig secondReminderConfig = new ReminderConfig();
            secondReminderConfig.setEnabled(true);
            secondReminderConfig.setMillis(600000);  
            secondReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(secondReminderConfig);
            System.out.println("8");
            // 1 hour before 7th Day
            ReminderConfig thirdReminderConfig = new ReminderConfig();
            thirdReminderConfig.setEnabled(true);
            thirdReminderConfig.setMillis(900000);  
            thirdReminderConfig.setEmailTemplateName("LCM Identity Update Approval Reminder");
            managerConfigs.add(thirdReminderConfig);
            System.out.println("9");
        }
        EscalationConfig escalate = new EscalationConfig();
        escalate.setEnabled(true);
        escalate.setEscalationRuleName("Escalation Rule"); 
        //escalate.setEmailTemplateName("Alert Notification");
        escalate.setMillis(expirationDays * 24 * 60 * 60 * 1000);
        escalate.setFrequency(twoDayMillis);
        escalate.setMaxReminders(10);
        managerConfigs.add(escalate);
       
	    NotificationConfig notifConfig = new NotificationConfig();
        notifConfig.setEnabled(true);
        //notifConfig.setRemindersEnabled(true);
        //Date currentDate = new Date();
        //notifConfig.setStartDate(currentDate);
        //long timeinMillis = currentDate.getTime();
       // Date laterDate = new Date(timeinMillis + expirationDays * 24 * 60 * 60 * 1000);
       // notifConfig.setEndDate(laterDate);
        notifConfig.setConfigs(managerConfigs);
        item.setupNotificationConfig(context, null, notifConfig);
        context.saveObject(item);
        context.commitTransaction();
        int hoursTillExpirationInt = expirationDays * 24;
        if (hoursTillExpirationInt > 0) {  
            int minutes = hoursTillExpirationInt * 60;  
            Date dateExp = Util.incrementDateByMinutes(new Date(), minutes);   
            if (item != null &amp;&amp; item.getExpirationDate() == null &amp;&amp; dateExp != null) {   
                item.setExpiration(dateExp); 
                Date wakeUpDate = Util.incrementDateByMinutes(new Date(), 2 * 24 * 60);
               // item.setWakeUpDate(wakeUpDate);
                context.saveObject(item);   
                context.commitTransaction();  
            }  
        }
		log.error("notification config : "+notifConfig.toXml());
        break;
}

Is this issue resolved?

HI @shirbhatea ,

Your idea to check the wakeUpDate is correct, the email reminder not send due to the wakeUpDate is set to 2 days later.

1 Like