Skip to content

Commit

Permalink
Add source and target on style
Browse files Browse the repository at this point in the history
  • Loading branch information
csouchet committed Oct 4, 2023
1 parent a8383da commit 763f44e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/component/mxgraph/renderer/StyleComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<string, string | number>): void {
Expand Down
4 changes: 4 additions & 0 deletions src/component/mxgraph/style/identifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 763f44e

Please sign in to comment.