Lack of Synchronization

Written by

in

Description

The term refers to a situation where concurrent processes are not properly synchronized, leading to unpredictable or inconsistent process flows. The “Lack of Synchronization” is a modeling error that occurs whenever an And Junction is combined with an Or Junction. All outgoing arrows from the And Junction will be activated. But the semantic of the Or Junction is to wait for only one element.

Context

Derived from: “Lack of Synchronization” BPM anti-pattern

Consequences

This may result in unwanted behavior because we don’t wait for both elements to end.

Detection

The “Lack of Synchronization” occurs when the process has been split by an “And Junction”, later joined by an “OR Junction”. The “OR Junction” violates the synchronized manner of the process.

Solution

Consider the semantics of junctions and remodel the process to prevent synchronization problems.

Example

After “Start Event”, the process is split by an AND Junction into two separate processes, “Evaluate Customer credit” and “Process order” are running simultaneously. These two processes are dependent on each other. For example, the order should be canceled if the customer does not have enough credit. Therefore the actions “Evaluate Customer credit” and “Process order” should be considered as a synchronized process, but by having an OR Junction, the synchronization can not be guaranteed anymore, and “End Event” can be triggered by one of both processes, which leads to an undesired result.

Cypher query

MATCH (a)-[r]->(endNode:Junction {type: 'or'}) <br /> WITH COUNT(r) as rCnt, endNode <br /> WHERE rCnt>1 <br /> WITH endNode <br /> MATCH (startNode:Junction{type: 'and'}) <br /> CALL apoc.path.expandConfig(startNode,{relationshipFilter:"TriggeringRelationship>|FlowRelationship>|AssociationRelationship>", <br /> minLevel: $minLevel, <br /> maxLevel: $maxLevel, <br /> endNode:[endNode] <br /> }) <br /> YIELD path AS p <br /> RETURN p

Cypher count query

MATCH (a)-[r]->(endNode:Junction {type: 'or'}) with count(r) as rCnt, endNode where rCnt>1 with endNode MATCH (startNode:Junction{type: 'and'}) CALL apoc.path.expandConfig(startNode,{relationshipFilter:"TriggeringRelationship>|FlowRelationship>|AssociationRelationship>", minLevel: 3, maxLevel: 10, endNode:[endNode] }) YIELD path AS p RETURN COUNT (DISTINCT endNode)

Diagram

Diagram for Lack of Synchronization

Tags

Process, Control-flow Problems

Query parameters

[
    {
        "name": "minLevel",
        "type": "number",
        "default": 2,
        "description": "The minimum length of the path for detection."
    },
    {
        "name": "maxLevel",
        "type": "number",
        "default": 5,
        "description": "The maximum length of the path for detection."
    }
]

Related smells

All smells