Skip to content
IRC-CodingIRC-Coding
BPMNProcess ModelingWorkflowBusiness Process ManagementNotationBPMN 2.0DiagramBPM

BPMN Basics: Business Process Model and Notation

Learn BPMN fundamentals for process modeling and workflow management. BPMN 2.0 with practical examples.

S

schutzgeist

8 min read
BPMN Basics: Business Process Model and Notation

BPMN Basics: Business Process Model and Notation

Business Process Model and Notation (BPMN) is the international standard for visualizing business processes. BPMN 2.0 provides a standardized notation for modeling, analyzing, and optimizing business workflows.

What is BPMN?

BPMN is a graphical notation language for describing business processes. Developed by the Object Management Group (OMG), it has been standardized as ISO 19510 since 2011.

Key Features of BPMN

  • Standardized Notation: Consistent symbols and rules across all diagrams
  • Visual Modeling: Clear graphical representation of processes
  • Technology-Agnostic: Works across different platforms and systems
  • Executable Processes: Can be directly deployed to workflow engines

Core BPMN Elements

1. Flow Objects

Events

Events represent triggers or results within a process:

<!-- Start Event -->
<bpmn:startEvent id="startEvent" name="Prozess starten"/>

<!-- End Event -->
<bpmn:endEvent id="endEvent" name="Prozess beenden"/>

<!-- Intermediate Event -->
<bpmn:intermediateCatchEvent id="timerEvent" name="Wartezeit">
  <bpmn:timerEventDefinition/>
</bpmn:intermediateCatchEvent>

Event Types:

  • Start Event: Marks the beginning of a process
  • End Event: Marks the completion of a process
  • Intermediate Event: Occurs between start and end events

Activities

Activities represent work steps that must be completed:

<!-- Task -->
<bpmn:task id="task1" name="Daten eingeben"/>

<!-- User Task -->
<bpmn:userTask id="userTask1" name="Genehmigung erforderlich"/>

<!-- Service Task -->
<bpmn:serviceTask id="serviceTask1" name="Automatische Prüfung"/>

<!-- Sub-Process -->
<bpmn:subProcess id="subProcess1" name="Detailprozess">
  <bpmn:startEvent id="subStart"/>
  <bpmn:task id="subTask1"/>
  <bpmn:endEvent id="subEnd"/>
</bpmn:subProcess>

Gateways

Gateways control the flow of a process by evaluating conditions:

<!-- Exclusive Gateway (XOR) -->
<bpmn:exclusiveGateway id="gateway1" name="Entscheidung"/>

<!-- Parallel Gateway (AND) -->
<bpmn:parallelGateway id="gateway2" name="Parallelisierung"/>

<!-- Inclusive Gateway (OR) -->
<bpmn:inclusiveGateway id="gateway3" name="Mehrfachauswahl"/>

2. Connecting Objects

Sequence Flows

Connect activities and gateways in sequence:

<bpmn:sequenceFlow id="flow1" sourceRef="startEvent" targetRef="task1"/>
<bpmn:sequenceFlow id="flow2" sourceRef="task1" targetRef="gateway1"/>

Message Flows

Enable communication between different processes:

<bpmn:messageFlow id="msgFlow1" sourceRef="pool1" targetRef="pool2"/>

Associations

Link artifacts to flow objects:

<bpmn:association id="assoc1" sourceRef="dataObject1" targetRef="task1"/>

3. Pools and Lanes

Pools

Represent participants or organizations involved in the process:

<bpmn:pool id="pool1" name="Abteilung A">
  <bpmn:laneSet>
    <bpmn:lane id="lane1" name="Mitarbeiter"/>
    <bpmn:lane id="lane2" name="Management"/>
  </bpmn:laneSet>
</bpmn:pool>

Lanes

Organize activities within pools by role or responsibility:

<bpmn:lane id="lane1" name="Vertrieb">
  <bpmn:flowNodeRef>task1</bpmn:flowNodeRef>
  <bpmn:flowNodeRef>gateway1</bpmn:flowNodeRef>
</bpmn:lane>

4. Data Objects

Data Objects

Represent information used or produced by the process:

<bpmn:dataObject id="data1" name="Kundendaten"/>
<bpmn:dataStoreReference id="store1" name="Datenbank"/>

