UNPKG

bpmnlint

Version:

Validate your BPMN diagrams based on configurable lint rules

36 lines (27 loc) 636 B
const { is } = require('bpmnlint-utils'); const { annotateRule } = require('./helper'); /** * A rule that checks, whether a gateway forks and joins * at the same time. * * @type { import('../lib/types.js').RuleFactory } */ module.exports = function() { function check(node, reporter) { if (!is(node, 'bpmn:Gateway')) { return; } const incoming = node.incoming || []; const outgoing = node.outgoing || []; if (incoming.length > 1 && outgoing.length > 1) { reporter.report(node.id, 'Gateway forks and joins'); } } return annotateRule('no-gateway-join-fork', { check }); };