protected ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager, T jobConfiguration) { ByteArrayEntity configurationEntity = new ByteArrayEntity(); configurationEntity.setBytes(writeConfiguration(jobConfiguration)); byteArrayManager.insert(configurationEntity); return configurationEntity; }
protected ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager, T jobConfiguration) { ByteArrayEntity configurationEntity = new ByteArrayEntity(); configurationEntity.setBytes(writeConfiguration(jobConfiguration)); byteArrayManager.insert(configurationEntity); return configurationEntity; }
/** * create ByteArrayEntity with specified name and payload and make sure it's * persisted * * used in Jobs and ExternalTasks * * @param name - type\source of the exception * @param byteArray - payload of the exception * @param type - resource type of the exception * @return persisted entity */ public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) { ByteArrayEntity result = null; if (byteArray != null) { result = new ByteArrayEntity(name, byteArray, type); Context.getCommandContext() .getByteArrayManager() .insertByteArray(result); } return result; }
/** * create ByteArrayEntity with specified name and payload and make sure it's * persisted * * used in Jobs and ExternalTasks * * @param name - type\source of the exception * @param byteArray - payload of the exception * @param type - resource type of the exception * @return persisted entity */ public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) { ByteArrayEntity result = null; if (byteArray != null) { result = new ByteArrayEntity(name, byteArray, type); Context.getCommandContext() .getByteArrayManager() .insertByteArray(result); } return result; }
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) { 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; }
protected ByteArrayEntity saveConfiguration(ByteArrayManager byteArrayManager, T jobConfiguration) { ByteArrayEntity configurationEntity = new ByteArrayEntity(); configurationEntity.setBytes(writeConfiguration(jobConfiguration)); byteArrayManager.insert(configurationEntity); return configurationEntity; }
ByteArrayEntity byteArray = new ByteArrayEntity(bytes, ResourceTypes.HISTORY);
ByteArrayEntity byteArray = new ByteArrayEntity(bytes, ResourceTypes.HISTORY);
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(historyEvent.getVariableName(), byteValue, ResourceTypes.HISTORY); byteArrayEntity.setRootProcessInstanceId(historyEvent.getRootProcessInstanceId()); byteArrayEntity.setRemovalTime(historyEvent.getRemovalTime());
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(historyEvent.getVariableName(), byteValue, ResourceTypes.HISTORY); byteArrayEntity.setRootProcessInstanceId(historyEvent.getRootProcessInstanceId()); byteArrayEntity.setRemovalTime(historyEvent.getRemovalTime());
/** * create ByteArrayEntity with specified name and payload and make sure it's * persisted * * used in Jobs and ExternalTasks * * @param name - type\source of the exception * @param byteArray - payload of the exception * @param type - resource type of the exception * @return persisted entity */ public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) { ByteArrayEntity result = null; if (byteArray != null) { result = new ByteArrayEntity(name, byteArray, type); Context.getCommandContext() .getByteArrayManager() .insertByteArray(result); } return result; }
public ByteArrayEntity saveConfiguration(CustomBatchConfiguration jobConfiguration) { final ByteArrayManager byteArrayManager = Context.getCommandContext().getByteArrayManager(); final ByteArrayEntity configurationEntity = new ByteArrayEntity(); configurationEntity.setBytes(writeConfiguration(jobConfiguration)); byteArrayManager.insert(configurationEntity); return configurationEntity; }
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) { 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; }
ByteArrayEntity byteArray = new ByteArrayEntity(bytes, ResourceTypes.HISTORY);
ByteArrayEntity byteArrayEntity = new ByteArrayEntity(historyEvent.getVariableName(), byteValue, ResourceTypes.HISTORY); byteArrayEntity.setRootProcessInstanceId(historyEvent.getRootProcessInstanceId()); byteArrayEntity.setRemovalTime(historyEvent.getRemovalTime());