Practical BPMN Example

Order Processing Workflow

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
                  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
                  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
                  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
                  id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
  
  <bpmn:process id="Bestellprozess" isExecutable="false">
    
    <!-- Start Event -->
    <bpmn:startEvent id="StartEvent_1" name="Bestellung eingegangen">
      <bpmn:outgoing>Flow_1</bpmn:outgoing>
    </bpmn:startEvent>
    
    <!-- Task: Bestellung prüfen -->
    <bpmn:userTask id="Task_1" name="Bestellung prüfen">
      <bpmn:incoming>Flow_1</bpmn:incoming>
      <bpmn:outgoing>Flow_2</bpmn:outgoing>
    </bpmn:userTask>
    
    <!-- Gateway: Entscheidung -->
    <bpmn:exclusiveGateway id="Gateway_1" name="Bestellung gültig?">
      <bpmn:incoming>Flow_2</bpmn:incoming>
      <bpmn:outgoing>Flow_3</bpmn:outgoing>
      <bpmn:outgoing>Flow_4</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    
    <!-- Task: Lager prüfen -->
    <bpmn:serviceTask id="Task_2" name="Lagerbestand prüfen">
      <bpmn:incoming>Flow_3</bpmn:incoming>
      <bpmn:outgoing>Flow_5</bpmn:outgoing>
    </bpmn:serviceTask>
    
    <!-- Task: Ablehnung -->
    <bpmn:userTask id="Task_3" name="Bestellung ablehnen">
      <bpmn:incoming>Flow_4</bpmn:incoming>
      <bpmn:outgoing>Flow_6</bpmn:outgoing>
    </bpmn:userTask>
    
    <!-- End Events -->
    <bpmn:endEvent id="EndEvent_1" name="Bestellung bestätigt">
      <bpmn:incoming>Flow_5</bpmn:incoming>
    </bpmn:endEvent>
    
    <bpmn:endEvent id="EndEvent_2" name="Bestellung abgelehnt">
      <bpmn:incoming>Flow_6</bpmn:incoming>
    </bpmn:endEvent>
    
    <!-- Sequence Flows -->
    <bpmn:sequenceFlow id="Flow_1" sourceRef="StartEvent_1" targetRef="Task_1"/>
    <bpmn:sequenceFlow id="Flow_2" sourceRef="Task_1" targetRef="Gateway_1"/>
    <bpmn:sequenceFlow id="Flow_3" name="Ja" sourceRef="Gateway_1" targetRef="Task_2"/>
    <bpmn:sequenceFlow id="Flow_4" name="Nein" sourceRef="Gateway_1" targetRef="Task_3"/>
    <bpmn:sequenceFlow id="Flow_5" sourceRef="Task_2" targetRef="EndEvent_1"/>
    <bpmn:sequenceFlow id="Flow_6" sourceRef="Task_3" targetRef="EndEvent_2"/>
    
  </bpmn:process>
  
</bpmn:definitions>

BPMN Gateway Types in Detail

Exclusive Gateway (XOR)

Only a single outgoing path can be taken:

// Java implementation of an Exclusive Gateway
public class ExclusiveGateway {
    private Map<String, String> conditions;
    
    public String evaluateCondition(Map<String, Object> context) {
        for (Map.Entry<String, String> condition : conditions.entrySet()) {
            if (evaluateExpression(condition.getKey(), context)) {
                return condition.getValue();
            }
        }
        return null; // Default Path
    }
    
    private boolean evaluateExpression(String expression, Map<String, Object> context) {
        // Implementation of condition evaluation
        return context.containsKey(expression) && (Boolean) context.get(expression);
    }
}

Parallel Gateway (AND)

All outgoing paths are activated simultaneously:

// Java implementation of a Parallel Gateway
public class ParallelGateway {
    private List<String> outgoingFlows;
    private List<String> incomingFlows;
    
    public List<String> execute() {
        if (allIncomingFlowsCompleted()) {
            return new ArrayList<>(outgoingFlows);
        }
        return Collections.emptyList();
    }
    
    private boolean allIncomingFlowsCompleted() {
        // Check if all incoming flows have completed
        return true; // Simplified implementation
    }
}

