# viadee/quarkus-camunda-external-task-client architecture

> Architecture diagram of the GitHub repository viadee/quarkus-camunda-external-task-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/viadee/quarkus-camunda-external-task-client
- Repository: https://github.com/viadee/quarkus-camunda-external-task-client

## Overview

##### Project Type and Purpose
- This is a Quarkus extension that integrates with the Camunda BPM external task client—the project enables automatic subscription of external task handlers by simply annotating them and provides a configurable ExternalTaskClient bean.
- The project serves as both a library (runtime/deployment modules) and provides example applications (example-engine and example-worker) showing how to integrate and use the extension in practice.

##### File Structure
- Top-level directories include “deployment”, “example”, and “runtime”. The “deployment” folder contains classes and configurations related to deploying the extension, while “runtime” holds the core extension logic (e.g., ClientConfiguration, ExternalTaskSubscription, ExternalTaskClient creation).
- The “example” directory is split further into “example-engine” (which likely demonstrates process deployment or engine integration) and “example-worker” (which demonstrates task handling using the extension). This separation highlights the practical usage demonstration and configuration of the extension.
- Other configuration artifacts like Maven POM files (in multiple folders) and GitHub workflow files show continuous integration and the standard build lifecycle.

##### Key Components
a. Core Extension Module (Runtime):
- A component labeled “Quarkus Camunda External Task Client Runtime”.
- Sub-components like:
- ClientConfiguration (holds config properties from application.properties)
- ExternalTaskSubscription mechanism for auto subscription of task handlers.
- ExternalTaskClient bean provision.
b. Deployment Module:
- A “Deployment” component that integrates with and packages the extension into the runtime environment.
- “Processor” (e.g., QuarkusCamundaExternalTaskClientProcessor.java) which might contribute to build-time initialization or configuration.
c. Example Applications:
- Two modules: “Example Engine” and “Example Worker”.
- “Example Engine” shows how a Camunda process engine would interact with the external task client (direct API usage and process deployment).
- “Example Worker” demonstrates actual implementations of ExternalTaskHandler (e.g., LogOnConsoleHandler, LogSomethingElseHandler) that use the annotation-based subscription.
d. External Camunda BPM Engine:

##### Relationships and Interactions
- Dependencies from the “example” modules to the core extension runtime, indicating that the sample implementations depend on the auto-configuration and subscription features.
- How ClientConfiguration feeds into the setup of the ExternalTaskClient.
- How annotated ExternalTaskHandlers are auto-discovered and registered via the ExternalTaskSubscription mechanism.
- How the deployment module (processor) might influence bean initialization during application startup in Quarkus.

##### Architectural Patterns and Design Principles
- Dependency injection and build-time initialization (typical in Quarkus extensions).
- Modular design—the extension core is separated from deployment logic and isolated from example implementations.
- The auto-discovery of annotated handlers suggests use of convention-over-configuration and possibly annotation processing at build time (via the processor in the deployment module).

##### Specific Elements
- Detailed labels on each block (e.g., "ClientConfiguration", "ExternalTaskSubscription", "QuarkusCamundaExternalTaskClientProcessor").

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Runtime (Core Extension)"
        RT1["ClientConfiguration"]:::runtime
        RT2["ExternalTaskClient Creation"]:::runtime
        RT3["ExternalTaskSubscription"]:::runtime
        RT4["HandlerSubscriber"]:::runtime
    end

    subgraph "Deployment Module"
        D1["QuarkusCamundaExternalTaskClientProcessor"]:::deployment
    end

    subgraph "Example Applications"
        E1["Example Engine"]:::example
        E2["Example Worker"]:::example
    end

    EC["Camunda BPM Engine"]:::external

    D1 -->|"initializes"| RT1
    D1 -->|"configures"| RT2
    RT1 -->|"configures"| RT2
    RT2 -->|"calls"| EC
    RT3 -->|"registers"| RT4
    RT3 -->|"discovers"| E2
    E1 -->|"integrates"| RT2

    classDef runtime fill:#e0f7fa,stroke:#006064,stroke-width:2px;
    classDef deployment fill:#ffecb3,stroke:#ff9800,stroke-width:2px;
    classDef example fill:#dcedc8,stroke:#558b2f,stroke-width:2px;
    classDef external fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px;

    click RT1 "https://github.com/viadee/quarkus-camunda-external-task-client/blob/main/runtime/src/main/java/de/viadee/camunda/extension/ClientConfiguration.java"
    click RT2 "https://github.com/viadee/quarkus-camunda-external-task-client/blob/main/runtime/src/main/java/de/viadee/camunda/extension/ExternalTaskClientCreationRecorder.java"
    click RT3 "https://github.com/viadee/quarkus-camunda-external-task-client/blob/main/runtime/src/main/java/de/viadee/camunda/extension/ExternalTaskSubscription.java"
    click RT4 "https://github.com/viadee/quarkus-camunda-external-task-client/blob/main/runtime/src/main/java/de/viadee/camunda/extension/HandlerSubscriber.java"
    click D1 "https://github.com/viadee/quarkus-camunda-external-task-client/blob/main/deployment/src/main/java/de/viadee/quarkus/camunda/external/task/client/deployment/QuarkusCamundaExternalTaskClientProcessor.java"
    click E1 "https://github.com/viadee/quarkus-camunda-external-task-client/tree/main/example/example-engine"
    click E2 "https://github.com/viadee/quarkus-camunda-external-task-client/tree/main/example/example-worker"
```
