Skip to content
CONTEXT MAPPER
  • Docs
  • Language Reference
  • Generators
  • News
  • Background
  • Get Involved
    Introduction
    • Welcome
    • Getting started
    • Create CML Project
    • Examples
    • Usage as Library
    • Frequently Asked Questions
    Language Reference (Core)
    • CML Reference - Introduction
    • Language Semantics
    • Context Map
    • Bounded Context
    • Domain and Subdomain
    • Domain Vision Statement
    • Partnership
    • Shared Kernel
    • Customer/Supplier
    • Conformist
    • Open Host Service
    • Anticorruption Layer
    • Published Language
    • Responsibility Layers
    • Knowledge Level
    • Aggregate
    • Tactic DDD Syntax
    • Application and Process Layer
    • User Requirements
    • Stakeholders
    • Value Registers
    • Imports
    Analysis and Design Transformations
    • Rapid Object-oriented Analysis and Design
    • Story Splitting (PoC)
    • Stakeholder and Value Modelling Transformations
    Architectural Refactorings (ARs)
    • Architectural Refactorings
    • AR-1: Split Aggregate by Entities
    • AR-2: Split Bounded Context by Features
    • AR-3: Split Bounded Context by Owner
    • AR-4: Extract Aggregates by Volatility
    • AR-5: Extract Aggregates by Cohesion
    • AR-6: Merge Aggregates
    • AR-7: Merge Bounded Contexts
    • AR-8: Extract Shared Kernel
    • AR-9: Suspend Partnership
    • AR-10: Change Shared Kernel to Partnership
    • AR-11: Change Partnership to Shared Kernel
    Value-Driven Analysis and Design
    • Value-Driven Analysis and Design (VDAD) Support
    Service Cutter
    • Context Map Suggestions with Service Cutter
    • Service Cutter Configuration File (.servicecutter.yml)
    Reverse Engineering
    • Context Map Discovery
    Generators
    • Generators Overview
    • Context Map Generator
    • PlantUML Generator
    • BPMN Sketch Miner Generator
    • MDSL (Micro-)Service Contracts Generator
    • Service Cutter Generators
    • Generic Generator (Templating)
    Tutorials
    • Model Event Storming Results in Context Mapper
    • Event Sourcing and CQRS Modeling in Context Mapper
    • Generate Microservices From Context Map Using JHipster
    • Systematic Service Decomposition with Context Mapper and Service Cutter
    • Validating the Implementation against the Model (with ArchUnit)
    IDE Plugins and Extensions
    • Visual Studio Code Extension
    • Online IDE (no longer supported)
    • Eclipse Plugin
    • Feature Support

    BPMN Sketch Miner Generator

    Introduction and Motivation

    We use the BPMN Sketch Miner tool to visualize event/command flows in our application layers. You can model flows (for example, as resulting from an Event Storming workshop) in the CML application layer of a Bounded Context and then generate the BPMN Sketch Miner DSL or directly open the tool from Context Mapper.

    Example Flow

    The following CML code illustrates how you can model flows. A complete documentation on the syntax can be found in the language reference.

    /**
     * A flow inspired by the Lakeside Mutual project (https://github.com/Microservice-API-Patterns/LakesideMutual).
     * Find the original process visualization here:
     * https://github.com/Microservice-API-Patterns/LakesideMutual/blob/master/policy-management-backend/src/main/java/com/lakesidemutual/policymanagement/domain/insurancequoterequest/RequestStatus.java
     **/
    BoundedContext InsuranceQuotes {
      Application {
        Flow QuoteRequestFlow {
          operation submitRequest delegates to QuoteRequest[-> SUBMITTED] emits event RequestSubmitted
          event RequestSubmitted + RequestSubmitted triggers operation checkRequest
          operation checkRequest delegates to QuoteRequest[SUBMITTED -> RECEIVED X REJECTED] emits event QuoteReceived X RequestRejected
          event QuoteReceived triggers operation receiveAndCheckQuote
          operation receiveAndCheckQuote delegates to QuoteRequest[RECEIVED -> REJECTED X ACCEPTED X EXPIRED] emits event QuoteRejected X QuoteAccepted X QuoteExpired
          event QuoteAccepted triggers operation accept
          operation accept delegates to QuoteRequest[ACCEPTED -> POLICY_CREATED X EXPIRED] emits event PolicyCreated X QuoteExpired
        }
      }
      Aggregate QuoteRequest {
        Entity Request {
          aggregateRoot
        }
        DomainEvent RequestSubmitted
        DomainEvent QuoteReceived
        DomainEvent RequestRejected
        DomainEvent QuoteRejected
        DomainEvent QuoteAccepted
        DomainEvent QuoteExpired
        DomainEvent PolicyCreated
        Service QuoteRequestService {
          void submitRequest(@Request request);
          void checkRequest(@Request request);
          void receiveAndCheckQuote(@Request request);
          void reject(@Request request);
          void accept(@Request request);
        }
        enum RequestState {
          aggregateLifecycle
           SUBMITTED, RECEIVED, REJECTED, ACCEPTED, EXPIRED, POLICY_CREATED
        }
      }
    }
    

    Open Flow in BPMN Sketch Miner

    The Context Mapper IDEs (VS Code extension as well as Eclipse plugin) allow you to open a flow in BPMN Sketch Miner with two (or max. three) clicks. The following example illustrates this in VS Code (Eclipse works the same way).

    Once you modelled your flow in CML, the editor will show a message and a light bulb on the line with the flow name:

    BPMN Sketch Miner message on CML flow

    Just click on the light bulb and then “Open flow in BPMN Sketch Miner”:

    Open flow in BPMN Sketch Miner (1)

    In VS Code you have to click “Open” one more time to finally open BPMN Sketch Miner in the browser:

    Open flow in BPMN Sketch Miner (2)

    And, voilà… a visualization of your CML flow powered by BPMN Sketch Miner:

    CML flow visualized in BPMN Sketch Miner

    Generate BPMN Sketch Miner DSL File

    Instead of directly opening the BPMN Sketch Miner tool, you can also generate the Sketch Miner DSL into text files. This can be done by calling “Generate Sketch Miner Diagrams” in the context menu of the Context Mapper editor:

    Generate Sketch Miner Files

    In this case Context Mapper generates the Sketch Miner DSL into a text file in the src-gen folder:

    Generate Sketch Miner Files

    To visualize the flow you can then open https://www.bpmn-sketch-miner.ai/ and copy the generated text manually.

    Improve this page on GitHub
    ← PreviousPlantUML Generator Next →MDSL (Micro-)Service Contracts Generator
    © 2026 Context Mapper contributors
    • GitHub
    • Get Involved
    • Background & Publications
    • RSS