Inclusive Gateway (OR)

Multiple outgoing paths can be selected:

// Java implementation of an Inclusive Gateway
public class InclusiveGateway {
    private List<ConditionFlow> conditionFlows;
    
    public List<String> evaluateConditions(Map<String, Object> context) {
        List<String> activeFlows = new ArrayList<>();
        
        for (ConditionFlow conditionFlow : conditionFlows) {
            if (conditionFlow.evaluate(context)) {
                activeFlows.add(conditionFlow.getTargetId());
            }
        }
        
        return activeFlows;
    }
}

BPMN Events and Event Types

Timer Events

Time-driven processes:

<bpmn:intermediateCatchEvent id="timerEvent" name="Wait Time">
  <bpmn:timerEventDefinition>
    <bpmn:timeDuration>P2DT3H4M</bpmn:timeDuration> <!-- 2 days, 3 hours, 4 minutes -->
  </bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>

Message Events

Message-driven communication:

<bpmn:intermediateCatchEvent id="messageEvent" name="Receive Message">
  <bpmn:messageEventDefinition messageRef="message1"/>
</bpmn:intermediateCatchEvent>

Error Events

Error handling in processes:

<bpmn:boundaryEvent id="errorBoundary" attachedToRef="task1">
  <bpmn:errorEventDefinition errorRef="error1"/>
</bpmn:boundaryEvent>

Implementing BPMN with Camunda

Process Deployment

// Camunda BPMN process deployment
@Service
public class ProcessDeploymentService {
    
    @Autowired
    private RepositoryService repositoryService;
    
    public void deployProcess(String processName, String bpmnFile) {
        try (InputStream inputStream = getClass().getResourceAsStream(bpmnFile)) {
            Deployment deployment = repositoryService.createDeployment()
                .addClassnameResource(processName + ".class")
                .addInputStream(processName + ".bpmn", inputStream)
                .deploy();
                
            System.out.println("Process deployed: " + deployment.getId());
        } catch (IOException e) {
            throw new RuntimeException("Error during deployment", e);
        }
    }
}

Starting a Process Instance

// Camunda process instance startup
@Service
public class ProcessInstanceService {
    
    @Autowired
    private RuntimeService runtimeService;
    
    public String startProcess(String processKey, Map<String, Object> variables) {
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(
            processKey, 
            variables
        );
        
        return processInstance.getId();
    }
    
    public List<Task> getUserTasks(String processInstanceId) {
        return taskService.createTaskQuery()
            .processInstanceId(processInstanceId)
            .list();
    }
}

Task Handler

// Camunda task handler
@Component
public class OrderTaskHandler {
    
    @EventListener
    public void handleTaskCreated(TaskCreatedEvent event) {
        String taskId = event.getTaskId();
        String taskName = event.getTaskName();
        
        if ("Check Order".equals(taskName)) {
            processOrderTask(taskId);
        }
    }
    
    private void processOrderTask(String taskId) {
        // Business logic for order verification
        Map<String, Object> variables = new HashMap<>();
        variables.put("orderValid", true);
        variables.put("orderAmount", 1000.0);
        
        taskService.complete(taskId, variables);
    }
}

BPMN Best Practices

1. Process Modeling Guidelines

// BPMN validation rules
public class BPMNValidator {
    
    public ValidationResult validateProcess(Process process) {
        ValidationResult result = new ValidationResult();
        
        // Every process must have a start event
        if (!hasStartEvent(process)) {
            result.addError("Process requires at least one start event");
        }
        
        // Every process must have an end event
        if (!hasEndEvent(process)) {
            result.addError("Process requires at least one end event");
        }
        
        // All tasks must be connected
        if (hasDisconnectedTasks(process)) {
            result.addError("Process contains disconnected tasks");
        }
        
        return result;
    }
    
    private boolean hasStartEvent(Process process) {
        return process.getFlowElements().stream()
            .anyMatch(element -> element instanceof StartEvent);
    }
    
    private boolean hasEndEvent(Process process) {
        return process.getFlowElements().stream()
            .anyMatch(element -> element instanceof EndEvent);
    }
}

2. Naming Conventions

