From 763f44e46cb98babe481fd812cc85e54bb8953ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Wed, 4 Oct 2023 15:59:50 +0200 Subject: [PATCH] Add source and target on style --- src/component/mxgraph/renderer/StyleComputer.ts | 8 ++++++++ src/component/mxgraph/style/identifiers.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/component/mxgraph/renderer/StyleComputer.ts b/src/component/mxgraph/renderer/StyleComputer.ts index fb96dc3c78..38962f8129 100644 --- a/src/component/mxgraph/renderer/StyleComputer.ts +++ b/src/component/mxgraph/renderer/StyleComputer.ts @@ -23,9 +23,11 @@ import { MessageVisibleKind, ShapeBpmnCallActivityKind, ShapeBpmnElementKind, Sh import { AssociationFlow, SequenceFlow } from '../../../model/bpmn/internal/edge/flows'; import Shape from '../../../model/bpmn/internal/shape/Shape'; import { + ShapeBpmnIntermediateThrowEvent, ShapeBpmnActivity, ShapeBpmnBoundaryEvent, ShapeBpmnCallActivity, + ShapeBpmnIntermediateCatchEvent, ShapeBpmnEvent, ShapeBpmnEventBasedGateway, ShapeBpmnStartEvent, @@ -101,6 +103,12 @@ export default class StyleComputer { if (bpmnElement instanceof ShapeBpmnBoundaryEvent || (bpmnElement instanceof ShapeBpmnStartEvent && bpmnElement.isInterrupting !== undefined)) { styleValues.set(BpmnStyleIdentifier.IS_INTERRUPTING, String(bpmnElement.isInterrupting)); } + + if (bpmnElement instanceof ShapeBpmnIntermediateCatchEvent) { + styleValues.set(BpmnStyleIdentifier.LINK_EVENT_SOURCE_IDS, String(bpmnElement.sourceIds)); + } else if (bpmnElement instanceof ShapeBpmnIntermediateThrowEvent) { + styleValues.set(BpmnStyleIdentifier.LINK_EVENT_TARGET_ID, bpmnElement.targetId); + } } private static computeActivityShapeStyle(bpmnElement: ShapeBpmnActivity, styleValues: Map): void { diff --git a/src/component/mxgraph/style/identifiers.ts b/src/component/mxgraph/style/identifiers.ts index 64dd8bbe9c..54b81db562 100644 --- a/src/component/mxgraph/style/identifiers.ts +++ b/src/component/mxgraph/style/identifiers.ts @@ -39,6 +39,10 @@ export const BpmnStyleIdentifier = { IS_INSTANTIATING: 'bpmn.isInstantiating', IS_INTERRUPTING: 'bpmn.isInterrupting', + // link event + LINK_EVENT_SOURCE_IDS: 'bpmn.linkEventSourceIds', + LINK_EVENT_TARGET_ID: 'bpmn.linkEventTargetId', + // other identifiers EXTRA_CSS_CLASSES: 'bpmn.extra.css.classes', MARKERS: 'bpmn.markers',