use of org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer in project camunda-bpm-platform by camunda.
the class SpinProcessEnginePlugin method registerSerializers.
protected void registerSerializers(ProcessEngineConfigurationImpl processEngineConfiguration) {
List<TypedValueSerializer<?>> spinDataFormatSerializers = lookupSpinSerializers();
VariableSerializers variableSerializers = processEngineConfiguration.getVariableSerializers();
int javaObjectSerializerIdx = variableSerializers.getSerializerIndexByName(JavaObjectSerializer.NAME);
for (TypedValueSerializer<?> spinSerializer : spinDataFormatSerializers) {
// add before java object serializer
variableSerializers.addSerializer(spinSerializer, javaObjectSerializerIdx);
}
}
use of org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer in project camunda-bpm-platform by camunda.
the class SpinProcessEnginePlugin method lookupSpinSerializers.
protected List<TypedValueSerializer<?>> lookupSpinSerializers() {
DataFormats globalFormats = DataFormats.getInstance();
List<TypedValueSerializer<?>> serializers = SpinVariableSerializers.createObjectValueSerializers(globalFormats);
serializers.addAll(SpinVariableSerializers.createSpinValueSerializers(globalFormats));
return serializers;
}
use of org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer in project camunda-bpm-platform by camunda.
the class SingleQueryVariableValueCondition method initializeValue.
public void initializeValue(VariableSerializers serializers, TypedValue typedValue) {
TypedValueSerializer serializer = determineSerializer(serializers, typedValue);
if (typedValue instanceof UntypedValueImpl) {
// type has been detected
typedValue = serializer.convertToTypedValue((UntypedValueImpl) typedValue);
}
serializer.writeValue(typedValue, this);
this.type = serializer.getName();
}
use of org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method checkJavaSerialization.
/**
* Checks, if Java serialization will be used and if it is allowed to be used.
* @param variableName
* @param value
*/
protected void checkJavaSerialization(String variableName, TypedValue value) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
if (value instanceof SerializableValue && !processEngineConfiguration.isJavaSerializationFormatEnabled()) {
SerializableValue serializableValue = (SerializableValue) value;
// if Java serialization is prohibited
if (!serializableValue.isDeserialized()) {
String javaSerializationDataFormat = Variables.SerializationDataFormats.JAVA.getName();
String requestedDataFormat = serializableValue.getSerializationDataFormat();
if (requestedDataFormat == null) {
// check if Java serializer will be used
final TypedValueSerializer serializerForValue = TypedValueField.getSerializers().findSerializerForValue(serializableValue, processEngineConfiguration.getFallbackSerializerFactory());
if (serializerForValue != null) {
requestedDataFormat = serializerForValue.getSerializationDataformat();
}
}
if (javaSerializationDataFormat.equals(requestedDataFormat)) {
throw ProcessEngineLogger.CORE_LOGGER.javaSerializationProhibitedException(variableName);
}
}
}
}
Aggregations