<!-- Good naming conventions -->
<bpmn:userTask id="checkOrderTask" name="Check Order"/>
<bpmn:exclusiveGateway id="isValidGateway" name="Order Valid?"/>
<bpmn:serviceTask id="sendEmailTask" name="Send Confirmation"/>

<!-- Poor naming conventions -->
<bpmn:userTask id="task1" name="Task 1"/>
<bpmn:exclusiveGateway id="gw1" name="Gateway"/>

3. Process Optimization

// Process performance analysis
@Service
public class ProcessAnalyticsService {
    
    @Autowired
    private HistoryService historyService;
    
    public ProcessMetrics analyzeProcess(String processDefinitionKey) {
        List<HistoricProcessInstance> instances = historyService
            .createHistoricProcessInstanceQuery()
            .processDefinitionKey(processDefinitionKey)
            .finished()
            .list();
        
        ProcessMetrics metrics = new ProcessMetrics();
        metrics.setTotalInstances(instances.size());
        metrics.setAverageDuration(calculateAverageDuration(instances));
        metrics.setSuccessRate(calculateSuccessRate(instances));
        
        return metrics;
    }
    
    private Duration calculateAverageDuration(List<HistoricProcessInstance> instances) {
        return instances.stream()
            .map(instance -> Duration.between(
                instance.getStartTime(), 
                instance.getEndTime()
            ))
            .reduce(Duration.ZERO, Duration::plus)
            .dividedBy(instances.size());
    }
}

BPMN Tools and Frameworks

1. Camunda Modeler

// Camunda Modeler plugin example
const customPlugin = {
  id: 'custom-validation-plugin',
  init: function(modeler) {
    
    // Custom validation rule
    modeler.get('validationRules').add('task-name-required', function(element) {
      if (element.type === 'bpmn:Task' && !element.name) {
        return 'Task must have a name';
      }
    });
    
    // Custom property panel
    modeler.get('propertiesPanel').registerProvider({
      getTabs: function(element) {
        if (element.type === 'bpmn:UserTask') {
          return {
            'custom-task-tab': {
              label: 'Custom Task Properties',
              entries: [
                {
                  id: 'task-priority',
                  label: 'Priority',
                  component: 'textfield',
                  bindTo: 'customPriority'
                }
              ]
            }
          };
        }
      }
    });
  }
};

2. BPMN.js Integration

// BPMN.js Viewer Integration
import BpmnViewer from 'bpmn-js/lib/Viewer';

class BPMNViewer {
  constructor(container) {
    this.viewer = new BpmnViewer({
      container: container,
      width: '100%',
      height: '500px'
    });
  }
  
  async loadDiagram(xml) {
    try {
      await this.viewer.importXML(xml);
      
      // Zoom to fit
      const canvas = this.viewer.get('canvas');
      canvas.zoom('fit-viewport');
      
    } catch (err) {
      console.error('Error loading BPMN diagram:', err);
    }
  }
  
  addClickListener(callback) {
    this.viewer.on('element.click', function(event) {
      const element = event.element;
      callback(element);
    });
  }
}

// Usage
const viewer = new BPMNViewer('#bpmn-container');
viewer.loadDiagram(bpmnXml);
viewer.addClickListener((element) => {
  console.log('Clicked element:', element.id, element.name);
});

BPMN in Practice

E-Commerce Order Process

<!-- Complex order process with multiple participants -->
<bpmn:definitions>
  
  <!-- Pool: Customer -->
  <bpmn:pool id="customerPool" name="Customer">
    <bpmn:lane id="customerLane" name="Customer">
      <bpmn:userTask id="placeOrder" name="Place Order"/>
      <bpmn:userTask id="makePayment" name="Make Payment"/>
    </bpmn:lane>
  </bpmn:pool>
  
  <!-- Pool: Shop System -->
  <bpmn:pool id="shopPool" name="Shop System">
    <bpmn:lane id="orderLane" name="Order Processing">
      <bpmn:serviceTask id="validateOrder" name="Validate Order"/>
      <bpmn:serviceTask id="checkInventory" name="Check Inventory"/>
      <bpmn:userTask id="processPayment" name="Process Payment"/>
    </bpmn:lane>
    <bpmn:lane id="warehouseLane" name="Warehouse">
      <bpmn:userTask id="pickItems" name="Pick Items"/>
      <bpmn:userTask id="packageItems" name="Package Items"/>
    </bpmn:lane>
  </bpmn:pool>
  
  <!-- Pool: Delivery Service -->
  <bpmn:pool id="deliveryPool" name="Delivery Service">
    <bpmn:lane id="deliveryLane" name="Shipping">
      <bpmn:serviceTask id="scheduleDelivery" name="Schedule Delivery"/>
      <bpmn:userTask id="deliverPackage" name="Deliver Package"/>
    </bpmn:lane>
  </bpmn:pool>
  
  <!-- Message Flows between Pools -->
  <bpmn:messageFlow id="orderMessage" sourceRef="placeOrder" targetRef="validateOrder"/>
  <bpmn:messageFlow id="paymentMessage" sourceRef="makePayment" targetRef="processPayment"/>
  <bpmn:messageFlow id="deliveryMessage" sourceRef="packageItems" targetRef="scheduleDelivery"/>
  
