How to use the dmn-js-shared/lib/util/ModelUtil.isOutput function in dmn-js-shared

To help you get started, we’ve selected a few dmn-js-shared 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-decision-table / src / features / simple-date-edit / SimpleDateEdit.js View on Github external
simpleMode.registerProvider(element => {
      const typeRef = getTypeRef(element);

      return (isInput(element.col) || isOutput(element.col))
        && isDate(typeRef);
    });
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / simple-number-edit / SimpleNumberEdit.js View on Github external
simpleMode.registerProvider(element => {
      const typeRef = getTypeRef(element);

      return (isInput(element.col) || isOutput(element.col))
        && (typeRef === 'integer' || typeRef === 'long' || typeRef === 'double');
    });
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / simple-date-edit / SimpleDateEdit.js View on Github external
components.onGetComponent('context-menu', (context = {}) => {
      if (context.contextMenuType && context.contextMenuType === 'simple-mode-edit') {

        if (!context.element) {
          return;
        }

        const typeRef = getTypeRef(context.element);

        if (isDate(typeRef)) {

          if (isInput(context.element.col)) {
            return InputDateEdit;
          } else if (isOutput(context.element.col)) {
            return OutputDateEdit;
          }

        }

      }
    });
  }
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / rules / DecisionTableModelingRules.js View on Github external
this.addRule('col.remove', HIGH_PRIORITY, ({ col }) => {
      const { cols } = this._sheet.getRoot();

      if (isOutput(col)) {
        return cols.filter(c => isOutput(c)).length > 1;
      }

      return true;
    });
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / type-ref / components / TypeRefCellContextMenu.js View on Github external
element
    } = this.props.context;

    const actualElement = is(element, 'dmn:LiteralExpression')
      ? element.$parent
      : element;

    let newProperties;

    if (isInput(actualElement)) {
      newProperties = {
        inputExpression: {
          typeRef: value
        }
      };
    } else if (isOutput(actualElement)) {
      newProperties = {
        typeRef: value
      };
    }

    this._modeling.updateProperties(actualElement, newProperties);
  }
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / drag-and-drop / DragAndDrop.js View on Github external
function getColLeft(col, cols) {
  const index = cols.indexOf(col);

  if (isOutput(col)) {
    const firstOutput = cols.filter(col => isOutput(col))[0];

    const firstOutputIndex = cols.indexOf(firstOutput);

    return cols[ Math.max(firstOutputIndex, index - 1) ];
  }

  return cols[ Math.max(0, index - 1) ];
}
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / simple-number-edit / SimpleNumberEdit.js View on Github external
components.onGetComponent('context-menu', (context = {}) => {
      if (context.contextMenuType && context.contextMenuType === 'simple-mode-edit') {

        if (!context.element) {
          return;
        }

        const typeRef = getTypeRef(context.element);

        if (isNumber(typeRef)) {

          if (isInput(context.element.col)) {
            return InputNumberEdit;
          } else if (isOutput(context.element.col)) {
            return OutputNumberEdit;
          }

        }

      }
    });
  }
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / simple-boolean-edit / SimpleBooleanEdit.js View on Github external
simpleMode.registerProvider(element => {
      return (isInput(element.col) || isOutput(element.col))
        && getTypeRef(element) === 'boolean';
    });
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / simple-mode / components / SimpleModeButtonComponent.js View on Github external
function getDefaultExpressionLanguage(cell, expressionLanguages) {
  if (isInput(cell.col)) {
    return expressionLanguages.getDefault('inputCell').value;
  } else if (isOutput(cell.col)) {
    return expressionLanguages.getDefault('outputCell').value;
  }
}