Upgrade from version 4.2.1.x to version 4.2.1.5
The upgrade process for the latest 4.2.1.5 version of OpenIAM is similar to any other upgrade process, except several steps.
The common process is described in the document by this link. Specific steps for OpenIAM version 4.2.1.5 are given below.
Please note that UserDataWebServiceImpl.getUserBetweenLastDate(Date fromDate, Date toDate)
has been deprecated and will be removed from v4.2.2.
Hence, you need to migrate to the findBeans operation as shown in the example below.
import org.openiam.base.ws.DateSearchParamimport org.openiam.base.ws.MatchTypeimport org.openiam.esb.core.batch.tasks.implementation.AbstractLeaverProcessimport org.openiam.idm.searchbeans.UserSearchBeanimport org.openiam.idm.srvc.user.dto.Userimport org.openiam.provision.dto.user.request.DisableUserProvisioningRequestimport org.openiam.srvc.idm.DefaultProvisioningServiceimport org.openiam.srvc.user.UserDataWebServiceimport java.lang.reflect.Array/*** Groovy implementation of ILeaverProcess interface*/public class LeaverProcessTask extends AbstractLeaverProcess {UserDataWebService userWebServiceDefaultProvisioningService provisionService@Overridepublic List<User> getUsers(int daysBeforeLeaver) {Calendar from = Calendar.getInstance()from.add(Calendar.DAY_OF_MONTH, -daysBeforeLeaver)from.set(Calendar.HOUR_OF_DAY, 0)from.set(Calendar.MINUTE, 0)from.set(Calendar.SECOND, 0)Calendar to = Calendar.getInstance()to.add(Calendar.DAY_OF_MONTH, 0)to.set(Calendar.HOUR_OF_DAY, 0)to.set(Calendar.MINUTE, 0)to.set(Calendar.SECOND, 0)println "Search users with Last Date from:" + from.getTime() + " to: " + to.getTime()UserSearchBean usb = new UserSearchBean()usb.setLastDateToken(new DateSearchParam(from.getTime(), to.getTime(), MatchType.BETWEEN))return userWebService.findBeans(usb,null,0,Integer.MAX_VALUE)?.getList()}@Overridepublic void perform(User user) {println(String.format("Disable User %s with Id %s", user.getDisplayName(), user.getId()))DisableUserProvisioningRequest disableUserProvisioningRequest = new DisableUserProvisioningRequest()disableUserProvisioningRequest.setId(user.getId())provisionService.disableUser(disableUserProvisioningRequest);}}
Note: As an additional step, please replace the content of the conf/activiti/revokeAccess.bpmn20.xml
file with the following.
<?xml version="1.0" encoding="UTF-8"?><definitions id="definitions"xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:activiti="http://activiti.org/bpmn"targetNamespace="REVOKE_ACCESS"><process id="REVOKE_ACCESS"><startEvent id="start" name="Initialize Process" /><sequenceFlow id="subProcessFlow" sourceRef="start" targetRef="subProcess" /><subProcess id="subProcess" name="Start Approval Flow"><multiInstanceLoopCharacteristics isSequential="true"><loopDataInputRef>ApproverCardindality</loopDataInputRef><inputDataItem name="cardinalityObject" /><completionCondition>${!IsTaskApproved}</completionCondition></multiInstanceLoopCharacteristics><startEvent id="subProcessStart" /><sequenceFlow id="subProcessStartFlow" sourceRef="subProcessStart" targetRef="sendRequests" /><serviceTask id="sendRequests" activiti:class="org.openiam.workflow.activiti.delegate.user.access.request.SendRevokeAccessRequestDelegate" name="Send Requests to Candidate Users" /><sequenceFlow id="makeRequestDecisionFlow" sourceRef="sendRequests" targetRef="makeRequestDecision"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${!IsTaskApproved}]]></conditionExpression></sequenceFlow><sequenceFlow id="automaticApprove" sourceRef="sendRequests" targetRef="subProcessEnd"><conditionExpression xsi:type="tFormalExpression"><![CDATA[${IsTaskApproved}]]></conditionExpression></sequenceFlow><userTask id="makeRequestDecision" name="Make Decision" activiti:owner="${TaskOwner}"><extensionElements><activiti:taskListener event="create" class="org.openiam.workflow.activiti.tasklistener.RevokeAccessRequestCandidateTaskListener" /></extensionElements></userTask><sequenceFlow id="preSubProcessEnd" sourceRef="makeRequestDecision" targetRef="subProcessEnd" /><endEvent id="subProcessEnd" /></subProcess><sequenceFlow id="afterSubProcess" sourceRef="subProcess" targetRef="approveOrRequestGateway" /><exclusiveGateway id="approveOrRequestGateway" name="Perform Service task based on Decision" /><sequenceFlow id="gateflow1" sourceRef="approveOrRequestGateway" targetRef="entitlementsOperation"><conditionExpression xsi:type="tFormalExpression">${IsTaskApproved}</conditionExpression></sequenceFlow><serviceTask id="entitlementsOperation" activiti:class="org.openiam.workflow.activiti.delegate.user.access.request.RevokeAccessRequestDelegate" name="Revoke Access" /><sequenceFlow id="gateflow2" sourceRef="approveOrRequestGateway" targetRef="rejectRequest"><conditionExpression xsi:type="tFormalExpression">${!IsTaskApproved}</conditionExpression></sequenceFlow><serviceTask id="rejectRequest" activiti:class="org.openiam.workflow.activiti.delegate.entitlements.RejectEntitlementsNotifierDelegate" name="Task Rejected" /><sequenceFlow id="acceptRequestJoin" sourceRef="entitlementsOperation" targetRef="notifyAccepted" /><serviceTask id="notifyAccepted" activiti:class="org.openiam.workflow.activiti.delegate.entitlements.AcceptEntitlementsNotifierDelegate" name="Send Notifications" /><sequenceFlow id="rejectRequestJoin" sourceRef="rejectRequest" targetRef="finish" /><sequenceFlow id="afterNotifyAccepted" sourceRef="notifyAccepted" targetRef="finish" /><endEvent id="finish" name="Task Completed" /></process></definitions>