Source:
<code>public void addRemovalTimeById(String processInstanceId, Date removalTime) { CommandContext commandContext = Context.getCommandContext(); commandContext.getHistoricActivityInstanceManager() .addRemovalTimeToActivityInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricTaskInstanceManager() .addRemovalTimeToTaskInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricVariableInstanceManager() .addRemovalTimeToVariableInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricDetailManager() .addRemovalTimeToDetailsByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricIncidentManager() .addRemovalTimeToIncidentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricExternalTaskLogManager() .addRemovalTimeToExternalTaskLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricJobLogManager() .addRemovalTimeToJobLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getOperationLogManager() .addRemovalTimeToUserOperationLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricIdentityLinkManager() .addRemovalTimeToIdentityLinkLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getCommentManager() .addRemovalTimeToCommentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getAttachmentManager() .addRemovalTimeToAttachmentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getByteArrayManager() .addRemovalTimeToByteArraysByProcessInstanceId(processInstanceId, removalTime); commandContext.getAuthorizationManager() <START> .addRemovalTimeToAuthorizationsByProcessInstanceId(processInstanceId, removalTime); <END> Map<String, Object> parameters = new HashMap<>(); parameters.put("processInstanceId", processInstanceId); parameters.put("removalTime", removalTime); getDbEntityManager() .updatePreserveOrder(HistoricProcessInstanceEventEntity.class, "updateHistoricProcessInstanceByProcessInstanceId", parameters); }</code><technical_language>skip this if enableHistoricInstancePermissions is disabled</technical_language>

Target:
public void addRemovalTimeById(String processInstanceId, Date removalTime) { CommandContext commandContext = Context.getCommandContext(); commandContext.getHistoricActivityInstanceManager() .addRemovalTimeToActivityInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricTaskInstanceManager() .addRemovalTimeToTaskInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricVariableInstanceManager() .addRemovalTimeToVariableInstancesByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricDetailManager() .addRemovalTimeToDetailsByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricIncidentManager() .addRemovalTimeToIncidentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricExternalTaskLogManager() .addRemovalTimeToExternalTaskLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricJobLogManager() .addRemovalTimeToJobLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getOperationLogManager() .addRemovalTimeToUserOperationLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getHistoricIdentityLinkManager() .addRemovalTimeToIdentityLinkLogByProcessInstanceId(processInstanceId, removalTime); commandContext.getCommentManager() .addRemovalTimeToCommentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getAttachmentManager() .addRemovalTimeToAttachmentsByProcessInstanceId(processInstanceId, removalTime); commandContext.getByteArrayManager() .addRemovalTimeToByteArraysByProcessInstanceId(processInstanceId, removalTime); if (isEnableHistoricInstancePermissions()) { commandContext.getAuthorizationManager() .addRemovalTimeToAuthorizationsByProcessInstanceId(processInstanceId, removalTime); } Map<String, Object> parameters = new HashMap<>(); parameters.put("processInstanceId", processInstanceId); parameters.put("removalTime", removalTime); getDbEntityManager() .updatePreserveOrder(HistoricProcessInstanceEventEntity.class, "updateHistoricProcessInstanceByProcessInstanceId", parameters); }