@Override protected JobHandlerConfiguration resolveJobHandlerConfiguration(BatchJobContext context) { return new BatchJobConfiguration(context.getConfiguration().getId()); }
@Override protected JobHandlerConfiguration resolveJobHandlerConfiguration(BatchJobContext context) { return new BatchJobConfiguration(context.getConfiguration().getId()); }
public void setExceptionStacktrace(String exception) { byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = getExceptionByteArray(); if(byteArray == null) { byteArray = createJobExceptionByteArray(exceptionBytes, ResourceTypes.RUNTIME); exceptionByteArrayId = byteArray.getId(); exceptionByteArray = byteArray; } else { byteArray.setBytes(exceptionBytes); } }
public void setExceptionStacktrace(String exception) { byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = getExceptionByteArray(); if(byteArray == null) { byteArray = createJobExceptionByteArray(exceptionBytes, ResourceTypes.RUNTIME); exceptionByteArrayId = byteArray.getId(); exceptionByteArray = byteArray; } else { byteArray.setBytes(exceptionBytes); } }
protected void setErrorDetails(String exception) { EnsureUtil.ensureNotNull("exception", exception); byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = getErrorByteArray(); if(byteArray == null) { byteArray = createExceptionByteArray(EXCEPTION_NAME,exceptionBytes, ResourceTypes.RUNTIME); errorDetailsByteArrayId = byteArray.getId(); errorDetailsByteArray = byteArray; } else { byteArray.setBytes(exceptionBytes); } }
public void setErrorDetails(String exception) { EnsureUtil.ensureNotNull("exception", exception); byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = createExceptionByteArray(EXCEPTION_NAME, exceptionBytes, ResourceTypes.HISTORY); byteArray.setRootProcessInstanceId(rootProcessInstanceId); byteArray.setRemovalTime(removalTime); errorDetailsByteArrayId = byteArray.getId(); }
public void setErrorDetails(String exception) { EnsureUtil.ensureNotNull("exception", exception); byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = createExceptionByteArray(EXCEPTION_NAME, exceptionBytes, ResourceTypes.HISTORY); byteArray.setRootProcessInstanceId(rootProcessInstanceId); byteArray.setRemovalTime(removalTime); errorDetailsByteArrayId = byteArray.getId(); }
protected void setErrorDetails(String exception) { EnsureUtil.ensureNotNull("exception", exception); byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = getErrorByteArray(); if(byteArray == null) { byteArray = createExceptionByteArray(EXCEPTION_NAME,exceptionBytes, ResourceTypes.RUNTIME); errorDetailsByteArrayId = byteArray.getId(); errorDetailsByteArray = byteArray; } else { byteArray.setBytes(exceptionBytes); } }
public HistoryEvent createHistoricJobLogFailedEvt(Job job, Throwable exception) { HistoricJobLogEventEntity event = (HistoricJobLogEventEntity) createHistoricJobLogEvt(job, HistoryEventTypes.JOB_FAIL); if(exception != null) { // exception message event.setJobExceptionMessage(exception.getMessage()); // stacktrace String exceptionStacktrace = getExceptionStacktrace(exception); byte[] exceptionBytes = toByteArray(exceptionStacktrace); ByteArrayEntity byteArray = createJobExceptionByteArray(exceptionBytes, ResourceTypes.HISTORY); byteArray.setRootProcessInstanceId(event.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { byteArray.setRemovalTime(event.getRemovalTime()); } event.setExceptionByteArrayId(byteArray.getId()); } return event; }
public HistoryEvent createHistoricJobLogFailedEvt(Job job, Throwable exception) { HistoricJobLogEventEntity event = (HistoricJobLogEventEntity) createHistoricJobLogEvt(job, HistoryEventTypes.JOB_FAIL); if(exception != null) { // exception message event.setJobExceptionMessage(exception.getMessage()); // stacktrace String exceptionStacktrace = getExceptionStacktrace(exception); byte[] exceptionBytes = toByteArray(exceptionStacktrace); ByteArrayEntity byteArray = createJobExceptionByteArray(exceptionBytes, ResourceTypes.HISTORY); byteArray.setRootProcessInstanceId(event.getRootProcessInstanceId()); if (isHistoryRemovalTimeStrategyStart()) { byteArray.setRemovalTime(event.getRemovalTime()); } event.setExceptionByteArrayId(byteArray.getId()); } return event; }
public void setByteArrayValue(byte[] bytes, boolean isTransient) { if (bytes != null) { // note: there can be cases where byteArrayId is not null // but the corresponding byte array entity has been removed in parallel; // thus we also need to check if the actual byte array entity still exists if (this.byteArrayId != null && getByteArrayEntity() != null) { byteArrayValue.setBytes(bytes); } else { deleteByteArrayValue(); byteArrayValue = new ByteArrayEntity(nameProvider.getName(), bytes, type, rootProcessInstanceId, removalTime); // avoid insert of byte array value for a transient variable if (!isTransient) { Context. getCommandContext() .getByteArrayManager() .insertByteArray(byteArrayValue); byteArrayId = byteArrayValue.getId(); } } } else { deleteByteArrayValue(); } }
public void setByteArrayValue(byte[] bytes, boolean isTransient) { if (bytes != null) { // note: there can be cases where byteArrayId is not null // but the corresponding byte array entity has been removed in parallel; // thus we also need to check if the actual byte array entity still exists if (this.byteArrayId != null && getByteArrayEntity() != null) { byteArrayValue.setBytes(bytes); } else { deleteByteArrayValue(); byteArrayValue = new ByteArrayEntity(nameProvider.getName(), bytes, type, rootProcessInstanceId, removalTime); // avoid insert of byte array value for a transient variable if (!isTransient) { Context. getCommandContext() .getByteArrayManager() .insertByteArray(byteArrayValue); byteArrayId = byteArrayValue.getId(); } } } else { deleteByteArrayValue(); } }
public Void execute(CommandContext commandContext) { for (int i = 0; i < 1234; i++) { HistoricJobLogEventEntity log = new HistoricJobLogEventEntity(); log.setJobId(String.valueOf(i)); log.setTimestamp(new Date()); log.setJobDefinitionType(MessageEntity.TYPE); log.setProcessDefinitionId(processDefinitionId); byte[] aByteValue = StringUtil.toByteArray("abc"); ByteArrayEntity byteArray = ExceptionUtil.createJobExceptionByteArray(aByteValue, ResourceTypes.HISTORY); log.setExceptionByteArrayId(byteArray.getId()); commandContext .getHistoricJobLogManager() .insert(log); } return null; }
public Void execute(CommandContext commandContext) { ensureNotNull("userId", userId); IdentityInfoEntity pictureInfo = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if (pictureInfo != null) { String byteArrayId = pictureInfo.getValue(); if (byteArrayId != null) { commandContext.getByteArrayManager() .deleteByteArrayById(byteArrayId); } } else { pictureInfo = new IdentityInfoEntity(); pictureInfo.setUserId(userId); pictureInfo.setKey("picture"); commandContext.getDbEntityManager().insert(pictureInfo); } ByteArrayEntity byteArrayEntity = new ByteArrayEntity(picture.getMimeType(), picture.getBytes(), ResourceTypes.REPOSITORY); commandContext.getByteArrayManager() .insertByteArray(byteArrayEntity); pictureInfo.setValue(byteArrayEntity.getId()); return null; }
public Void execute(CommandContext commandContext) { ensureNotNull("userId", userId); IdentityInfoEntity pictureInfo = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if (pictureInfo != null) { String byteArrayId = pictureInfo.getValue(); if (byteArrayId != null) { commandContext.getByteArrayManager() .deleteByteArrayById(byteArrayId); } } else { pictureInfo = new IdentityInfoEntity(); pictureInfo.setUserId(userId); pictureInfo.setKey("picture"); commandContext.getDbEntityManager().insert(pictureInfo); } ByteArrayEntity byteArrayEntity = new ByteArrayEntity(picture.getMimeType(), picture.getBytes(), ResourceTypes.REPOSITORY); commandContext.getByteArrayManager() .insertByteArray(byteArrayEntity); pictureInfo.setValue(byteArrayEntity.getId()); return null; }
attachment.setContentId(byteArray.getId());
attachment.setContentId(byteArray.getId());
.getByteArrayManager() .insertByteArray(byteArrayEntity); historyEvent.setByteArrayId(byteArrayEntity.getId());
.getByteArrayManager() .insertByteArray(byteArrayEntity); historyEvent.setByteArrayId(byteArrayEntity.getId());
public void setErrorDetails(String exception) { EnsureUtil.ensureNotNull("exception", exception); byte[] exceptionBytes = toByteArray(exception); ByteArrayEntity byteArray = createExceptionByteArray(EXCEPTION_NAME, exceptionBytes, ResourceTypes.HISTORY); byteArray.setRootProcessInstanceId(rootProcessInstanceId); byteArray.setRemovalTime(removalTime); errorDetailsByteArrayId = byteArray.getId(); }