Update shape with isMarkerVisible to false

How do I set the shape.businessObject.di.isMarkerVisible property to false?
Just setting it to false obviously does not trigger the correct events to re-render the shape.

(Yes, I know the bpmn spec discourage mixed usage of isMarkerVisible within the same diagram, but I still would like to know how to do it).

You’d need to write your own command handler for that or plug into Modeling.updateProperties:

eventBus.on('commandStack.element.updateProperties.preExecute', function(event) {
  var context = event.context;
  var properties = context.properties;
  // pull out isMarkerVisible property from properties into diProperties

eventBus.on('commandStack.element.updateProperties.execute', function(event) {
  // update di.isMarkerVisible

eventBus.on('commandStack.element.updateProperties.revert', function(event) {
  // undo di.isMarkerVisible change

For this you can use a CommandInterceptor, too.

As always, handle with care :warning:.