protected void writeToValueFields(ObjectValue value, ValueFields valueFields, byte[] serializedValue) { String objectTypeName = getObjectTypeName(value, valueFields); valueFields.setByteArrayValue(serializedValue); valueFields.setTextValue2(objectTypeName); }
protected void writeToValueFields(ObjectValue value, ValueFields valueFields, byte[] serializedValue) { String objectTypeName = getObjectTypeName(value, valueFields); valueFields.setByteArrayValue(serializedValue); valueFields.setTextValue2(objectTypeName); }
@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()); } }
@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(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); } }
protected void writeToValueFields(ObjectValue value, ValueFields valueFields, byte[] serializedValue) { String objectTypeName = getObjectTypeName(value, valueFields); valueFields.setByteArrayValue(serializedValue); valueFields.setTextValue2(objectTypeName); }
@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(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); } }