# vanillabp/blueprint-workflowmodule-springboot-standalone architecture

> Architecture diagram of the GitHub repository vanillabp/blueprint-workflowmodule-springboot-standalone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vanillabp/blueprint-workflowmodule-springboot-standalone
- Repository: https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone

## Overview

##### Main Components

- Spring Boot Application Entry Point
– Represented by Application.java which bootstraps the application.

- Workflow Module for Loan Approval
– Contains packages such as “loanapproval” with components including the API Controller (ApiController.java), service layer (Service.java), configuration properties (LoanApprovalProperties.java), and domain model/repository (e.g., Aggregate.java and AggregateRepository.java).

- BPMN Process Integration & Configuration
– BPMN process definitions exist in the resources under “processes/camunda7” and “processes/camunda8”.
– Configuration files (application.yaml, application-camunda7.yaml, application-camunda8.yaml) determine which Camunda engine profile is activated at runtime.

- Build and Deployment Infrastructure
– Maven is used as the build tool (pom.xml, maven wrapper files) and profiles (like “camunda7”) activate specific runtime behaviors.

- External Dependencies
– Integration with Camunda through the Camunda adapter (for Camunda 7 specifically, and instructions for Camunda 8 provided in the separate CAMUNDA8.md file).
– Potential integration with a Camunda Cockpit (as recommended in the README).

##### Relationships and Data Flow

- REST API Layer
– The API Controller serves as the entry point for HTTP calls (e.g., requests to start a loan approval process or assess risk).

- Business Logic Layer
– The API Controller forwards requests to the Service layer, which encapsulates the core business logic.
– Indicate a connection from the controller to the service node.

- Domain Model & Persistence
– The Service layer accesses the Aggregate and AggregateRepository components to manage workflow state.

- BPM Engine Integration
– The Service layer interacts with the BPM engine by triggering BPMN processes (using the BPMN file from the processes directory).
– Connect the service node to a BPM Process (label it “BPMN Engine” or “Camunda Engine”) and annotate that this integration is dependent on the selected profile (Camunda 7 or Camunda 8).

- Configuration Management
– External configuration files (application.yaml and its profile-specific variants) provide necessary settings to wire up the Camunda adapter and Spring Boot components.
– Show a configuration block that feeds into the application at startup.

##### Architectural Patterns & Technologies

- Modularization by Business Use Case
– The loan approval workflow is self-contained within its package, making it easier to extend the application.
– Emphasize that replicating this structure for new business cases means each will have its own API Controller, service, config, and repository.

- Use of Profiles for Multi-Engine Support
– The system uses Maven and Spring profiles (camunda7 and camunda8) to allow switching between Camunda versions.

- Integration with BPMN and External Tools

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configurations Subgraph
    subgraph "Configurations"
        J("Default Config"):::config
        J2("Camunda7 Config"):::config
        J3("Camunda8 Config"):::config
    end

    %% Application Core
    subgraph "Application Core"
        A("Spring Boot Application"):::app
    end

    %% Loan Approval Workflow Module
    subgraph "Loan Approval Workflow Module"
        B("Loan Approval API Controller"):::controller
        C("Loan Approval Service Layer"):::service
        D("Loan Approval Config Properties"):::config
        E("Aggregate Domain Model"):::domain
        F("Aggregate Repository"):::domain
    end

    %% BPM Engine Integration
    subgraph "BPM Engine Integration"
        G("BPM Engine (Camunda 7/8)"):::bpmn
        H("BPMN Process - Camunda 7"):::bpmn
        I("BPMN Process - Camunda 8"):::bpmn
    end

    %% Project Infrastructure
    subgraph "Project Infrastructure"
        K("Build & Deployment (Maven)"):::build
        L("External Dependencies (Camunda8 Instructions)"):::docs
    end

    %% Connections
    J --> A
    J2 --> A
    J3 --> A

    A --> B
    B --> C
    C --> D
    C --> E
    C --> F
    C --> G

    G --> H
    G --> I

    K --> A
    L --> G

    %% Click Events
    click A "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/Application.java"
    click B "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/loanapproval/ApiController.java"
    click C "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/loanapproval/Service.java"
    click D "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/loanapproval/config/LoanApprovalProperties.java"
    click E "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/loanapproval/model/Aggregate.java"
    click F "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/java/blueprint/workflowmodule/standalone/loanapproval/model/AggregateRepository.java"
    click H "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/resources/processes/camunda7/loan_approval.bpmn"
    click I "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/resources/processes/camunda8/loan_approval.bpmn"
    click J "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/resources/application.yaml"
    click J2 "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/resources/application-camunda7.yaml"
    click J3 "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/src/main/resources/application-camunda8.yaml"
    click K "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/pom.xml"
    click L "https://github.com/vanillabp/blueprint-workflowmodule-springboot-standalone/blob/main/CAMUNDA8.md"

    %% Styles
    classDef app fill:#d9ead3,stroke:#38761d,stroke-width:2px;
    classDef controller fill:#cfe2f3,stroke:#1155cc,stroke-width:2px;
    classDef service fill:#fff2cc,stroke:#bf9000,stroke-width:2px;
    classDef domain fill:#f9cb9c,stroke:#b45f06,stroke-width:2px;
    classDef bpmn fill:#ead1dc,stroke:#b854a4,stroke-width:2px;
    classDef config fill:#d0e0e3,stroke:#2e6da4,stroke-width:2px;
    classDef build fill:#f4cccc,stroke:#cc0000,stroke-width:2px;
    classDef docs fill:#d9d2e9,stroke:#5b4596,stroke-width:2px;
```
