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

I can read about setting local variables via call activity output mapping

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Won't Fix
    • L3 - Default
    • None
    • 7.7.x, 7.8.x, 7.9.x
    • documentation

    Description

      I can image it is a common use case to set variables only on a local scope instead globally, but the documentation is not really helpful in this case. We should improve the documentation and write maybe more explicit examples for the input and output mappings.

      Scenario:

      Say you have an parallel multi instance sub process and in this process you have a call activity.
      You want to map the result of the call activity only into the local scope of the sub process not into the global scope, where race conditions can happen (since we have a parallel multi instance this would overwrite the results).

      There exist some solutions for this case:

      • Create on input mapping on the sub process to create the result variable,
        then on output mapping of the call activity the variable is simply overwritten only in this scope
      • Use DelegateVariableMapping and set the variable via void setVariable (String variableName, Object value, String activityId);, where the activity id is the sub process id. This will set the variable in the scope of the sub process.

      To find this kind of solution, an user needs some deeper knowledge about the API and the engine. I uploaded an example to make this more clear.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          1. asu-preparation.bpmn
            12 kB
          2. asu-prepare-node.bpmn
            7 kB
          3. DeleVarMapping.java
            0.7 kB

          Activity

            People

              Unassigned Unassigned
              christopher.zell Christopher Kujawa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce