mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-26 12:40:20 +08:00

This commit adds a basic implementation for model drop * using rules to check whether the drop is allowed * updating the model after drop See #127
23 lines
564 B
JavaScript
23 lines
564 B
JavaScript
'use strict';
|
|
|
|
var _ = require('lodash');
|
|
|
|
|
|
function can(context) {
|
|
|
|
var source = context.source,
|
|
target = context.target;
|
|
|
|
if (source.labelTarget || target.labelTarget) {
|
|
return null;
|
|
}
|
|
|
|
return source.businessObject.$parent === target.businessObject.$parent &&
|
|
source.businessObject.$instanceOf('bpmn:FlowNode') &&
|
|
!source.businessObject.$instanceOf('bpmn:EndEvent') &&
|
|
!target.businessObject.$instanceOf('bpmn:StartEvent') &&
|
|
target.businessObject.$instanceOf('bpmn:FlowElement');
|
|
}
|
|
|
|
module.exports.can = can;
|