Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpmn-js

Package Overview
Dependencies
Maintainers
9
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-js - npm Package Compare versions

Comparing version 16.3.0 to 16.3.1

5

lib/features/modeling/behavior/CompensateBoundaryEventBehavior.d.ts

@@ -0,1 +1,6 @@

/**
* Behavior ensuring that only a single compensation activity is connected to a
* compensation boundary event when connecting, reconnecting or replacing shapes.
*
*/
export default class CompensateBoundaryEventBehavior extends CommandInterceptor {

@@ -2,0 +7,0 @@ /**

32

lib/features/modeling/behavior/CompensateBoundaryEventBehavior.js

@@ -14,4 +14,5 @@ import inherits from 'inherits-browser';

/**
* Behavior ensuring that only a single compensation activity is connected to a
* compensation boundary event when connecting, reconnecting or replacing shapes.
*
*
* @param {import('diagram-js/lib/core/EventBus').default} eventBus

@@ -33,3 +34,3 @@ * @param {import('../Modeling').default} modeling

/**
* Given a connection from boundary event is removed, remove the forCompensation property.
* Given a connection from boundary event is removed, remove the `isForCompensation` property.
*/

@@ -46,11 +47,12 @@ function handleConnectionRemoval(context) {

/**
* Add forCompensation property and make sure only a single compensation activity is connected.
* Add `isForCompensation` property and make sure only a single compensation activity is connected.
*/
function handleNewConnection(context) {
const source = context.source,
const connection = context.connection,
source = context.source,
target = context.target;
if (isCompensationBoundaryEvent(source) && canBeForCompensation(target)) {
if (isCompensationBoundaryEvent(source) && isForCompensationAllowed(target)) {
addIsForCompensationProperty(target);
removeExistingAssociation(source);
removeExistingAssociations(source, [ connection ]);
}

@@ -74,3 +76,3 @@ }

// newTarget perspective
if (isCompensationBoundaryEvent(source) && canBeForCompensation(newTarget)) {
if (isCompensationBoundaryEvent(source) && isForCompensationAllowed(newTarget)) {
addIsForCompensationProperty(newTarget);

@@ -85,5 +87,5 @@ }

if (isForCompensation(element)) {
removeIllegalConnections(element);
removeDisallowedConnections(element);
removeAttachments(element);
} else if (canBeForCompensation(element)) {
} else if (isForCompensationAllowed(element)) {
removeIncomingCompensationAssociations(element);

@@ -122,3 +124,3 @@ }

const targetConnection = oldShape.outgoing.find(
({ target }) => canBeForCompensation(target)
({ target }) => isForCompensationAllowed(target)
);

@@ -150,3 +152,3 @@

function removeIllegalConnections(element) {
function removeDisallowedConnections(element) {

@@ -166,5 +168,7 @@ for (const connection of element.incoming) {

function removeExistingAssociation(boundaryEvent) {
function removeExistingAssociations(boundaryEvent, ignoredAssociations) {
const associations = boundaryEvent.outgoing.filter(connection => is(connection, 'bpmn:Association'));
const associationsToRemove = associations.filter(association => isForCompensation(association.target));
const associationsToRemove = associations.filter(association => {
return isForCompensation(association.target) && !ignoredAssociations.includes(association);
});

@@ -222,4 +226,4 @@ // remove existing associations

function canBeForCompensation(element) {
function isForCompensationAllowed(element) {
return element && is(element, 'bpmn:Activity') && !isEventSubProcess(element);
}
{
"name": "bpmn-js",
"version": "16.3.0",
"version": "16.3.1",
"description": "A bpmn 2.0 toolkit and web modeler",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc