Documentation or tutorial on updateProperties

We have implemented a properties panel with a number of custom properties and are setting those by updating the business object directly. Since this prevents us from using undo / redo, I would like to change this to use the updateProperties function as recommended.

Here is where I run into a problem though: I don’t really know what the function expects and how to translate the behaviour we have so far into it. Let’s take this example:

    <bpmn2:serviceTask id="Activity_0sa3w5i" name="Send E-Mail" activiti:async="true">
      <bpmn2:extensionElements>
        <activiti:field name="subject">
          <activiti:string>test</activiti:string>
        </activiti:field>
      </bpmn2:extensionElements>
    </bpmn2:serviceTask>

How would I use updateProperties to set the string “test” for the field subject? And how would it behave if the extensionElements and / or the field do not exist yet?

I know I can update f.e. the name with the following function, but I don’t even have an idea what the call for extension elements would look like.

  modeling.updateProperties(element, {
      name: "Unsend E-Mail"
    });
  }

I am using modeling.updateModdlePropertie to update the properties of my extension elements. This works with undo/redo. I am not sure what the difference is, but this works for me.

See my bpmn-token library. For example, the method updateTokenProperties in TokenSnapshotBehavior. I added tokens to BPMN and save them in the extension elements (see token-bpmn-moddle).

I have by now found this example, which seems to work despite it’s age. Now I’m running into another issue, but that is a question for another thread.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.