bpmn-js 9.0.0-subprocesses.0 → 9.0.0-subprocesses.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/dist/assets/bpmn-js.css +58 -0
- package/dist/assets/diagram-js.css +1 -0
- package/dist/bpmn-modeler.development.js +1756 -1632
- package/dist/bpmn-modeler.production.min.js +8 -7
- package/dist/bpmn-navigated-viewer.development.js +20855 -20345
- package/dist/bpmn-navigated-viewer.production.min.js +22 -20
- package/dist/bpmn-viewer.development.js +20049 -19562
- package/dist/bpmn-viewer.production.min.js +22 -20
- package/lib/Modeler.js +1 -4
- package/lib/Viewer.js +2 -2
- package/lib/draw/BpmnRenderer.js +367 -296
- package/lib/draw/PathMap.js +2 -2
- package/lib/features/auto-resize/BpmnAutoResizeProvider.js +3 -6
- package/lib/features/copy-paste/ModdleCopy.js +19 -2
- package/lib/features/modeling/BpmnFactory.js +8 -8
- package/lib/features/modeling/BpmnUpdater.js +0 -5
- package/lib/features/modeling/ElementFactory.js +27 -13
- package/lib/features/modeling/behavior/ResizeBehavior.js +129 -3
- package/lib/features/modeling/behavior/util/ResizeUtil.js +1 -132
- package/lib/features/replace/BpmnReplace.js +38 -16
- package/lib/features/subprocess-navigation/SubprocessCentering.js +55 -0
- package/lib/features/subprocess-navigation/SubprocessCompatibility.js +135 -0
- package/lib/features/subprocess-navigation/SubprocessElements.js +55 -0
- package/lib/features/subprocess-navigation/SubprocessFlows.js +109 -0
- package/lib/features/subprocess-navigation/SubprocessOverlays.js +104 -0
- package/lib/features/subprocess-navigation/index.js +18 -0
- package/lib/import/BpmnImporter.js +59 -10
- package/lib/import/BpmnTreeWalker.js +2 -2
- package/lib/import/Importer.js +4 -4
- package/lib/util/DiUtil.js +1 -0
- package/package.json +2 -2
- package/test/helper/index.js +6 -1
- package/test/util/MockEvents.js +10 -2
- package/lib/features/collapsed-subprocesses/DeleteBehaviour.js +0 -65
- package/lib/features/collapsed-subprocesses/ToggleCollapseBehaviour.js +0 -133
- package/lib/features/collapsed-subprocesses/diagramFactory.js +0 -56
- package/lib/features/collapsed-subprocesses/index.js +0 -12
- package/lib/features/collapsed-subprocesses-navigation/CollapsedSubprocessNavigation.js +0 -198
- package/lib/features/collapsed-subprocesses-navigation/index.js +0 -7
package/lib/draw/BpmnRenderer.js
CHANGED
|
@@ -383,8 +383,8 @@ export default function BpmnRenderer(
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
function as(type) {
|
|
386
|
-
return function(parentGfx, element) {
|
|
387
|
-
return handlers[type](parentGfx, element);
|
|
386
|
+
return function(parentGfx, element, attrs) {
|
|
387
|
+
return handlers[type](parentGfx, element, attrs);
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
|
|
@@ -392,58 +392,58 @@ export default function BpmnRenderer(
|
|
|
392
392
|
return handlers[type];
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
function renderEventContent(element, parentGfx) {
|
|
395
|
+
function renderEventContent(element, parentGfx, attrs) {
|
|
396
396
|
|
|
397
397
|
var event = getSemantic(element);
|
|
398
398
|
var isThrowing = isThrowEvent(event);
|
|
399
399
|
|
|
400
400
|
if (event.eventDefinitions && event.eventDefinitions.length>1) {
|
|
401
401
|
if (event.parallelMultiple) {
|
|
402
|
-
return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
402
|
+
return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
403
403
|
}
|
|
404
404
|
else {
|
|
405
|
-
return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
405
|
+
return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
|
|
410
|
-
return renderer('bpmn:MessageEventDefinition')(parentGfx, element, isThrowing);
|
|
410
|
+
return renderer('bpmn:MessageEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
|
|
414
|
-
return renderer('bpmn:TimerEventDefinition')(parentGfx, element, isThrowing);
|
|
414
|
+
return renderer('bpmn:TimerEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
|
|
418
|
-
return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element);
|
|
418
|
+
return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element, attrs);
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
|
|
422
|
-
return renderer('bpmn:SignalEventDefinition')(parentGfx, element, isThrowing);
|
|
422
|
+
return renderer('bpmn:SignalEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
|
|
426
|
-
return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, isThrowing);
|
|
426
|
+
return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
|
|
430
|
-
return renderer('bpmn:LinkEventDefinition')(parentGfx, element, isThrowing);
|
|
430
|
+
return renderer('bpmn:LinkEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
|
|
434
|
-
return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, isThrowing);
|
|
434
|
+
return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
|
|
438
|
-
return renderer('bpmn:CancelEventDefinition')(parentGfx, element, isThrowing);
|
|
438
|
+
return renderer('bpmn:CancelEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
|
|
442
|
-
return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, isThrowing);
|
|
442
|
+
return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
|
|
446
|
-
return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, isThrowing);
|
|
446
|
+
return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, attrs, isThrowing);
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
return null;
|
|
@@ -466,20 +466,20 @@ export default function BpmnRenderer(
|
|
|
466
466
|
return text;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
function renderEmbeddedLabel(parentGfx, element, align) {
|
|
469
|
+
function renderEmbeddedLabel(parentGfx, element, align, attrs) {
|
|
470
470
|
var semantic = getSemantic(element);
|
|
471
471
|
|
|
472
472
|
return renderLabel(parentGfx, semantic.name, {
|
|
473
473
|
box: element,
|
|
474
474
|
align: align,
|
|
475
475
|
padding: 5,
|
|
476
|
-
style: {
|
|
476
|
+
style: assign({
|
|
477
477
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
478
|
-
}
|
|
478
|
+
}, attrs)
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
function renderExternalLabel(parentGfx, element) {
|
|
482
|
+
function renderExternalLabel(parentGfx, element, attrs) {
|
|
483
483
|
|
|
484
484
|
var box = {
|
|
485
485
|
width: 90,
|
|
@@ -496,21 +496,22 @@ export default function BpmnRenderer(
|
|
|
496
496
|
textRenderer.getExternalStyle(),
|
|
497
497
|
{
|
|
498
498
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
499
|
-
}
|
|
499
|
+
},
|
|
500
|
+
attrs
|
|
500
501
|
)
|
|
501
502
|
});
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
function renderLaneLabel(parentGfx, text, element) {
|
|
505
|
+
function renderLaneLabel(parentGfx, text, element, attrs) {
|
|
505
506
|
var textBox = renderLabel(parentGfx, text, {
|
|
506
507
|
box: {
|
|
507
508
|
height: 30,
|
|
508
509
|
width: element.height
|
|
509
510
|
},
|
|
510
511
|
align: 'center-middle',
|
|
511
|
-
style: {
|
|
512
|
+
style: assign({
|
|
512
513
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
513
|
-
}
|
|
514
|
+
}, attrs)
|
|
514
515
|
});
|
|
515
516
|
|
|
516
517
|
var top = -1 * element.height;
|
|
@@ -537,11 +538,11 @@ export default function BpmnRenderer(
|
|
|
537
538
|
|
|
538
539
|
return drawCircle(parentGfx, element.width, element.height, attrs);
|
|
539
540
|
},
|
|
540
|
-
'bpmn:StartEvent': function(parentGfx, element) {
|
|
541
|
-
|
|
541
|
+
'bpmn:StartEvent': function(parentGfx, element, attrs) {
|
|
542
|
+
attrs = assign({
|
|
542
543
|
fill: getFillColor(element, defaultFillColor),
|
|
543
544
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
544
|
-
};
|
|
545
|
+
}, attrs);
|
|
545
546
|
|
|
546
547
|
var semantic = getSemantic(element);
|
|
547
548
|
|
|
@@ -560,7 +561,7 @@ export default function BpmnRenderer(
|
|
|
560
561
|
|
|
561
562
|
return circle;
|
|
562
563
|
},
|
|
563
|
-
'bpmn:MessageEventDefinition': function(parentGfx, element, isThrowing) {
|
|
564
|
+
'bpmn:MessageEventDefinition': function(parentGfx, element, attrs, isThrowing) {
|
|
564
565
|
var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
|
|
565
566
|
xScaleFactor: 0.9,
|
|
566
567
|
yScaleFactor: 0.9,
|
|
@@ -575,20 +576,24 @@ export default function BpmnRenderer(
|
|
|
575
576
|
var fill = isThrowing ? getStrokeColor(element, defaultStrokeColor) : getFillColor(element, defaultFillColor);
|
|
576
577
|
var stroke = isThrowing ? getFillColor(element, defaultFillColor) : getStrokeColor(element, defaultStrokeColor);
|
|
577
578
|
|
|
578
|
-
|
|
579
|
+
attrs = assign({
|
|
579
580
|
strokeWidth: 1,
|
|
580
581
|
fill: fill,
|
|
581
582
|
stroke: stroke
|
|
582
|
-
});
|
|
583
|
+
}, attrs);
|
|
584
|
+
|
|
585
|
+
var messagePath = drawPath(parentGfx, pathData, attrs);
|
|
583
586
|
|
|
584
587
|
return messagePath;
|
|
585
588
|
},
|
|
586
|
-
'bpmn:TimerEventDefinition': function(parentGfx, element) {
|
|
587
|
-
var
|
|
589
|
+
'bpmn:TimerEventDefinition': function(parentGfx, element, attrs) {
|
|
590
|
+
var outerAttrs = assign({
|
|
588
591
|
strokeWidth: 2,
|
|
589
592
|
fill: getFillColor(element, defaultFillColor),
|
|
590
593
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
591
|
-
});
|
|
594
|
+
}, attrs);
|
|
595
|
+
|
|
596
|
+
var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, outerAttrs);
|
|
592
597
|
|
|
593
598
|
var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
|
|
594
599
|
xScaleFactor: 0.75,
|
|
@@ -601,11 +606,13 @@ export default function BpmnRenderer(
|
|
|
601
606
|
}
|
|
602
607
|
});
|
|
603
608
|
|
|
604
|
-
|
|
609
|
+
var innerAttrs = assign({
|
|
605
610
|
strokeWidth: 2,
|
|
606
611
|
strokeLinecap: 'square',
|
|
607
612
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
608
|
-
});
|
|
613
|
+
}, attrs);
|
|
614
|
+
|
|
615
|
+
drawPath(parentGfx, pathData, innerAttrs);
|
|
609
616
|
|
|
610
617
|
for (var i = 0;i < 12; i++) {
|
|
611
618
|
|
|
@@ -623,17 +630,25 @@ export default function BpmnRenderer(
|
|
|
623
630
|
var width = element.width / 2;
|
|
624
631
|
var height = element.height / 2;
|
|
625
632
|
|
|
626
|
-
|
|
633
|
+
var lineAttrs = assign({
|
|
627
634
|
strokeWidth: 1,
|
|
628
635
|
strokeLinecap: 'square',
|
|
629
636
|
transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')',
|
|
630
637
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
631
|
-
});
|
|
638
|
+
}, attrs);
|
|
639
|
+
|
|
640
|
+
drawPath(parentGfx, linePathData, lineAttrs);
|
|
632
641
|
}
|
|
633
642
|
|
|
634
643
|
return circle;
|
|
635
644
|
},
|
|
636
|
-
'bpmn:EscalationEventDefinition': function(parentGfx, event, isThrowing) {
|
|
645
|
+
'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
646
|
+
attrs = assign({
|
|
647
|
+
strokeWidth: 1,
|
|
648
|
+
fill: fill,
|
|
649
|
+
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
650
|
+
}, attrs);
|
|
651
|
+
|
|
637
652
|
var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
|
|
638
653
|
xScaleFactor: 1,
|
|
639
654
|
yScaleFactor: 1,
|
|
@@ -647,13 +662,14 @@ export default function BpmnRenderer(
|
|
|
647
662
|
|
|
648
663
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
649
664
|
|
|
650
|
-
return drawPath(parentGfx, pathData,
|
|
665
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
666
|
+
},
|
|
667
|
+
'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs) {
|
|
668
|
+
attrs = assign({
|
|
651
669
|
strokeWidth: 1,
|
|
652
|
-
fill: fill,
|
|
653
670
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
654
|
-
});
|
|
655
|
-
|
|
656
|
-
'bpmn:ConditionalEventDefinition': function(parentGfx, event) {
|
|
671
|
+
}, attrs);
|
|
672
|
+
|
|
657
673
|
var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
|
|
658
674
|
xScaleFactor: 1,
|
|
659
675
|
yScaleFactor: 1,
|
|
@@ -665,12 +681,9 @@ export default function BpmnRenderer(
|
|
|
665
681
|
}
|
|
666
682
|
});
|
|
667
683
|
|
|
668
|
-
return drawPath(parentGfx, pathData,
|
|
669
|
-
strokeWidth: 1,
|
|
670
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
671
|
-
});
|
|
684
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
672
685
|
},
|
|
673
|
-
'bpmn:LinkEventDefinition': function(parentGfx, event, isThrowing) {
|
|
686
|
+
'bpmn:LinkEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
674
687
|
var pathData = pathMap.getScaledPath('EVENT_LINK', {
|
|
675
688
|
xScaleFactor: 1,
|
|
676
689
|
yScaleFactor: 1,
|
|
@@ -684,13 +697,15 @@ export default function BpmnRenderer(
|
|
|
684
697
|
|
|
685
698
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
686
699
|
|
|
687
|
-
|
|
700
|
+
attrs = assign({
|
|
688
701
|
strokeWidth: 1,
|
|
689
702
|
fill: fill,
|
|
690
703
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
691
|
-
});
|
|
704
|
+
}, attrs);
|
|
705
|
+
|
|
706
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
692
707
|
},
|
|
693
|
-
'bpmn:ErrorEventDefinition': function(parentGfx, event, isThrowing) {
|
|
708
|
+
'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
694
709
|
var pathData = pathMap.getScaledPath('EVENT_ERROR', {
|
|
695
710
|
xScaleFactor: 1.1,
|
|
696
711
|
yScaleFactor: 1.1,
|
|
@@ -704,13 +719,15 @@ export default function BpmnRenderer(
|
|
|
704
719
|
|
|
705
720
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
706
721
|
|
|
707
|
-
|
|
722
|
+
attrs = assign({
|
|
708
723
|
strokeWidth: 1,
|
|
709
724
|
fill: fill,
|
|
710
725
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
711
|
-
});
|
|
726
|
+
}, attrs);
|
|
727
|
+
|
|
728
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
712
729
|
},
|
|
713
|
-
'bpmn:CancelEventDefinition': function(parentGfx, event, isThrowing) {
|
|
730
|
+
'bpmn:CancelEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
714
731
|
var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
|
|
715
732
|
xScaleFactor: 1.0,
|
|
716
733
|
yScaleFactor: 1.0,
|
|
@@ -724,17 +741,19 @@ export default function BpmnRenderer(
|
|
|
724
741
|
|
|
725
742
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
726
743
|
|
|
727
|
-
|
|
744
|
+
attrs = assign({
|
|
728
745
|
strokeWidth: 1,
|
|
729
746
|
fill: fill,
|
|
730
747
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
731
|
-
});
|
|
748
|
+
}, attrs);
|
|
749
|
+
|
|
750
|
+
var path = drawPath(parentGfx, pathData, attrs);
|
|
732
751
|
|
|
733
752
|
rotate(path, 45);
|
|
734
753
|
|
|
735
754
|
return path;
|
|
736
755
|
},
|
|
737
|
-
'bpmn:CompensateEventDefinition': function(parentGfx, event, isThrowing) {
|
|
756
|
+
'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
738
757
|
var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
|
|
739
758
|
xScaleFactor: 1,
|
|
740
759
|
yScaleFactor: 1,
|
|
@@ -748,13 +767,15 @@ export default function BpmnRenderer(
|
|
|
748
767
|
|
|
749
768
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
750
769
|
|
|
751
|
-
|
|
770
|
+
attrs = assign({
|
|
752
771
|
strokeWidth: 1,
|
|
753
772
|
fill: fill,
|
|
754
773
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
755
|
-
});
|
|
774
|
+
}, attrs);
|
|
775
|
+
|
|
776
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
756
777
|
},
|
|
757
|
-
'bpmn:SignalEventDefinition': function(parentGfx, event, isThrowing) {
|
|
778
|
+
'bpmn:SignalEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
758
779
|
var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
|
|
759
780
|
xScaleFactor: 0.9,
|
|
760
781
|
yScaleFactor: 0.9,
|
|
@@ -768,13 +789,15 @@ export default function BpmnRenderer(
|
|
|
768
789
|
|
|
769
790
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
770
791
|
|
|
771
|
-
|
|
792
|
+
attrs = assign({
|
|
772
793
|
strokeWidth: 1,
|
|
773
794
|
fill: fill,
|
|
774
795
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
775
|
-
});
|
|
796
|
+
}, attrs);
|
|
797
|
+
|
|
798
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
776
799
|
},
|
|
777
|
-
'bpmn:MultipleEventDefinition': function(parentGfx, event, isThrowing) {
|
|
800
|
+
'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs, isThrowing) {
|
|
778
801
|
var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
|
|
779
802
|
xScaleFactor: 1.1,
|
|
780
803
|
yScaleFactor: 1.1,
|
|
@@ -788,12 +811,14 @@ export default function BpmnRenderer(
|
|
|
788
811
|
|
|
789
812
|
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
790
813
|
|
|
791
|
-
|
|
814
|
+
attrs = assign({
|
|
792
815
|
strokeWidth: 1,
|
|
793
816
|
fill: fill
|
|
794
|
-
});
|
|
817
|
+
}, attrs);
|
|
818
|
+
|
|
819
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
795
820
|
},
|
|
796
|
-
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event) {
|
|
821
|
+
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs) {
|
|
797
822
|
var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
|
|
798
823
|
xScaleFactor: 1.2,
|
|
799
824
|
yScaleFactor: 1.2,
|
|
@@ -805,47 +830,54 @@ export default function BpmnRenderer(
|
|
|
805
830
|
}
|
|
806
831
|
});
|
|
807
832
|
|
|
808
|
-
|
|
833
|
+
attrs = assign({
|
|
809
834
|
strokeWidth: 1,
|
|
810
835
|
fill: getStrokeColor(event, defaultStrokeColor),
|
|
811
836
|
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
812
|
-
});
|
|
837
|
+
}, attrs);
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
return drawPath(parentGfx, pathData, attrs);
|
|
813
841
|
},
|
|
814
|
-
'bpmn:EndEvent': function(parentGfx, element) {
|
|
815
|
-
var
|
|
842
|
+
'bpmn:EndEvent': function(parentGfx, element, attrs) {
|
|
843
|
+
var outerAttrs = assign({
|
|
816
844
|
strokeWidth: 4,
|
|
817
845
|
fill: getFillColor(element, defaultFillColor),
|
|
818
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
819
|
-
});
|
|
846
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
847
|
+
}, attrs);
|
|
820
848
|
|
|
821
|
-
|
|
849
|
+
var circle = renderer('bpmn:Event')(parentGfx, element, outerAttrs);
|
|
850
|
+
|
|
851
|
+
renderEventContent(element, parentGfx, attrs);
|
|
822
852
|
|
|
823
853
|
return circle;
|
|
824
854
|
},
|
|
825
|
-
'bpmn:TerminateEventDefinition': function(parentGfx, element) {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
});
|
|
855
|
+
'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs) {
|
|
856
|
+
attrs = assign({
|
|
857
|
+
fill: getFillColor(element, defaultFillColor),
|
|
858
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
859
|
+
strokeWidth: 4
|
|
860
|
+
}, attrs);
|
|
861
|
+
|
|
862
|
+
var circle = drawCircle(parentGfx, element.width, element.height, 8, attrs);
|
|
831
863
|
|
|
832
864
|
return circle;
|
|
833
865
|
},
|
|
834
|
-
'bpmn:IntermediateEvent': function(parentGfx, element) {
|
|
835
|
-
var
|
|
866
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, attrs) {
|
|
867
|
+
var outerAttrs = assign({
|
|
836
868
|
strokeWidth: 1,
|
|
837
869
|
fill: getFillColor(element, defaultFillColor),
|
|
838
870
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
839
|
-
});
|
|
871
|
+
}, attrs);
|
|
872
|
+
|
|
873
|
+
var outer = renderer('bpmn:Event')(parentGfx, element, outerAttrs);
|
|
840
874
|
|
|
841
875
|
/* inner */
|
|
842
|
-
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
843
|
-
strokeWidth: 1,
|
|
876
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, assign({}, outerAttrs, {
|
|
844
877
|
fill: getFillColor(element, 'none'),
|
|
845
|
-
|
|
846
|
-
});
|
|
878
|
+
}));
|
|
847
879
|
|
|
848
|
-
renderEventContent(element, parentGfx);
|
|
880
|
+
renderEventContent(element, parentGfx, attrs);
|
|
849
881
|
|
|
850
882
|
return outer;
|
|
851
883
|
},
|
|
@@ -863,21 +895,21 @@ export default function BpmnRenderer(
|
|
|
863
895
|
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, attrs);
|
|
864
896
|
},
|
|
865
897
|
|
|
866
|
-
'bpmn:Task': function(parentGfx, element) {
|
|
867
|
-
|
|
898
|
+
'bpmn:Task': function(parentGfx, element, attrs) {
|
|
899
|
+
attrs = assign({
|
|
868
900
|
fill: getFillColor(element, defaultFillColor),
|
|
869
901
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
870
|
-
};
|
|
902
|
+
}, attrs);
|
|
871
903
|
|
|
872
904
|
var rect = renderer('bpmn:Activity')(parentGfx, element, attrs);
|
|
873
905
|
|
|
874
906
|
renderEmbeddedLabel(parentGfx, element, 'center-middle');
|
|
875
|
-
attachTaskMarkers(parentGfx, element);
|
|
907
|
+
attachTaskMarkers(parentGfx, element, attrs);
|
|
876
908
|
|
|
877
909
|
return rect;
|
|
878
910
|
},
|
|
879
|
-
'bpmn:ServiceTask': function(parentGfx, element) {
|
|
880
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
911
|
+
'bpmn:ServiceTask': function(parentGfx, element, attrs) {
|
|
912
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
881
913
|
|
|
882
914
|
var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
883
915
|
abspos: {
|
|
@@ -886,11 +918,12 @@ export default function BpmnRenderer(
|
|
|
886
918
|
}
|
|
887
919
|
});
|
|
888
920
|
|
|
889
|
-
|
|
921
|
+
var serviceAttrs = assign({
|
|
890
922
|
strokeWidth: 1,
|
|
891
923
|
fill: getFillColor(element, defaultFillColor),
|
|
892
924
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
893
|
-
});
|
|
925
|
+
}, attrs);
|
|
926
|
+
/* service bg */ drawPath(parentGfx, pathDataBG, serviceAttrs);
|
|
894
927
|
|
|
895
928
|
var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
|
|
896
929
|
abspos: {
|
|
@@ -899,10 +932,11 @@ export default function BpmnRenderer(
|
|
|
899
932
|
}
|
|
900
933
|
});
|
|
901
934
|
|
|
902
|
-
|
|
935
|
+
var fillAttrs = assign({
|
|
903
936
|
strokeWidth: 0,
|
|
904
937
|
fill: getFillColor(element, defaultFillColor)
|
|
905
|
-
});
|
|
938
|
+
}, attrs);
|
|
939
|
+
/* service fill */ drawPath(parentGfx, fillPathData, fillAttrs);
|
|
906
940
|
|
|
907
941
|
var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
908
942
|
abspos: {
|
|
@@ -911,16 +945,12 @@ export default function BpmnRenderer(
|
|
|
911
945
|
}
|
|
912
946
|
});
|
|
913
947
|
|
|
914
|
-
/* service */ drawPath(parentGfx, pathData,
|
|
915
|
-
strokeWidth: 1,
|
|
916
|
-
fill: getFillColor(element, defaultFillColor),
|
|
917
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
918
|
-
});
|
|
948
|
+
/* service */ drawPath(parentGfx, pathData, serviceAttrs);
|
|
919
949
|
|
|
920
950
|
return task;
|
|
921
951
|
},
|
|
922
|
-
'bpmn:UserTask': function(parentGfx, element) {
|
|
923
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
952
|
+
'bpmn:UserTask': function(parentGfx, element, attrs) {
|
|
953
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
924
954
|
|
|
925
955
|
var x = 15;
|
|
926
956
|
var y = 12;
|
|
@@ -932,11 +962,12 @@ export default function BpmnRenderer(
|
|
|
932
962
|
}
|
|
933
963
|
});
|
|
934
964
|
|
|
935
|
-
|
|
965
|
+
var userAttrs = assign({
|
|
936
966
|
strokeWidth: 0.5,
|
|
937
967
|
fill: getFillColor(element, defaultFillColor),
|
|
938
968
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
939
|
-
});
|
|
969
|
+
}, attrs);
|
|
970
|
+
/* user path */ drawPath(parentGfx, pathData, userAttrs);
|
|
940
971
|
|
|
941
972
|
var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
|
|
942
973
|
abspos: {
|
|
@@ -945,11 +976,7 @@ export default function BpmnRenderer(
|
|
|
945
976
|
}
|
|
946
977
|
});
|
|
947
978
|
|
|
948
|
-
/* user2 path */ drawPath(parentGfx, pathData2,
|
|
949
|
-
strokeWidth: 0.5,
|
|
950
|
-
fill: getFillColor(element, defaultFillColor),
|
|
951
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
952
|
-
});
|
|
979
|
+
/* user2 path */ drawPath(parentGfx, pathData2, userAttrs);
|
|
953
980
|
|
|
954
981
|
var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
|
|
955
982
|
abspos: {
|
|
@@ -958,16 +985,12 @@ export default function BpmnRenderer(
|
|
|
958
985
|
}
|
|
959
986
|
});
|
|
960
987
|
|
|
961
|
-
/* user3 path */ drawPath(parentGfx, pathData3,
|
|
962
|
-
strokeWidth: 0.5,
|
|
963
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
964
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
965
|
-
});
|
|
988
|
+
/* user3 path */ drawPath(parentGfx, pathData3, userAttrs);
|
|
966
989
|
|
|
967
990
|
return task;
|
|
968
991
|
},
|
|
969
|
-
'bpmn:ManualTask': function(parentGfx, element) {
|
|
970
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
992
|
+
'bpmn:ManualTask': function(parentGfx, element, attrs) {
|
|
993
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
971
994
|
|
|
972
995
|
var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
|
|
973
996
|
abspos: {
|
|
@@ -976,16 +999,17 @@ export default function BpmnRenderer(
|
|
|
976
999
|
}
|
|
977
1000
|
});
|
|
978
1001
|
|
|
979
|
-
|
|
1002
|
+
var manualAttrs = assign({
|
|
980
1003
|
strokeWidth: 0.5, // 0.25,
|
|
981
1004
|
fill: getFillColor(element, defaultFillColor),
|
|
982
1005
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
983
|
-
});
|
|
1006
|
+
}, attrs);
|
|
1007
|
+
/* manual path */ drawPath(parentGfx, pathData, manualAttrs);
|
|
984
1008
|
|
|
985
1009
|
return task;
|
|
986
1010
|
},
|
|
987
|
-
'bpmn:SendTask': function(parentGfx, element) {
|
|
988
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
1011
|
+
'bpmn:SendTask': function(parentGfx, element, attrs) {
|
|
1012
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
989
1013
|
|
|
990
1014
|
var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
991
1015
|
xScaleFactor: 1,
|
|
@@ -998,22 +1022,25 @@ export default function BpmnRenderer(
|
|
|
998
1022
|
}
|
|
999
1023
|
});
|
|
1000
1024
|
|
|
1001
|
-
/* send path */
|
|
1025
|
+
/* send path */
|
|
1026
|
+
var pathAttrs = assign({
|
|
1002
1027
|
strokeWidth: 1,
|
|
1003
1028
|
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1004
1029
|
stroke: getFillColor(element, defaultFillColor)
|
|
1005
|
-
});
|
|
1030
|
+
}, attrs);
|
|
1031
|
+
|
|
1032
|
+
drawPath(parentGfx, pathData, pathAttrs);
|
|
1006
1033
|
|
|
1007
1034
|
return task;
|
|
1008
1035
|
},
|
|
1009
|
-
'bpmn:ReceiveTask' : function(parentGfx, element) {
|
|
1036
|
+
'bpmn:ReceiveTask' : function(parentGfx, element, attrs) {
|
|
1010
1037
|
var semantic = getSemantic(element);
|
|
1011
1038
|
|
|
1012
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
1039
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
1013
1040
|
var pathData;
|
|
1014
1041
|
|
|
1015
1042
|
if (semantic.instantiate) {
|
|
1016
|
-
drawCircle(parentGfx, 28, 28, 20 * 0.22, { strokeWidth: 1 });
|
|
1043
|
+
drawCircle(parentGfx, 28, 28, 20 * 0.22, assign({ strokeWidth: 1 }, attrs));
|
|
1017
1044
|
|
|
1018
1045
|
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
|
|
1019
1046
|
abspos: {
|
|
@@ -1035,16 +1062,18 @@ export default function BpmnRenderer(
|
|
|
1035
1062
|
});
|
|
1036
1063
|
}
|
|
1037
1064
|
|
|
1038
|
-
|
|
1065
|
+
var receiveAttrs = assign({
|
|
1039
1066
|
strokeWidth: 1,
|
|
1040
1067
|
fill: getFillColor(element, defaultFillColor),
|
|
1041
1068
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1042
|
-
});
|
|
1069
|
+
}, attrs);
|
|
1070
|
+
|
|
1071
|
+
/* receive path */ drawPath(parentGfx, pathData, receiveAttrs);
|
|
1043
1072
|
|
|
1044
1073
|
return task;
|
|
1045
1074
|
},
|
|
1046
|
-
'bpmn:ScriptTask': function(parentGfx, element) {
|
|
1047
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
1075
|
+
'bpmn:ScriptTask': function(parentGfx, element, attrs) {
|
|
1076
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
1048
1077
|
|
|
1049
1078
|
var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
|
|
1050
1079
|
abspos: {
|
|
@@ -1053,15 +1082,16 @@ export default function BpmnRenderer(
|
|
|
1053
1082
|
}
|
|
1054
1083
|
});
|
|
1055
1084
|
|
|
1056
|
-
|
|
1085
|
+
var scriptAttrs = assign({
|
|
1057
1086
|
strokeWidth: 1,
|
|
1058
1087
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1059
|
-
});
|
|
1088
|
+
}, attrs);
|
|
1089
|
+
/* script path */ drawPath(parentGfx, pathData, scriptAttrs);
|
|
1060
1090
|
|
|
1061
1091
|
return task;
|
|
1062
1092
|
},
|
|
1063
|
-
'bpmn:BusinessRuleTask': function(parentGfx, element) {
|
|
1064
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
1093
|
+
'bpmn:BusinessRuleTask': function(parentGfx, element, attrs) {
|
|
1094
|
+
var task = renderer('bpmn:Task')(parentGfx, element, attrs);
|
|
1065
1095
|
|
|
1066
1096
|
var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
|
|
1067
1097
|
abspos: {
|
|
@@ -1070,12 +1100,12 @@ export default function BpmnRenderer(
|
|
|
1070
1100
|
}
|
|
1071
1101
|
});
|
|
1072
1102
|
|
|
1073
|
-
var
|
|
1074
|
-
svgAttr(businessHeaderPath, {
|
|
1103
|
+
var headerAttrs = assign({
|
|
1075
1104
|
strokeWidth: 1,
|
|
1076
1105
|
fill: getFillColor(element, '#aaaaaa'),
|
|
1077
1106
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1078
|
-
});
|
|
1107
|
+
}, attrs);
|
|
1108
|
+
drawPath(parentGfx, headerPathData, headerAttrs);
|
|
1079
1109
|
|
|
1080
1110
|
var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
|
|
1081
1111
|
abspos: {
|
|
@@ -1084,11 +1114,11 @@ export default function BpmnRenderer(
|
|
|
1084
1114
|
}
|
|
1085
1115
|
});
|
|
1086
1116
|
|
|
1087
|
-
var
|
|
1088
|
-
svgAttr(businessPath, {
|
|
1117
|
+
var businessAttrs = assign({
|
|
1089
1118
|
strokeWidth: 1,
|
|
1090
1119
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1091
|
-
});
|
|
1120
|
+
}, attrs);
|
|
1121
|
+
drawPath(parentGfx, headerData, businessAttrs);
|
|
1092
1122
|
|
|
1093
1123
|
return task;
|
|
1094
1124
|
},
|
|
@@ -1111,41 +1141,42 @@ export default function BpmnRenderer(
|
|
|
1111
1141
|
renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle');
|
|
1112
1142
|
|
|
1113
1143
|
if (expanded) {
|
|
1114
|
-
attachTaskMarkers(parentGfx, element);
|
|
1144
|
+
attachTaskMarkers(parentGfx, element, attrs);
|
|
1115
1145
|
} else {
|
|
1116
|
-
attachTaskMarkers(parentGfx, element, ['SubProcessMarker']);
|
|
1146
|
+
attachTaskMarkers(parentGfx, element, attrs, ['SubProcessMarker']);
|
|
1117
1147
|
}
|
|
1118
1148
|
|
|
1119
1149
|
return rect;
|
|
1120
1150
|
},
|
|
1121
|
-
'bpmn:AdHocSubProcess': function(parentGfx, element) {
|
|
1122
|
-
return renderer('bpmn:SubProcess')(parentGfx, element);
|
|
1151
|
+
'bpmn:AdHocSubProcess': function(parentGfx, element, attrs) {
|
|
1152
|
+
return renderer('bpmn:SubProcess')(parentGfx, element, attrs);
|
|
1123
1153
|
},
|
|
1124
|
-
'bpmn:Transaction': function(parentGfx, element) {
|
|
1125
|
-
var outer = renderer('bpmn:SubProcess')(parentGfx, element);
|
|
1154
|
+
'bpmn:Transaction': function(parentGfx, element, attrs) {
|
|
1155
|
+
var outer = renderer('bpmn:SubProcess')(parentGfx, element, attrs);
|
|
1126
1156
|
|
|
1127
1157
|
var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
|
|
1128
1158
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1129
1159
|
});
|
|
1130
1160
|
|
|
1131
|
-
/* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
|
|
1161
|
+
/* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, assign(innerAttrs, attrs));
|
|
1132
1162
|
|
|
1133
1163
|
return outer;
|
|
1134
1164
|
},
|
|
1135
|
-
'bpmn:CallActivity': function(parentGfx, element) {
|
|
1136
|
-
|
|
1165
|
+
'bpmn:CallActivity': function(parentGfx, element, attrs) {
|
|
1166
|
+
attrs = assign({
|
|
1137
1167
|
strokeWidth: 5
|
|
1138
|
-
});
|
|
1139
|
-
},
|
|
1140
|
-
'bpmn:Participant': function(parentGfx, element) {
|
|
1168
|
+
}, attrs);
|
|
1141
1169
|
|
|
1142
|
-
|
|
1170
|
+
return renderer('bpmn:SubProcess')(parentGfx, element, attrs);
|
|
1171
|
+
},
|
|
1172
|
+
'bpmn:Participant': function(parentGfx, element, attrs) {
|
|
1173
|
+
var outerAttrs = assign({
|
|
1143
1174
|
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
1144
1175
|
fill: getFillColor(element, defaultFillColor),
|
|
1145
1176
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1146
|
-
};
|
|
1177
|
+
}, attrs);
|
|
1147
1178
|
|
|
1148
|
-
var lane = renderer('bpmn:Lane')(parentGfx, element,
|
|
1179
|
+
var lane = renderer('bpmn:Lane')(parentGfx, element, outerAttrs);
|
|
1149
1180
|
|
|
1150
1181
|
var expandedPool = isExpanded(element);
|
|
1151
1182
|
|
|
@@ -1153,9 +1184,9 @@ export default function BpmnRenderer(
|
|
|
1153
1184
|
drawLine(parentGfx, [
|
|
1154
1185
|
{ x: 30, y: 0 },
|
|
1155
1186
|
{ x: 30, y: element.height }
|
|
1156
|
-
], {
|
|
1187
|
+
], assign({
|
|
1157
1188
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1158
|
-
});
|
|
1189
|
+
}, attrs));
|
|
1159
1190
|
var text = getSemantic(element).name;
|
|
1160
1191
|
renderLaneLabel(parentGfx, text, element);
|
|
1161
1192
|
} else {
|
|
@@ -1173,7 +1204,7 @@ export default function BpmnRenderer(
|
|
|
1173
1204
|
var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
|
|
1174
1205
|
|
|
1175
1206
|
if (participantMultiplicity) {
|
|
1176
|
-
renderer('ParticipantMultiplicityMarker')(parentGfx, element);
|
|
1207
|
+
renderer('ParticipantMultiplicityMarker')(parentGfx, element, attrs);
|
|
1177
1208
|
}
|
|
1178
1209
|
|
|
1179
1210
|
return lane;
|
|
@@ -1194,20 +1225,23 @@ export default function BpmnRenderer(
|
|
|
1194
1225
|
|
|
1195
1226
|
return rect;
|
|
1196
1227
|
},
|
|
1197
|
-
'bpmn:InclusiveGateway': function(parentGfx, element) {
|
|
1198
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
1228
|
+
'bpmn:InclusiveGateway': function(parentGfx, element, attrs) {
|
|
1229
|
+
var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs);
|
|
1199
1230
|
|
|
1200
|
-
|
|
1201
|
-
|
|
1231
|
+
|
|
1232
|
+
var circleAttrs = assign({
|
|
1202
1233
|
strokeWidth: 2.5,
|
|
1203
1234
|
fill: getFillColor(element, defaultFillColor),
|
|
1204
1235
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1205
|
-
});
|
|
1236
|
+
}, attrs);
|
|
1237
|
+
|
|
1238
|
+
/* circle path */
|
|
1239
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.24, circleAttrs);
|
|
1206
1240
|
|
|
1207
1241
|
return diamond;
|
|
1208
1242
|
},
|
|
1209
|
-
'bpmn:ExclusiveGateway': function(parentGfx, element) {
|
|
1210
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
1243
|
+
'bpmn:ExclusiveGateway': function(parentGfx, element, attrs) {
|
|
1244
|
+
var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs);
|
|
1211
1245
|
|
|
1212
1246
|
var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
|
|
1213
1247
|
xScaleFactor: 0.4,
|
|
@@ -1221,17 +1255,17 @@ export default function BpmnRenderer(
|
|
|
1221
1255
|
});
|
|
1222
1256
|
|
|
1223
1257
|
if ((getDi(element).isMarkerVisible)) {
|
|
1224
|
-
drawPath(parentGfx, pathData, {
|
|
1258
|
+
drawPath(parentGfx, pathData, assign({
|
|
1225
1259
|
strokeWidth: 1,
|
|
1226
1260
|
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1227
1261
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1228
|
-
});
|
|
1262
|
+
}, attrs));
|
|
1229
1263
|
}
|
|
1230
1264
|
|
|
1231
1265
|
return diamond;
|
|
1232
1266
|
},
|
|
1233
|
-
'bpmn:ComplexGateway': function(parentGfx, element) {
|
|
1234
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
1267
|
+
'bpmn:ComplexGateway': function(parentGfx, element, attrs) {
|
|
1268
|
+
var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs);
|
|
1235
1269
|
|
|
1236
1270
|
var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
|
|
1237
1271
|
xScaleFactor: 0.5,
|
|
@@ -1244,16 +1278,17 @@ export default function BpmnRenderer(
|
|
|
1244
1278
|
}
|
|
1245
1279
|
});
|
|
1246
1280
|
|
|
1247
|
-
|
|
1281
|
+
var innerAttrs = assign({
|
|
1248
1282
|
strokeWidth: 1,
|
|
1249
1283
|
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1250
1284
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1251
|
-
});
|
|
1285
|
+
}, attrs);
|
|
1286
|
+
/* complex path */ drawPath(parentGfx, pathData, innerAttrs);
|
|
1252
1287
|
|
|
1253
1288
|
return diamond;
|
|
1254
1289
|
},
|
|
1255
|
-
'bpmn:ParallelGateway': function(parentGfx, element) {
|
|
1256
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
1290
|
+
'bpmn:ParallelGateway': function(parentGfx, element, attrs) {
|
|
1291
|
+
var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs);
|
|
1257
1292
|
|
|
1258
1293
|
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
1259
1294
|
xScaleFactor: 0.6,
|
|
@@ -1266,25 +1301,27 @@ export default function BpmnRenderer(
|
|
|
1266
1301
|
}
|
|
1267
1302
|
});
|
|
1268
1303
|
|
|
1269
|
-
|
|
1304
|
+
var innerAttrs = assign({
|
|
1270
1305
|
strokeWidth: 1,
|
|
1271
1306
|
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1272
1307
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1273
|
-
});
|
|
1308
|
+
}, attrs);
|
|
1309
|
+
/* parallel path */ drawPath(parentGfx, pathData, innerAttrs);
|
|
1274
1310
|
|
|
1275
1311
|
return diamond;
|
|
1276
1312
|
},
|
|
1277
|
-
'bpmn:EventBasedGateway': function(parentGfx, element) {
|
|
1313
|
+
'bpmn:EventBasedGateway': function(parentGfx, element, attrs) {
|
|
1278
1314
|
|
|
1279
1315
|
var semantic = getSemantic(element);
|
|
1280
1316
|
|
|
1281
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
1317
|
+
var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs);
|
|
1282
1318
|
|
|
1283
|
-
|
|
1319
|
+
var outerAttrs = assign({
|
|
1284
1320
|
strokeWidth: 1,
|
|
1285
1321
|
fill: 'none',
|
|
1286
1322
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1287
|
-
});
|
|
1323
|
+
}, attrs);
|
|
1324
|
+
/* outer circle path */ drawCircle(parentGfx, element.width, element.height, element.height * 0.20, outerAttrs);
|
|
1288
1325
|
|
|
1289
1326
|
var type = semantic.eventGatewayType;
|
|
1290
1327
|
var instantiate = !!semantic.instantiate;
|
|
@@ -1302,13 +1339,12 @@ export default function BpmnRenderer(
|
|
|
1302
1339
|
}
|
|
1303
1340
|
});
|
|
1304
1341
|
|
|
1305
|
-
var
|
|
1342
|
+
var innerAttrs = assign({
|
|
1306
1343
|
strokeWidth: 2,
|
|
1307
1344
|
fill: getFillColor(element, 'none'),
|
|
1308
1345
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1309
|
-
};
|
|
1310
|
-
|
|
1311
|
-
/* event path */ drawPath(parentGfx, pathData, attrs);
|
|
1346
|
+
}, attrs);
|
|
1347
|
+
/* event path */ drawPath(parentGfx, pathData, innerAttrs);
|
|
1312
1348
|
}
|
|
1313
1349
|
|
|
1314
1350
|
if (type === 'Parallel') {
|
|
@@ -1324,7 +1360,7 @@ export default function BpmnRenderer(
|
|
|
1324
1360
|
}
|
|
1325
1361
|
});
|
|
1326
1362
|
|
|
1327
|
-
var parallelPath = drawPath(parentGfx, pathData);
|
|
1363
|
+
var parallelPath = drawPath(parentGfx, pathData, attrs);
|
|
1328
1364
|
svgAttr(parallelPath, {
|
|
1329
1365
|
strokeWidth: 1,
|
|
1330
1366
|
fill: 'none'
|
|
@@ -1332,12 +1368,12 @@ export default function BpmnRenderer(
|
|
|
1332
1368
|
} else if (type === 'Exclusive') {
|
|
1333
1369
|
|
|
1334
1370
|
if (!instantiate) {
|
|
1335
|
-
var
|
|
1336
|
-
svgAttr(innerCircle, {
|
|
1371
|
+
var innerCircleAttrs = assign({
|
|
1337
1372
|
strokeWidth: 1,
|
|
1338
1373
|
fill: 'none',
|
|
1339
1374
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1340
|
-
});
|
|
1375
|
+
}, attrs);
|
|
1376
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.26, innerCircleAttrs);
|
|
1341
1377
|
}
|
|
1342
1378
|
|
|
1343
1379
|
drawEvent();
|
|
@@ -1346,26 +1382,28 @@ export default function BpmnRenderer(
|
|
|
1346
1382
|
|
|
1347
1383
|
return diamond;
|
|
1348
1384
|
},
|
|
1349
|
-
'bpmn:Gateway': function(parentGfx, element) {
|
|
1350
|
-
|
|
1385
|
+
'bpmn:Gateway': function(parentGfx, element, attrs) {
|
|
1386
|
+
attrs = assign({
|
|
1351
1387
|
fill: getFillColor(element, defaultFillColor),
|
|
1352
1388
|
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
1353
1389
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1354
|
-
};
|
|
1390
|
+
}, attrs);
|
|
1355
1391
|
|
|
1356
1392
|
return drawDiamond(parentGfx, element.width, element.height, attrs);
|
|
1357
1393
|
},
|
|
1358
|
-
'bpmn:SequenceFlow': function(parentGfx, element) {
|
|
1394
|
+
'bpmn:SequenceFlow': function(parentGfx, element, attrs) {
|
|
1395
|
+
attrs = attrs || {};
|
|
1396
|
+
|
|
1359
1397
|
var pathData = createPathFromConnection(element);
|
|
1360
1398
|
|
|
1361
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
1362
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
1399
|
+
var fill = attrs.fill || getFillColor(element, defaultFillColor),
|
|
1400
|
+
stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor);
|
|
1363
1401
|
|
|
1364
|
-
|
|
1402
|
+
attrs = assign({
|
|
1365
1403
|
strokeLinejoin: 'round',
|
|
1366
1404
|
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
1367
1405
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1368
|
-
};
|
|
1406
|
+
}, attrs || {});
|
|
1369
1407
|
|
|
1370
1408
|
var path = drawPath(parentGfx, pathData, attrs);
|
|
1371
1409
|
|
|
@@ -1419,41 +1457,56 @@ export default function BpmnRenderer(
|
|
|
1419
1457
|
|
|
1420
1458
|
return drawLine(parentGfx, element.waypoints, attrs);
|
|
1421
1459
|
},
|
|
1422
|
-
'bpmn:DataInputAssociation': function(parentGfx, element) {
|
|
1423
|
-
|
|
1424
|
-
|
|
1460
|
+
'bpmn:DataInputAssociation': function(parentGfx, element, attrs) {
|
|
1461
|
+
attrs = attrs || {};
|
|
1462
|
+
|
|
1463
|
+
var fill = attrs.fill || getFillColor(element, defaultFillColor),
|
|
1464
|
+
stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor);
|
|
1425
1465
|
|
|
1426
|
-
|
|
1466
|
+
attrs = assign({
|
|
1467
|
+
fill: fill,
|
|
1468
|
+
stroke: stroke,
|
|
1427
1469
|
markerEnd: marker('association-end', fill, stroke)
|
|
1428
|
-
});
|
|
1470
|
+
}, attrs);
|
|
1471
|
+
|
|
1472
|
+
return renderer('bpmn:Association')(parentGfx, element, attrs);
|
|
1429
1473
|
},
|
|
1430
|
-
'bpmn:DataOutputAssociation': function(parentGfx, element) {
|
|
1431
|
-
|
|
1432
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
1474
|
+
'bpmn:DataOutputAssociation': function(parentGfx, element, attrs) {
|
|
1475
|
+
attrs = attrs || {};
|
|
1433
1476
|
|
|
1434
|
-
|
|
1477
|
+
var fill = attrs.fill || getFillColor(element, defaultFillColor),
|
|
1478
|
+
stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor);
|
|
1479
|
+
|
|
1480
|
+
|
|
1481
|
+
attrs = assign({
|
|
1482
|
+
fill: fill,
|
|
1483
|
+
stroke: stroke,
|
|
1435
1484
|
markerEnd: marker('association-end', fill, stroke)
|
|
1436
|
-
});
|
|
1485
|
+
}, attrs);
|
|
1486
|
+
|
|
1487
|
+
return renderer('bpmn:Association')(parentGfx, element, attrs);
|
|
1437
1488
|
},
|
|
1438
|
-
'bpmn:MessageFlow': function(parentGfx, element) {
|
|
1489
|
+
'bpmn:MessageFlow': function(parentGfx, element, attrs) {
|
|
1490
|
+
attrs = attrs || {};
|
|
1439
1491
|
|
|
1440
1492
|
var semantic = getSemantic(element),
|
|
1441
1493
|
di = getDi(element);
|
|
1442
1494
|
|
|
1443
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
1444
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
1495
|
+
var fill = attrs.fill || getFillColor(element, defaultFillColor),
|
|
1496
|
+
stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor);
|
|
1445
1497
|
|
|
1446
1498
|
var pathData = createPathFromConnection(element);
|
|
1447
1499
|
|
|
1448
|
-
|
|
1500
|
+
|
|
1501
|
+
attrs = assign({
|
|
1449
1502
|
markerEnd: marker('messageflow-end', fill, stroke),
|
|
1450
1503
|
markerStart: marker('messageflow-start', fill, stroke),
|
|
1451
1504
|
strokeDasharray: '10, 12',
|
|
1452
1505
|
strokeLinecap: 'round',
|
|
1453
1506
|
strokeLinejoin: 'round',
|
|
1454
1507
|
strokeWidth: '1.5px',
|
|
1455
|
-
stroke:
|
|
1456
|
-
};
|
|
1508
|
+
stroke: stroke
|
|
1509
|
+
}, attrs);
|
|
1457
1510
|
|
|
1458
1511
|
var path = drawPath(parentGfx, pathData, attrs);
|
|
1459
1512
|
|
|
@@ -1500,7 +1553,7 @@ export default function BpmnRenderer(
|
|
|
1500
1553
|
|
|
1501
1554
|
return path;
|
|
1502
1555
|
},
|
|
1503
|
-
'bpmn:DataObject': function(parentGfx, element) {
|
|
1556
|
+
'bpmn:DataObject': function(parentGfx, element, attrs) {
|
|
1504
1557
|
var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
|
|
1505
1558
|
xScaleFactor: 1,
|
|
1506
1559
|
yScaleFactor: 1,
|
|
@@ -1512,46 +1565,56 @@ export default function BpmnRenderer(
|
|
|
1512
1565
|
}
|
|
1513
1566
|
});
|
|
1514
1567
|
|
|
1515
|
-
var
|
|
1568
|
+
var outerAttrs = assign({
|
|
1516
1569
|
fill: getFillColor(element, defaultFillColor),
|
|
1517
1570
|
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
1518
1571
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1519
|
-
});
|
|
1572
|
+
}, attrs);
|
|
1573
|
+
var elementObject = drawPath(parentGfx, pathData, outerAttrs);
|
|
1520
1574
|
|
|
1521
1575
|
var semantic = getSemantic(element);
|
|
1522
1576
|
|
|
1523
1577
|
if (isCollection(semantic)) {
|
|
1524
|
-
renderDataItemCollection(parentGfx, element);
|
|
1578
|
+
renderDataItemCollection(parentGfx, element, attrs);
|
|
1525
1579
|
}
|
|
1526
1580
|
|
|
1527
1581
|
return elementObject;
|
|
1528
1582
|
},
|
|
1529
1583
|
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
1530
|
-
'bpmn:DataInput': function(parentGfx, element) {
|
|
1584
|
+
'bpmn:DataInput': function(parentGfx, element, attrs) {
|
|
1531
1585
|
|
|
1532
1586
|
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
1533
1587
|
|
|
1534
1588
|
// page
|
|
1535
|
-
var elementObject = renderer('bpmn:DataObject')(parentGfx, element);
|
|
1589
|
+
var elementObject = renderer('bpmn:DataObject')(parentGfx, element, attrs);
|
|
1536
1590
|
|
|
1537
|
-
|
|
1591
|
+
var innerAttrs = assign({ strokeWidth: 1 }, attrs);
|
|
1592
|
+
/* input arrow path */ drawPath(parentGfx, arrowPathData, innerAttrs);
|
|
1538
1593
|
|
|
1539
1594
|
return elementObject;
|
|
1540
1595
|
},
|
|
1541
|
-
'bpmn:DataOutput': function(parentGfx, element) {
|
|
1596
|
+
'bpmn:DataOutput': function(parentGfx, element, attrs) {
|
|
1542
1597
|
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
1543
1598
|
|
|
1544
1599
|
// page
|
|
1545
|
-
var elementObject = renderer('bpmn:DataObject')(parentGfx, element);
|
|
1600
|
+
var elementObject = renderer('bpmn:DataObject')(parentGfx, element, attrs);
|
|
1546
1601
|
|
|
1547
|
-
|
|
1602
|
+
var arrowAttrs = assign({
|
|
1548
1603
|
strokeWidth: 1,
|
|
1549
1604
|
fill: 'black'
|
|
1550
|
-
});
|
|
1605
|
+
}, attrs);
|
|
1606
|
+
/* output arrow path */ drawPath(parentGfx, arrowPathData, arrowAttrs);
|
|
1551
1607
|
|
|
1552
1608
|
return elementObject;
|
|
1553
1609
|
},
|
|
1554
|
-
'bpmn:DataStoreReference': function(parentGfx, element) {
|
|
1610
|
+
'bpmn:DataStoreReference': function(parentGfx, element, attrs) {
|
|
1611
|
+
attrs = assign({
|
|
1612
|
+
strokeWidth: 2,
|
|
1613
|
+
fill: getFillColor(element, defaultFillColor),
|
|
1614
|
+
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
1615
|
+
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1616
|
+
}, attrs);
|
|
1617
|
+
|
|
1555
1618
|
var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
|
|
1556
1619
|
xScaleFactor: 1,
|
|
1557
1620
|
yScaleFactor: 1,
|
|
@@ -1563,25 +1626,20 @@ export default function BpmnRenderer(
|
|
|
1563
1626
|
}
|
|
1564
1627
|
});
|
|
1565
1628
|
|
|
1566
|
-
var elementStore = drawPath(parentGfx, DATA_STORE_PATH,
|
|
1567
|
-
strokeWidth: 2,
|
|
1568
|
-
fill: getFillColor(element, defaultFillColor),
|
|
1569
|
-
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
1570
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1571
|
-
});
|
|
1629
|
+
var elementStore = drawPath(parentGfx, DATA_STORE_PATH, attrs);
|
|
1572
1630
|
|
|
1573
1631
|
return elementStore;
|
|
1574
1632
|
},
|
|
1575
|
-
'bpmn:BoundaryEvent': function(parentGfx, element) {
|
|
1633
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, attrs) {
|
|
1576
1634
|
|
|
1577
1635
|
var semantic = getSemantic(element),
|
|
1578
1636
|
cancel = semantic.cancelActivity;
|
|
1579
1637
|
|
|
1580
|
-
|
|
1638
|
+
attrs = assign({
|
|
1581
1639
|
strokeWidth: 1,
|
|
1582
1640
|
fill: getFillColor(element, defaultFillColor),
|
|
1583
1641
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1584
|
-
};
|
|
1642
|
+
}, attrs);
|
|
1585
1643
|
|
|
1586
1644
|
if (!cancel) {
|
|
1587
1645
|
attrs.strokeDasharray = '6';
|
|
@@ -1602,30 +1660,32 @@ export default function BpmnRenderer(
|
|
|
1602
1660
|
|
|
1603
1661
|
/* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs);
|
|
1604
1662
|
|
|
1605
|
-
renderEventContent(element, parentGfx);
|
|
1663
|
+
renderEventContent(element, parentGfx, attrs);
|
|
1606
1664
|
|
|
1607
1665
|
return outer;
|
|
1608
1666
|
},
|
|
1609
|
-
'bpmn:Group': function(parentGfx, element) {
|
|
1667
|
+
'bpmn:Group': function(parentGfx, element, attrs) {
|
|
1610
1668
|
|
|
1611
|
-
|
|
1669
|
+
attrs = assign({
|
|
1612
1670
|
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
1613
1671
|
strokeWidth: 1,
|
|
1614
1672
|
strokeDasharray: '8,3,1,3',
|
|
1615
1673
|
fill: 'none',
|
|
1616
1674
|
pointerEvents: 'none'
|
|
1617
|
-
});
|
|
1675
|
+
}, attrs);
|
|
1676
|
+
|
|
1677
|
+
var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, attrs);
|
|
1618
1678
|
|
|
1619
1679
|
return group;
|
|
1620
1680
|
},
|
|
1621
1681
|
'label': function(parentGfx, element) {
|
|
1622
1682
|
return renderExternalLabel(parentGfx, element);
|
|
1623
1683
|
},
|
|
1624
|
-
'bpmn:TextAnnotation': function(parentGfx, element) {
|
|
1625
|
-
var style = {
|
|
1684
|
+
'bpmn:TextAnnotation': function(parentGfx, element, attrs) {
|
|
1685
|
+
var style = assign({}, attrs, {
|
|
1626
1686
|
'fill': 'none',
|
|
1627
1687
|
'stroke': 'none'
|
|
1628
|
-
};
|
|
1688
|
+
});
|
|
1629
1689
|
|
|
1630
1690
|
var textElement = drawRect(parentGfx, element.width, element.height, 0, 0, style);
|
|
1631
1691
|
|
|
@@ -1640,9 +1700,10 @@ export default function BpmnRenderer(
|
|
|
1640
1700
|
}
|
|
1641
1701
|
});
|
|
1642
1702
|
|
|
1643
|
-
|
|
1703
|
+
var pathAttrs = assign({
|
|
1644
1704
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1645
|
-
});
|
|
1705
|
+
}, attrs);
|
|
1706
|
+
drawPath(parentGfx, textPathData, pathAttrs);
|
|
1646
1707
|
|
|
1647
1708
|
var text = getSemantic(element).text || '';
|
|
1648
1709
|
renderLabel(parentGfx, text, {
|
|
@@ -1656,7 +1717,13 @@ export default function BpmnRenderer(
|
|
|
1656
1717
|
|
|
1657
1718
|
return textElement;
|
|
1658
1719
|
},
|
|
1659
|
-
'ParticipantMultiplicityMarker': function(parentGfx, element) {
|
|
1720
|
+
'ParticipantMultiplicityMarker': function(parentGfx, element, attrs) {
|
|
1721
|
+
attrs = assign({
|
|
1722
|
+
strokeWidth: 2,
|
|
1723
|
+
fill: getFillColor(element, defaultFillColor),
|
|
1724
|
+
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1725
|
+
}, attrs);
|
|
1726
|
+
|
|
1660
1727
|
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
1661
1728
|
xScaleFactor: 1,
|
|
1662
1729
|
yScaleFactor: 1,
|
|
@@ -1668,18 +1735,15 @@ export default function BpmnRenderer(
|
|
|
1668
1735
|
}
|
|
1669
1736
|
});
|
|
1670
1737
|
|
|
1671
|
-
drawMarker('participant-multiplicity', parentGfx, markerPath,
|
|
1672
|
-
strokeWidth: 2,
|
|
1673
|
-
fill: getFillColor(element, defaultFillColor),
|
|
1674
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1675
|
-
});
|
|
1738
|
+
drawMarker('participant-multiplicity', parentGfx, markerPath, attrs);
|
|
1676
1739
|
},
|
|
1677
|
-
'SubProcessMarker': function(parentGfx, element) {
|
|
1678
|
-
|
|
1679
|
-
strokeWidth: 1,
|
|
1740
|
+
'SubProcessMarker': function(parentGfx, element, attrs) {
|
|
1741
|
+
attrs = assign({
|
|
1680
1742
|
fill: getFillColor(element, defaultFillColor),
|
|
1681
1743
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1682
|
-
});
|
|
1744
|
+
}, attrs);
|
|
1745
|
+
|
|
1746
|
+
var markerRect = drawRect(parentGfx, 14, 14, 0, assign({ strokeWidth: 1 }, attrs));
|
|
1683
1747
|
|
|
1684
1748
|
// Process marker is placed in the middle of the box
|
|
1685
1749
|
// therefore fixed values can be used here
|
|
@@ -1696,12 +1760,14 @@ export default function BpmnRenderer(
|
|
|
1696
1760
|
}
|
|
1697
1761
|
});
|
|
1698
1762
|
|
|
1699
|
-
drawMarker('sub-process', parentGfx, markerPath,
|
|
1763
|
+
drawMarker('sub-process', parentGfx, markerPath, attrs);
|
|
1764
|
+
},
|
|
1765
|
+
'ParallelMarker': function(parentGfx, element, attrs, position) {
|
|
1766
|
+
attrs = assign({
|
|
1700
1767
|
fill: getFillColor(element, defaultFillColor),
|
|
1701
1768
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1702
|
-
});
|
|
1703
|
-
|
|
1704
|
-
'ParallelMarker': function(parentGfx, element, position) {
|
|
1769
|
+
}, attrs);
|
|
1770
|
+
|
|
1705
1771
|
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
1706
1772
|
xScaleFactor: 1,
|
|
1707
1773
|
yScaleFactor: 1,
|
|
@@ -1713,12 +1779,13 @@ export default function BpmnRenderer(
|
|
|
1713
1779
|
}
|
|
1714
1780
|
});
|
|
1715
1781
|
|
|
1716
|
-
drawMarker('parallel', parentGfx, markerPath,
|
|
1782
|
+
drawMarker('parallel', parentGfx, markerPath, attrs);
|
|
1783
|
+
},
|
|
1784
|
+
'SequentialMarker': function(parentGfx, element, attrs, position) {
|
|
1785
|
+
attrs = assign({
|
|
1717
1786
|
fill: getFillColor(element, defaultFillColor),
|
|
1718
1787
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1719
|
-
});
|
|
1720
|
-
},
|
|
1721
|
-
'SequentialMarker': function(parentGfx, element, position) {
|
|
1788
|
+
}, attrs);
|
|
1722
1789
|
var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
|
|
1723
1790
|
xScaleFactor: 1,
|
|
1724
1791
|
yScaleFactor: 1,
|
|
@@ -1730,12 +1797,15 @@ export default function BpmnRenderer(
|
|
|
1730
1797
|
}
|
|
1731
1798
|
});
|
|
1732
1799
|
|
|
1733
|
-
drawMarker('sequential', parentGfx, markerPath,
|
|
1800
|
+
drawMarker('sequential', parentGfx, markerPath, attrs);
|
|
1801
|
+
},
|
|
1802
|
+
'CompensationMarker': function(parentGfx, element, attrs, position) {
|
|
1803
|
+
attrs = assign({
|
|
1804
|
+
strokeWidth: 1,
|
|
1734
1805
|
fill: getFillColor(element, defaultFillColor),
|
|
1735
1806
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1736
|
-
});
|
|
1737
|
-
|
|
1738
|
-
'CompensationMarker': function(parentGfx, element, position) {
|
|
1807
|
+
}, attrs);
|
|
1808
|
+
|
|
1739
1809
|
var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', {
|
|
1740
1810
|
xScaleFactor: 1,
|
|
1741
1811
|
yScaleFactor: 1,
|
|
@@ -1747,13 +1817,17 @@ export default function BpmnRenderer(
|
|
|
1747
1817
|
}
|
|
1748
1818
|
});
|
|
1749
1819
|
|
|
1750
|
-
drawMarker('compensation', parentGfx, markerMath,
|
|
1820
|
+
drawMarker('compensation', parentGfx, markerMath, attrs);
|
|
1821
|
+
},
|
|
1822
|
+
'LoopMarker': function(parentGfx, element, attrs, position) {
|
|
1823
|
+
attrs = assign({
|
|
1751
1824
|
strokeWidth: 1,
|
|
1752
1825
|
fill: getFillColor(element, defaultFillColor),
|
|
1753
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1826
|
+
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
1827
|
+
strokeLinecap: 'round',
|
|
1828
|
+
strokeMiterlimit: 0.5
|
|
1829
|
+
}, attrs);
|
|
1830
|
+
|
|
1757
1831
|
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
1758
1832
|
xScaleFactor: 1,
|
|
1759
1833
|
yScaleFactor: 1,
|
|
@@ -1765,15 +1839,15 @@ export default function BpmnRenderer(
|
|
|
1765
1839
|
}
|
|
1766
1840
|
});
|
|
1767
1841
|
|
|
1768
|
-
drawMarker('loop', parentGfx, markerPath,
|
|
1769
|
-
strokeWidth: 1,
|
|
1770
|
-
fill: getFillColor(element, defaultFillColor),
|
|
1771
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
1772
|
-
strokeLinecap: 'round',
|
|
1773
|
-
strokeMiterlimit: 0.5
|
|
1774
|
-
});
|
|
1842
|
+
drawMarker('loop', parentGfx, markerPath, attrs);
|
|
1775
1843
|
},
|
|
1776
|
-
'AdhocMarker': function(parentGfx, element, position) {
|
|
1844
|
+
'AdhocMarker': function(parentGfx, element, attrs, position) {
|
|
1845
|
+
attrs = assign({
|
|
1846
|
+
strokeWidth: 1,
|
|
1847
|
+
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1848
|
+
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1849
|
+
}, attrs);
|
|
1850
|
+
|
|
1777
1851
|
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
1778
1852
|
xScaleFactor: 1,
|
|
1779
1853
|
yScaleFactor: 1,
|
|
@@ -1785,15 +1859,11 @@ export default function BpmnRenderer(
|
|
|
1785
1859
|
}
|
|
1786
1860
|
});
|
|
1787
1861
|
|
|
1788
|
-
drawMarker('adhoc', parentGfx, markerPath,
|
|
1789
|
-
strokeWidth: 1,
|
|
1790
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
1791
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
1792
|
-
});
|
|
1862
|
+
drawMarker('adhoc', parentGfx, markerPath, attrs);
|
|
1793
1863
|
}
|
|
1794
1864
|
};
|
|
1795
1865
|
|
|
1796
|
-
function attachTaskMarkers(parentGfx, element, taskMarkers) {
|
|
1866
|
+
function attachTaskMarkers(parentGfx, element, attrs, taskMarkers) {
|
|
1797
1867
|
var obj = getSemantic(element);
|
|
1798
1868
|
|
|
1799
1869
|
var subprocess = taskMarkers && taskMarkers.indexOf('SubProcessMarker') !== -1;
|
|
@@ -1818,15 +1888,15 @@ export default function BpmnRenderer(
|
|
|
1818
1888
|
}
|
|
1819
1889
|
|
|
1820
1890
|
forEach(taskMarkers, function(marker) {
|
|
1821
|
-
renderer(marker)(parentGfx, element, position);
|
|
1891
|
+
renderer(marker)(parentGfx, element, attrs, position);
|
|
1822
1892
|
});
|
|
1823
1893
|
|
|
1824
1894
|
if (obj.isForCompensation) {
|
|
1825
|
-
renderer('CompensationMarker')(parentGfx, element, position);
|
|
1895
|
+
renderer('CompensationMarker')(parentGfx, element, attrs, position);
|
|
1826
1896
|
}
|
|
1827
1897
|
|
|
1828
1898
|
if (obj.$type === 'bpmn:AdHocSubProcess') {
|
|
1829
|
-
renderer('AdhocMarker')(parentGfx, element, position);
|
|
1899
|
+
renderer('AdhocMarker')(parentGfx, element, attrs, position);
|
|
1830
1900
|
}
|
|
1831
1901
|
|
|
1832
1902
|
var loopCharacteristics = obj.loopCharacteristics,
|
|
@@ -1835,20 +1905,23 @@ export default function BpmnRenderer(
|
|
|
1835
1905
|
if (loopCharacteristics) {
|
|
1836
1906
|
|
|
1837
1907
|
if (isSequential === undefined) {
|
|
1838
|
-
renderer('LoopMarker')(parentGfx, element, position);
|
|
1908
|
+
renderer('LoopMarker')(parentGfx, element, attrs, position);
|
|
1839
1909
|
}
|
|
1840
1910
|
|
|
1841
1911
|
if (isSequential === false) {
|
|
1842
|
-
renderer('ParallelMarker')(parentGfx, element, position);
|
|
1912
|
+
renderer('ParallelMarker')(parentGfx, element, attrs, position);
|
|
1843
1913
|
}
|
|
1844
1914
|
|
|
1845
1915
|
if (isSequential === true) {
|
|
1846
|
-
renderer('SequentialMarker')(parentGfx, element, position);
|
|
1916
|
+
renderer('SequentialMarker')(parentGfx, element, attrs, position);
|
|
1847
1917
|
}
|
|
1848
1918
|
}
|
|
1849
1919
|
}
|
|
1850
1920
|
|
|
1851
|
-
function renderDataItemCollection(parentGfx, element) {
|
|
1921
|
+
function renderDataItemCollection(parentGfx, element, attrs) {
|
|
1922
|
+
attrs = assign({
|
|
1923
|
+
strokeWidth: 2
|
|
1924
|
+
}, attrs);
|
|
1852
1925
|
|
|
1853
1926
|
var yPosition = (element.height - 18) / element.height;
|
|
1854
1927
|
|
|
@@ -1863,9 +1936,7 @@ export default function BpmnRenderer(
|
|
|
1863
1936
|
}
|
|
1864
1937
|
});
|
|
1865
1938
|
|
|
1866
|
-
/* collection path */ drawPath(parentGfx, pathData,
|
|
1867
|
-
strokeWidth: 2
|
|
1868
|
-
});
|
|
1939
|
+
/* collection path */ drawPath(parentGfx, pathData, attrs);
|
|
1869
1940
|
}
|
|
1870
1941
|
|
|
1871
1942
|
|
|
@@ -1891,20 +1962,20 @@ BpmnRenderer.prototype.canRender = function(element) {
|
|
|
1891
1962
|
return is(element, 'bpmn:BaseElement');
|
|
1892
1963
|
};
|
|
1893
1964
|
|
|
1894
|
-
BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
1965
|
+
BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs) {
|
|
1895
1966
|
var type = element.type;
|
|
1896
1967
|
var h = this.handlers[type];
|
|
1897
1968
|
|
|
1898
1969
|
/* jshint -W040 */
|
|
1899
|
-
return h(parentGfx, element);
|
|
1970
|
+
return h(parentGfx, element, attrs);
|
|
1900
1971
|
};
|
|
1901
1972
|
|
|
1902
|
-
BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
1973
|
+
BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs) {
|
|
1903
1974
|
var type = element.type;
|
|
1904
1975
|
var h = this.handlers[type];
|
|
1905
1976
|
|
|
1906
1977
|
/* jshint -W040 */
|
|
1907
|
-
return h(parentGfx, element);
|
|
1978
|
+
return h(parentGfx, element, attrs);
|
|
1908
1979
|
};
|
|
1909
1980
|
|
|
1910
1981
|
BpmnRenderer.prototype.getShapePath = function(element) {
|