public void writeValue(LongValue value, ValueFields valueFields) { final Long longValue = value.getValue(); valueFields.setLongValue(longValue); if (longValue!=null) { valueFields.setTextValue(longValue.toString()); } else { valueFields.setTextValue(null); } }
public void writeValue(ObjectValue objectValue, ValueFields valueFields) { EntityManagerSession entityManagerSession = Context .getCommandContext() .getSession(EntityManagerSession.class); if (entityManagerSession == null) { throw new ProcessEngineException("Cannot set JPA variable: " + EntityManagerSession.class + " not configured"); } else { // Before we set the value we must flush all pending changes from the entitymanager // If we don't do this, in some cases the primary key will not yet be set in the object // which will cause exceptions down the road. entityManagerSession.flush(); } Object value = objectValue.getValue(); if(value != null) { String className = mappings.getJPAClassString(value); String idString = mappings.getJPAIdString(value); valueFields.setTextValue(className); valueFields.setTextValue2(idString); } else { valueFields.setTextValue(null); valueFields.setTextValue2(null); } }
public void writeValue(ObjectValue objectValue, ValueFields valueFields) { EntityManagerSession entityManagerSession = Context .getCommandContext() .getSession(EntityManagerSession.class); if (entityManagerSession == null) { throw new ProcessEngineException("Cannot set JPA variable: " + EntityManagerSession.class + " not configured"); } else { // Before we set the value we must flush all pending changes from the entitymanager // If we don't do this, in some cases the primary key will not yet be set in the object // which will cause exceptions down the road. entityManagerSession.flush(); } Object value = objectValue.getValue(); if(value != null) { String className = mappings.getJPAClassString(value); String idString = mappings.getJPAIdString(value); valueFields.setTextValue(className); valueFields.setTextValue2(idString); } else { valueFields.setTextValue(null); valueFields.setTextValue2(null); } }
public void writeValue(LongValue value, ValueFields valueFields) { final Long longValue = value.getValue(); valueFields.setLongValue(longValue); if (longValue!=null) { valueFields.setTextValue(longValue.toString()); } else { valueFields.setTextValue(null); } }
@Override public void writeValue(FileValue value, ValueFields valueFields) { byte[] data = ((FileValueImpl) value).getByteArray(); valueFields.setByteArrayValue(data); valueFields.setTextValue(value.getFilename()); if (value.getMimeType() == null && value.getEncoding() != null) { valueFields.setTextValue2(MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } else if (value.getMimeType() != null && value.getEncoding() == null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR); } else if (value.getMimeType() != null && value.getEncoding() != null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } }
public void writeValue(StringValue variableValue, ValueFields valueFields) { valueFields.setTextValue(variableValue.getValue()); }
@Override public void writeValue(FileValue value, ValueFields valueFields) { byte[] data = ((FileValueImpl) value).getByteArray(); valueFields.setByteArrayValue(data); valueFields.setTextValue(value.getFilename()); if (value.getMimeType() == null && value.getEncoding() != null) { valueFields.setTextValue2(MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } else if (value.getMimeType() != null && value.getEncoding() == null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR); } else if (value.getMimeType() != null && value.getEncoding() != null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } }
public void writeValue(StringValue variableValue, ValueFields valueFields) { valueFields.setTextValue(variableValue.getValue()); }
public void writeValue(ObjectValue objectValue, ValueFields valueFields) { EntityManagerSession entityManagerSession = Context .getCommandContext() .getSession(EntityManagerSession.class); if (entityManagerSession == null) { throw new ProcessEngineException("Cannot set JPA variable: " + EntityManagerSession.class + " not configured"); } else { // Before we set the value we must flush all pending changes from the entitymanager // If we don't do this, in some cases the primary key will not yet be set in the object // which will cause exceptions down the road. entityManagerSession.flush(); } Object value = objectValue.getValue(); if(value != null) { String className = mappings.getJPAClassString(value); String idString = mappings.getJPAIdString(value); valueFields.setTextValue(className); valueFields.setTextValue2(idString); } else { valueFields.setTextValue(null); valueFields.setTextValue2(null); } }
public void writeValue(IntegerValue variableValue, ValueFields valueFields) { Integer value = variableValue.getValue(); if (value!=null) { valueFields.setLongValue(((Integer) value).longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }
@Override public void writeValue(FileValue value, ValueFields valueFields) { byte[] data = ((FileValueImpl) value).getByteArray(); valueFields.setByteArrayValue(data); valueFields.setTextValue(value.getFilename()); if (value.getMimeType() == null && value.getEncoding() != null) { valueFields.setTextValue2(MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } else if (value.getMimeType() != null && value.getEncoding() == null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR); } else if (value.getMimeType() != null && value.getEncoding() != null) { valueFields.setTextValue2(value.getMimeType() + MIMETYPE_ENCODING_SEPARATOR + value.getEncoding()); } }
public void writeValue(IntegerValue variableValue, ValueFields valueFields) { Integer value = variableValue.getValue(); if (value!=null) { valueFields.setLongValue(((Integer) value).longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }
public void writeValue(ShortValue value, ValueFields valueFields) { Short shortValue = value.getValue(); if (shortValue != null) { valueFields.setLongValue(shortValue.longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }
public void writeValue(ShortValue value, ValueFields valueFields) { Short shortValue = value.getValue(); if (shortValue != null) { valueFields.setLongValue(shortValue.longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }
public void writeValue(LongValue value, ValueFields valueFields) { final Long longValue = value.getValue(); valueFields.setLongValue(longValue); if (longValue!=null) { valueFields.setTextValue(longValue.toString()); } else { valueFields.setTextValue(null); } }
public void writeValue(StringValue variableValue, ValueFields valueFields) { valueFields.setTextValue(variableValue.getValue()); }
public void writeValue(IntegerValue variableValue, ValueFields valueFields) { Integer value = variableValue.getValue(); if (value!=null) { valueFields.setLongValue(((Integer) value).longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }
public void writeValue(ShortValue value, ValueFields valueFields) { Short shortValue = value.getValue(); if (shortValue != null) { valueFields.setLongValue(shortValue.longValue()); valueFields.setTextValue(value.toString()); } else { valueFields.setLongValue(null); valueFields.setTextValue(null); } }