How to use the bpmn-js-properties-panel/lib/helper/CmdHelper.updateBusinessObject function in bpmn-js-properties-panel

To help you get started, we’ve selected a few bpmn-js-properties-panel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / CallActivityProps.js View on Github external
// ensure zeebe:calledElement
    let calledElement = getCalledElement(businessObject);
    if (!calledElement) {
      calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
      commands.push(cmdHelper.addAndRemoveElementsFromList(
        element,
        extensionElements,
        'values',
        'extensionElements',
        [ calledElement ],
        []
      ));
    }

    // update properties
    commands.push(cmdHelper.updateBusinessObject(element, calledElement, values));
    return commands;
  }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / TaskDefinitionProps.js View on Github external
// create taskDefinition
      let taskDefinition = getTaskDefinition(element);

      if (!taskDefinition) {
        taskDefinition = elementHelper.createElement('zeebe:TaskDefinition', { }, extensionElements, bpmnFactory);
        commands.push(cmdHelper.addAndRemoveElementsFromList(
          element,
          extensionElements,
          'values',
          'extensionElements',
          [ taskDefinition ],
          []
        ));
      }

      commands.push(cmdHelper.updateBusinessObject(element, taskDefinition, values));
      return commands;
    }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / CallActivityProps.js View on Github external
function setProperties(element, values) {

    const businessObject = getBusinessObject(element),
          commands = [];

    // ensure extensionElements
    let extensionElements = businessObject.get('extensionElements');
    if (!extensionElements) {
      extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
      commands.push(cmdHelper.updateBusinessObject(element, businessObject, { extensionElements: extensionElements }));
    }

    // ensure zeebe:calledElement
    let calledElement = getCalledElement(businessObject);
    if (!calledElement) {
      calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
      commands.push(cmdHelper.addAndRemoveElementsFromList(
        element,
        extensionElements,
        'values',
        'extensionElements',
        [ calledElement ],
        []
      ));
    }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / implementation / MultiInstanceLoopCharacteristics.js View on Github external
function setProperties(element, values) {
    const loopCharacteristics = getLoopCharacteristics(element),
          commands = [];

    // ensure extensionElements
    let extensionElements = loopCharacteristics.get('extensionElements');
    if (!extensionElements) {
      extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, loopCharacteristics, bpmnFactory);
      commands.push(cmdHelper.updateBusinessObject(element, loopCharacteristics, { extensionElements: extensionElements }));
    }

    // ensure zeebe:LoopCharacteristics
    let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
    if (!zeebeLoopCharacteristics) {
      zeebeLoopCharacteristics = elementHelper.createElement('zeebe:LoopCharacteristics', { }, extensionElements, bpmnFactory);
      commands.push(cmdHelper.addAndRemoveElementsFromList(
        element,
        extensionElements,
        'values',
        'extensionElements',
        [ zeebeLoopCharacteristics ],
        []
      ));
    }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / implementation / MultiInstanceLoopCharacteristics.js View on Github external
// ensure zeebe:LoopCharacteristics
    let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
    if (!zeebeLoopCharacteristics) {
      zeebeLoopCharacteristics = elementHelper.createElement('zeebe:LoopCharacteristics', { }, extensionElements, bpmnFactory);
      commands.push(cmdHelper.addAndRemoveElementsFromList(
        element,
        extensionElements,
        'values',
        'extensionElements',
        [ zeebeLoopCharacteristics ],
        []
      ));
    }

    commands.push(cmdHelper.updateBusinessObject(element, zeebeLoopCharacteristics, values));
    return commands;
  }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / HeadersProps.js View on Github external
createParent: function(element, bo) {
      const parent = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
      const cmd = cmdHelper.updateBusinessObject(element, bo, { extensionElements: parent });
      return {
        cmd: cmd,
        parent: parent
      };
    }
  });
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / implementation / ElementReferenceExtensionElementProperty.js View on Github external
let extensionElement = getExtensionElement(reference);

      if (!extensionElement) {
        extensionElement = elementHelper.createElement(extensionElementKey, { }, extensionElements, bpmnFactory);
        commands.push(cmdHelper.addAndRemoveElementsFromList(
          element,
          extensionElements,
          'values',
          'extensionElements',
          [ extensionElement ],
          []
        ));
      }

      commands.push(cmdHelper.updateBusinessObject(element, extensionElement, values));
      return commands;
    },
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / properties-provider / parts / implementation / TimerEventDefinition.js View on Github external
set: function(element, values) {
      const type = getTimerDefinitionType(timerEventDefinition);
      const definition = type && timerEventDefinition.get(type);

      if (definition) {
        return cmdHelper.updateBusinessObject(element, definition, {
          body: values.timerDefinition || undefined
        });
      }
    },

bpmn-js-properties-panel

A simple properties panel for bpmn-js

MIT
Latest version published 9 days ago

Package Health Score

90 / 100
Full package analysis