# trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1 architecture

> Architecture diagram of the GitHub repository trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1
- Repository: https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1

## Overview

##### Project type and purpose
- This is a mid-level shared library repository for IBM App Connect Enterprise (ACE).
- It provides a reusable subflow (AddHTTPHeader) implemented in ESQL, and relies on a lower-level Java submodule.
- It includes both unit tests and contract tests, and is intended to be consumed by a “real” ACE application (App1).

##### File structure
- Top-level:
- .github/workflows/ace-ci.yml → GitHub Actions CI pipeline
- build-and-ut.sh, build-and-run-contract-tests.sh → Local build/test drivers
- SubflowLibLevel1/… → The actual ESQL subflow library project
- ace-submodule-javalib-level1 (git submodule) → Java helper library
- SubflowLibLevel1_ScaffoldApp/… → A minimal ACE app that imports the library for testing
- SubflowLibLevel1_UnitTest/… → JUnit-style unit tests invoking the scaffold
- SubflowLibLevel1_ContractTest/… → Contract tests using sample input/output from the real app
- Pattern: a mono-repo of multiple Eclipse/ACE projects (the library, scaffold app, test projects).

##### README for additional insights
- Confirms multi-repo hierarchy: App1 ← SubflowLibLevel1 ← JavaLibLevel1
- Tests ensure both library correctness and interface stability from the consumer’s POV.
- CI automates build + all tests via GitHub Actions.

##### Components
a. Main components
- SubflowLibLevel1 (ESQL subflow library)
- Java library submodule (ace-submodule-javalib-level1)
- ScaffoldApp (instantiates the subflow)
- UnitTest project
- ContractTest project
- CI Pipeline (GitHub Actions)
b. Relationships and interactions
- SubflowLibLevel1 depends on JavaLibLevel1.
- ScaffoldApp imports SubflowLibLevel1 (and transitively JavaLibLevel1).
- UnitTest and ContractTest both launch flows in ScaffoldApp to exercise the subflow.
- build-and-ut.sh builds the library and runs UnitTest; build-and-run-contract-tests.sh runs ContractTest.
- CI workflow triggers both scripts on PR.
c. Architectural patterns / principles
- Modular subflow library enabling reuse across multiple ACE apps.
- Test-driven approach: scaffold app for isolation, contract tests for integration stability.
- Git submodules for multi-repo dependency management.
d. Relevant technologies
- IBM App Connect Enterprise (message flow, ESQL compute node)
- Java (for auxiliary logic)
- Maven/Gradle or shell scripts (build-and-ut.sh)
- JUnit (for UnitTest, ContractTest)
- GitHub Actions (CI)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Library components
    subgraph "Library Layer"
        direction TB
        JavaLib["JavaLibLevel1"]:::library
        SubflowLib["SubflowLibLevel1"]:::library
        ScaffoldApp["ScaffoldApp"]:::library
    end

    %% Test harnesses
    subgraph "Test Harnesses"
        direction TB
        UnitTest["UnitTest"]:::test
        ContractTest["ContractTest"]:::test
    end

    %% CI Infrastructure
    subgraph "CI / Scripts"
        direction TB
        CIPipeline["CI Pipeline"]:::ci
        BuildUT["build-and-ut.sh"]:::ci
        BuildCT["build-and-run-contract-tests.sh"]:::ci
    end

    %% Dependencies and flows
    JavaLib -->|"git submodule"| SubflowLib
    SubflowLib -->|"imports .subflow/.esql"| ScaffoldApp
    ScaffoldApp -->|"executes AddHTTPHeader"| UnitTest
    ScaffoldApp -->|"executes AddHTTPHeader"| ContractTest

    CIPipeline -->|"triggers"| BuildUT
    CIPipeline -->|"triggers"| BuildCT

    BuildUT -->|"builds lib and runs"| SubflowLib
    BuildUT -->|"runs"| UnitTest

    BuildCT -->|"runs"| ContractTest

    %% Click Events
    click JavaLib "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/tree/main/ace-submodule-javalib-level1/"
    click SubflowLib "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/SubflowLibLevel1/library.descriptor"
    click ScaffoldApp "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/SubflowLibLevel1_ScaffoldApp/application.descriptor"
    click UnitTest "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/SubflowLibLevel1_UnitTest/testproject.descriptor"
    click ContractTest "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/SubflowLibLevel1_ContractTest/testproject.descriptor"
    click CIPipeline "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/.github/workflows/ace-ci.yml"
    click BuildUT "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/build-and-ut.sh"
    click BuildCT "https://github.com/trevor-dolby-at-ibm-com/ace-submodule-subflowlib-level1/blob/main/build-and-run-contract-tests.sh"

    %% Styles
    classDef library fill:#D0E6FF,stroke:#0366d6,stroke-width:1px
    classDef test fill:#DFFFD6,stroke:#28a745,stroke-width:1px
    classDef ci fill:#FFE8D6,stroke:#d73a49,stroke-width:1px
```
