How to use the min-dash.find function in min-dash

To help you get started, we’ve selected a few min-dash 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 bpmn-io / dmn-js / packages / dmn-js-drd / src / features / modeling / DrdUpdater.js View on Github external
this.executed('connection.reconnect', function(context) {
    var connection = context.connection,
        connectionBo = connection.businessObject,
        oldSource = context.oldSource,
        newSource = context.newSource,
        oldTarget = context.oldTarget,
        oldTargetBo = oldTarget.businessObject,
        oldTargetBoExtensionElements = oldTargetBo.get('extensionElements'),
        newTarget = context.newTarget,
        newTargetBo = newTarget.businessObject,
        newTargetBoExtensionElements = newTargetBo.get('extensionElements');

    self.updateSemanticParent(connectionBo, newTargetBo);

    var edge = find(oldTargetBoExtensionElements.get('values'),
      function(extensionElement) {
        var source = extensionElement.source;

        return is(extensionElement, 'biodi:Edge') && source === oldSource.id;
      }
    );

    if (edge) {

      // (1) remove edge from old target
      remove(oldTargetBoExtensionElements.get('values'), edge);

      // (2) add edge to new target
      if (!is(newTarget, 'dmn:TextAnnotation')) {
        newTargetBoExtensionElements.get('values').push(edge);
      }
github bpmn-io / bpmn-moddle / test / spec / adapter / cmof / builder.js View on Github external
function findProperty(name) {
      return find(props, matchPattern({ name }));
    }
github bpmn-io / bpmn-js / test / spec / import / ImporterSpec.js View on Github external
moddle.fromXML(xml, function(err, definitions) {

      var selectedDiagram = find(definitions.diagrams, function(element) {
        return element.id === diagramId;
      });

      importBpmnDiagram(diagram, definitions, selectedDiagram, done);
    });
  }
github bpmn-io / bpmn-js / test / spec / features / modeling / behavior / ReplaceConnectionBehaviorSpec.js View on Github external
function getConnection(source, target, connectionOrType) {
  return find(source.outgoing, function(c) {
    return c.target === target &&
      (typeof connectionOrType === 'string' ? is(c, connectionOrType) : c === connectionOrType);
  });
}
github bpmn-io / cmmn-js / test / spec / features / modeling / AppendShapeSpec.js View on Github external
beforeEach(function() {

        connection = find(definitions.get('artifacts'), function(e) {
          return e.sourceRef === source.businessObject && e.targetRef === textAnnotation;
        });

      });
github bpmn-io / bpmn-js / test / spec / import / BpmnTreeWalkerSpec.js View on Github external
function findElement(element) {
    if (element.id === id) {
      return element;
    }

    if (element.flowElements) {
      return find(element.flowElements, function(flowElement) {
        var foundElement = findElement(flowElement);

        return foundElement && foundElement.id === id;
      });
    }
  }
github bpmn-io / bpmn-js-properties-panel / lib / provider / camunda / parts / ListenerDetailProps.js View on Github external
function getTimerEventDefinition(bo) {
  var eventDefinitions = bo.eventDefinitions || [];

  return find(eventDefinitions, function(event) {
    return is(event, 'bpmn:TimerEventDefinition');
  });

}
github bpmn-io / cmmn-js / lib / features / ordering / CmmnOrderingProvider.js View on Github external
function computeOrder(element) {

    if (isCMMNEdge(element)) {
      element = element.businessObject.cmmnElementRef || element;
    }

    var entry = find(orders, function(o) {
      return is(element, o.type);
    });

    return entry && entry.order || { level: 1 };
  }