BPMN Basics: Business Process Model and Notation
Business Process Model and Notation (BPMN) is the international standard for graphical representation of business processes. BPMN 2.0 provides standardized notation for modeling, analyzing, and optimizing business workflows.
What is BPMN?
BPMN is a graphical notation language for describing business processes. It was developed by the Object Management Group (OMG) and has been standardized as ISO standard 19510 since 2011.
Key Features of BPMN
- Standardized Notation: Uniform symbols and rules
- Graphical Representation: Visual process modeling
- Technology Independent: Cross-platform application
- Executable Processes: Direct implementation in workflow engines
BPMN Basic Elements
1. Flow Objects
Events
Events are triggers or results in 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: Process start
- End Event: Process end
- Intermediate Event: Intermediate events
Activities
Activities represent work steps in the process:
<!-- 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 process flow:
<!-- 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:
<bpmn:sequenceFlow id="flow1" sourceRef="startEvent" targetRef="task1"/>
<bpmn:sequenceFlow id="flow2" sourceRef="task1" targetRef="gateway1"/>
Message Flows
Communication between different processes:
<bpmn:messageFlow id="msgFlow1" sourceRef="pool1" targetRef="pool2"/>
Associations
Connect artifacts with flow objects:
<bpmn:association id="assoc1" sourceRef="dataObject1" targetRef="task1"/>
3. Pools and Lanes
Pools
Represent participants 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:
<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 in the process:
<bpmn:dataObject id="data1" name="Kundendaten"/>
<bpmn:dataStoreReference id="store1" name="Datenbank"/>
Practical BPMN Example
Order Process Modeling
<?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 one outgoing path can be chosen:
// 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 whether all incoming flows are completed
return true; // Simplified implementation
}
}
Inclusive Gateway (OR)
Multiple output paths can be selected:
// Java Implementierung eines 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-controlled processes:
<bpmn:intermediateCatchEvent id="timerEvent" name="Wartezeit">
<bpmn:timerEventDefinition>
<bpmn:timeDuration>P2DT3H4M</bpmn:timeDuration> <!-- 2 Tage, 3 Stunden, 4 Minuten -->
</bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>
Message Events
Message-driven communication:
<bpmn:intermediateCatchEvent id="messageEvent" name="Nachricht empfangen">
<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 Prozessdeployment
@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("Prozess deployed: " + deployment.getId());
} catch (IOException e) {
throw new RuntimeException("Fehler beim Deployment", e);
}
}
}
Starting Process Instance
// Camunda Prozessinstanz starten
@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 ("Bestellung prüfen".equals(taskName)) {
processOrderTask(taskId);
}
}
private void processOrderTask(String taskId) {
// Business Logik für Bestellprüfung
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 Validierungsregeln
public class BPMNValidator {
public ValidationResult validateProcess(Process process) {
ValidationResult result = new ValidationResult();
// Each process must have a start event
if (!hasStartEvent(process)) {
result.addError("Prozess benötigt mindestens ein Start Event");
}
// Each process must have an end event
if (!hasEndEvent(process)) {
result.addError("Prozess benötigt mindestens ein End Event");
}
// All tasks must be connected
if (hasDisconnectedTasks(process)) {
result.addError("Es existieren nicht verbundene 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="Order verifying"/>
<bpmn:exclusiveGateway id="isValidGateway" name="Order valid?"/>
<bpmn:serviceTask id="sendEmailTask" name="Send confirmation"/>
<!-- Bad naming conventions -->
<bpmn:userTask id="task1" name="Task 1"/>
<bpmn:exclusiveGateway id="gw1" name="Gateway"/>
3. Process Optimization
// Prozessperformance Analyse
@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 Beispiel
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 muss einen Namen haben';
}
});
// 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="Delivery">
<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
Important Exam Topics
- BPMN Basic 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 Tasks
- Process Analysis: Interpret given BPMN diagrams
- Process Modeling: Represent business processes in BPMN
- Gateway Application: Select appropriate gateway types
- Event Handling: Model event-driven processes
- 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:
- Standardization enables uniform process representation
- Visualization makes complex business processes understandable
- Automation supports direct implementation in workflow systems
- Collaboration promotes joint process development
- Optimization enables systematic process improvement
Mastering BPMN is essential for IT professionals and business analysts to effectively model, analyze, and automate modern business processes.
Further Resources: