protected byte[] getSerializedBytesValue(String serializedStringValue) { if(serializedStringValue != null) { byte[] serializedByteValue = StringUtil.toByteArray(serializedStringValue); if (!isSerializationTextBased()) { serializedByteValue = Base64.decodeBase64(serializedByteValue); } return serializedByteValue; } else { return null; } }
protected byte[] getSerializedBytesValue(String serializedStringValue) { if(serializedStringValue != null) { byte[] serializedByteValue = StringUtil.toByteArray(serializedStringValue); if (!isSerializationTextBased()) { serializedByteValue = Base64.decodeBase64(serializedByteValue); } return serializedByteValue; } else { return null; } }
/** * Gets the bytes from a string using the current process engine's default charset * * @param string the string to get the bytes form * @return the byte array */ public static byte[] toByteArray(String string) { EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); return toByteArray(string, processEngineConfiguration.getProcessEngine()); }
/** * Gets the bytes from a string using the current process engine's default charset * * @param string the string to get the bytes form * @return the byte array */ public static byte[] toByteArray(String string) { EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); return toByteArray(string, processEngineConfiguration.getProcessEngine()); }
public static byte[] asBytes(JsonElement jsonObject) { String jsonString = null; if (jsonObject != null) { try { jsonString = getGsonMapper().toJson(jsonObject); } catch (JsonIOException e) { LOG.logJsonException(e); } } if (jsonString == null) { jsonString = ""; } return StringUtil.toByteArray(jsonString); }
public static byte[] asBytes(JsonElement jsonObject) { String jsonString = null; if (jsonObject != null) { try { jsonString = getGsonMapper().toJson(jsonObject); } catch (JsonIOException e) { LOG.logJsonException(e); } } if (jsonString == null) { jsonString = ""; } return StringUtil.toByteArray(jsonString); }
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); } }
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 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 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; }
protected byte[] getSerializedBytesValue(String serializedStringValue) { if(serializedStringValue != null) { byte[] serializedByteValue = StringUtil.toByteArray(serializedStringValue); if (!isSerializationTextBased()) { serializedByteValue = Base64.decodeBase64(serializedByteValue); } return serializedByteValue; } else { return null; } }
/** * Gets the bytes from a string using the current process engine's default charset * * @param string the string to get the bytes form * @return the byte array */ public static byte[] toByteArray(String string) { EnsureUtil.ensureActiveCommandContext("StringUtil.toByteArray"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); return toByteArray(string, processEngineConfiguration.getProcessEngine()); }
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 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); } }