use of org.activiti.engine.impl.variable.JsonTypeConverter in project Activiti by Activiti.
the class ProcessEngineConfigurationImpl method initVariableTypes.
public void initVariableTypes() {
if (variableTypes == null) {
variableTypes = new DefaultVariableTypes();
if (customPreVariableTypes != null) {
for (VariableType customVariableType : customPreVariableTypes) {
variableTypes.addType(customVariableType);
}
}
variableTypes.addType(new NullType());
variableTypes.addType(new StringType(getMaxLengthString()));
variableTypes.addType(new LongStringType(getMaxLengthString() + 1));
variableTypes.addType(new BooleanType());
variableTypes.addType(new ShortType());
variableTypes.addType(new IntegerType());
variableTypes.addType(new LongType());
variableTypes.addType(new DateType());
variableTypes.addType(new JodaDateType());
variableTypes.addType(new JodaDateTimeType());
variableTypes.addType(new DoubleType());
variableTypes.addType(new UUIDType());
objectMapper.configOverride(BigDecimal.class).setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.STRING));
JsonTypeConverter jsonTypeConverter = new JsonTypeConverter(objectMapper, javaClassFieldForJackson);
variableTypes.addType(new JsonType(getMaxLengthString(), objectMapper, serializePOJOsInVariablesToJson, jsonTypeConverter));
variableTypes.addType(new LongJsonType(getMaxLengthString() + 1, objectMapper, serializePOJOsInVariablesToJson, jsonTypeConverter));
// if java serliazation needed together with json defaulting then add to customPostVariableTypes
if (!serializePOJOsInVariablesToJson) {
variableTypes.addType(new ByteArrayType());
variableTypes.addType(new SerializableType(serializableVariableTypeTrackDeserializedObjects));
variableTypes.addType(new CustomObjectType("item", ItemInstance.class));
variableTypes.addType(new CustomObjectType("message", MessageInstance.class));
}
if (customPostVariableTypes != null) {
for (VariableType customVariableType : customPostVariableTypes) {
variableTypes.addType(customVariableType);
}
}
}
}
Aggregations