Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-9150

Transient variables should not require a serializer

    Details

    • Type: Feature Request
    • Status: Open
    • Priority: L3 - Default
    • Resolution: Unresolved
    • Affects Version/s: 7.9.0
    • Fix Version/s: None
    • Component/s: engine
    • Labels:
      None

      Description

      Transient variables are an awesome feature! Unfortunately they still seem to require a serializer, so it's not possible to start a process for example with an InputStream as a variable.

      Map<String, Object> variables = new HashMap<>();
      variables.put("upload", Variables.objectValue(new ByteArrayInputStream("foobar".getBytes(StandardCharsets.UTF_8)), true).create());
      
      String businessKey = UUID.randomUUID().toString();
      ProcessInstance processInstance = runtimeService().startProcessInstanceByKey("testProcess", businessKey, variables);
      

      A testcase can be found at https://github.com/jhorstmann/camunda-engine-unittest/tree/start-process-with-transient-variables

      Currently it fails with

      SEVERE: ENGINE-16004 Exception while closing command context: Cannot find serializer for value 'ObjectValue [value=java.io.ByteArrayInputStream@3faf2e7d, isDeserialized=true, serializationDataFormat=null, objectTypeName=null, serializedValue=null, isTransient=true]'.
      org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'ObjectValue [value=java.io.ByteArrayInputStream@3faf2e7d, isDeserialized=true, serializationDataFormat=null, objectTypeName=null, serializedValue=null, isTransient=true]'.
      	at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:84)
      	at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.setValue(TypedValueField.java:110)
      	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.<init>(VariableInstanceEntity.java:122)
      	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:141)
      	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:27)
      	at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:21)
      	at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:447)
      	at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:453)
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            jhorstmann Jörn Horstmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development