Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4240

local variables (properties) in event subprocess are not persisted correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jBPM 6.1.0.Final
    • jBPM 6.0.0.Beta5
    • Persistence
    • None
    • Hide

      Create simple process with a event subprocess. In the subprocess simply put message start event saving received payload and define a (local) property in the subprocess. Configure start event to save event payload to local defined property (variable) . Add timer event to wait few seconds . Before timer pass local variables is correctly valued. At runtime after timer the local variable is null.

      You can use attached BPMN2 and signal process by event "Message-MAIL" passing any hashmap as payload.

      Show
      Create simple process with a event subprocess. In the subprocess simply put message start event saving received payload and define a (local) property in the subprocess. Configure start event to save event payload to local defined property (variable) . Add timer event to wait few seconds . Before timer pass local variables is correctly valued. At runtime after timer the local variable is null. You can use attached BPMN2 and signal process by event "Message-MAIL" passing any hashmap as payload.

    Description

      event subprocess can declare local properties (instead to use main process variables).
      Infact i can receive and correctly save received event payload to local defined variable.
      But when subprocess pass throw any waiting node (for example timer event) local variables are not persisted and further use of them fail because they result to be null.
      This cause event subprocess to be almost unuseful because they can only use global variables causing uncontrolled side effects when multiple event subprocess run in parallel (as in the nature of event subprocesses).

      I noticed that the class org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller in method readNodeInstance has switch case on all different type of nodes to be unmarshalled.

      in case of EVENT_SUBPROCESS_NODE the variablescopeinstance is not restored like in case of COMPOSITE_CONTEXT_NODE.
      In the marshaller method (writeNodeinstanceContent) the variablescopeinstance is stored for EVENT_SUBPROCESS_NODE but then is not restored during unmarshalling so my suspect is about this class but i don't know enough the runtime to be sure about it.

      Thanks

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            paolo.cappuccini Paolo Cappuccini (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: