Example #1
0
        public virtual TypedValue setValue(TypedValue value)
        {
            // determine serializer to use
            serializer     = Serializers.findSerializerForValue(value, Context.ProcessEngineConfiguration.FallbackSerializerFactory);
            serializerName = serializer.Name;

            if (value is UntypedValueImpl)
            {
                // type has been detected
                value = serializer.convertToTypedValue((UntypedValueImpl)value);
            }

            // set new value
            writeValue(value, valueFields);

            // cache the value
            cachedValue = value;

            // ensure that we serialize the object on command context flush
            // if it can be implicitly changed
            if (notifyOnImplicitUpdates && isMutableValue(cachedValue))
            {
                Context.CommandContext.registerCommandContextListener(this);
            }

            return(value);
        }
Example #2
0
        public virtual void initializeValue(VariableSerializers serializers, TypedValue typedValue)
        {
            TypedValueSerializer serializer = determineSerializer(serializers, typedValue);

            if (typedValue is UntypedValueImpl)
            {
                // type has been detected
                typedValue = serializer.convertToTypedValue((UntypedValueImpl)typedValue);
            }
            serializer.writeValue(typedValue, this);
            this.type = serializer.Name;
        }