</bpmn:definitions>

Approval Process

// Approval process with escalation
@Service
public class ApprovalProcessService {
    
    public String startApprovalProcess(ApprovalRequest request) {
        Map<String, Object> variables = new HashMap<>();
        variables.put("requestId", request.getId());
        variables.put("amount", request.getAmount());
        variables.put("requester", request.getRequester());
        variables.put("approvalLevel", determineApprovalLevel(request.getAmount()));
        
        return runtimeService.startProcessInstanceByKey(
            "approval-process",
            variables
        ).getId();
    }
    
    private String determineApprovalLevel(Double amount) {
        if (amount < 1000) return "manager";
        if (amount < 10000) return "director";
        return "executive";
    }
    
    @EventListener
    public void handleEscalation(TaskEscalationEvent event) {
        String taskId = event.getTaskId();
        String escalationLevel = event.getEscalationLevel();
        
        // Forward escalation to higher level
        Map<String, Object> escalationVariables = new HashMap<>();
        escalationVariables.put("escalatedFrom", taskId);
        escalationVariables.put("escalationReason", event.getReason());
        
        taskService.delegateTask(taskId, escalateLevel + "_approval");
    }
}

BPMN Exam Preparation

Key Exam Topics

  • BPMN Core Elements: Events, Activities, Gateways
  • Flow Objects: Different types and their applications
  • Connecting Objects: Sequence Flows, Message Flows, Associations
  • Pools and Lanes: Process organization and responsibilities
  • Gateway Types: Exclusive, Parallel, Inclusive, Complex
  • Event Types: Start, End, Intermediate Events
  • Sub-Processes: Embedded and Call Activities
  • Data Objects: Representation of information

Typical Exam Questions

  1. Process Analysis: Interpret given BPMN diagrams
  2. Process Modeling: Represent business processes in BPMN
  3. Gateway Selection: Choose the correct gateway types
  4. Event Handling: Model event-driven processes
  5. Process Optimization: Identify inefficiencies in BPMN processes

Exam-Relevant Concepts

// Exam-relevant BPMN concepts
public class BPMNExamConcepts {
    
    // 1. Process paths and gateway logic
    public void demonstrateGatewayLogic() {
        // Exclusive Gateway: Only one path
        // Parallel Gateway: All paths simultaneously
        // Inclusive Gateway: Multiple paths possible
    }
    
    // 2. Event-based process control
    public void demonstrateEventHandling() {
        // Start Events initiate processes
        // Intermediate Events control process flow
        // End Events terminate processes
    }
    
    // 3. Data flow in BPMN
    public void demonstrateDataFlow() {
        // Data Objects represent information
        // Data Stores for persistent data
        // Associations connect data with Activities
    }
}

Summary

BPMN is a powerful standard tool for process modeling that:

  • Standardizes uniform process representation across organizations
  • Visualizes complex business processes in an understandable way
  • Automates direct implementation into workflow systems
  • Facilitates collaborative process development
  • Optimizes systematic process improvement

Mastering BPMN is essential for IT professionals and business analysts to effectively model, analyze, and automate modern business processes.


Further Resources:

Back to Blog
Share:

Nächster Artikel in Business Process Management

Weiterlesen
BPMN Basics: Process Modeling with Events & Gateways

Related Posts