刘光辉
11 小时以前 0dfe84494048ce27ba8449831782128412d3eb13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory';
import YmDefaultSize from './shapeSize';
import { bpmnInclusive, typeConfluence } from '../config/variableName';
 
class YmElementFactory extends ElementFactory {
  constructor(bpmnFactory: any, moddle: any, translate: any) {
    super(bpmnFactory, moddle, translate);
  }
 
  create(elementType: any, attrs: any): any {
    if (attrs.type === bpmnInclusive + '_confluence') {
      attrs.type = bpmnInclusive;
      attrs.businessObject.wnType = typeConfluence;
    }
    return super.create(elementType, attrs);
  }
 
  createBpmnElement(elementType: any, attrs: any) {
    // @ts-ignore
    return super.createBpmnElement(elementType, attrs);
  }
 
  getDefaultSize(element: any, di: any) {
    return YmDefaultSize(element, di);
  }
 
  createParticipantShape(attrs: any) {
    return super.createParticipantShape(attrs);
  }
}
 
YmElementFactory.$inject = ['bpmnFactory', 'moddle', 'translate'];
 
export default YmElementFactory;