02 From Need To Running Integration

From Business Need To Running Integration

This page is the whole way once, from a business need to an integration that runs in production, with the question each step answers, what it produces, where that lives and who does it. The pages after it go into the steps that the business and the architect own. The same way is followed for a change to an existing integration.

Two ideas hold it together:

  • The solution is the anchor. A need becomes a solution with an id such as KLK010, written down in a solution document before any code. Every part that implements it carries the id as the start of its name, so the need, the design, the code, the topics, the deployment and the logs can always be traced to each other.
  • Information comes before transport. What the information is, who owns it and who needs it is decided before anyone decides how it travels.

The Steps

Step The question What it produces, and where it lives Who
1. Need What must the business achieve, for whom, how much and how soon? The business need and the service levels, which become sections 1 and 9 of the solution document Project manager, business developer or product owner
2. What exists What can be reused, and what has to be built? The reuse analysis and the services by kind, sections 4 and 6 The architect, with Kloker; the business confirms
3. Solution Which business flow is this, and which systems take part? A solution id and its document in the organisation's integration-solutions repository The architect writes, the business approves
4. Information Which information, owned by whom, read by whom, meaning what? A datamodel for each kind of information, with its class: section 5 and the datamodel's own repository The business owns the meaning, the architect and the owning domain the model
5. Integration design Which legs, patterns, topics, purposes and access? The legs, the flows, the security and the tactical decisions: sections 7, 8, 10 and 11 The architect
6. Review Can someone else explain, build and operate this? The approved merge request of the solution document Everyone who owns a part
7. Build Datamodels and routes in merge requests, each with its documentation, and the solution document kept up to date Developers, and Kloker on well-defined pieces of work
8. Provision Topics, access grants, the service's identity, its secrets and its deployment manifest Tenant and domain admins, and platform staff
9. Merge and release The merge requests merged in order; each release waits for the result of the one it depends on The people allowed to merge
10. Run and verify Does it do what was asked? A running service, verified; its legs are no longer marked planned Developers verify, the business accepts
11. Change The same way again, starting from the solution Everyone

1. The Need

The need is written in business language: the problem today, the outcome wanted, the systems and their owners, the volumes, and how fresh, available and recoverable the information must be. It is the input to everything that follows, and its unknowns are written down as open questions rather than guessed. Describing The Business Need has the template.

2. What Exists

Before anything is designed, the architect checks what the landscape already has: solutions, systems, datamodels, topics, services and the platform's own capabilities. Kloker helps with this analysis. The result says, for every service the solution needs, whether it is new, an existing one reused as it is, an existing one that needs a small change, or new routes in an existing project. Finding What Already Exists describes where to look and how to decide.

3. The Solution

The solution gets its id and its document before the first line of code. The document lives in the organisation's integration-solutions repository in GitLab, as solutions/<SOLUTIONID>_<slug>/README.md with a small descriptor solution.meta.json next to it, and klok.dev lists it under Build → Solutions. The id is the prefix of every route id of the solution, which is what lets the platform tie code and documentation together. Reviewing A Solution Document goes through its sections.

4. The Information

Each kind of information the need is about gets a datamodel: an agreed description, owned by a domain, that every leg uses on the broker. Information that several systems or domains read travels in a shared model, never in one system's own format, so that a system can be replaced without touching the others. From Business Need To Information Needs is the business side of this step, and Creating A Datamodel the technical side.

5. The Integration Design

The architect splits each flow into legs (ingress, processing, egress, API, timer), chooses a pattern for each, decides the topics and their purposes, and decides who may publish and read what. Choices that deviate from the standard are written down as tactical decisions, with their cost and the condition for removing them. The architect's part is described in From Requirement To Design.

6. Review Before Code

The solution document is reviewed as a merge request: the business checks the business sections, the architect and the developers check the design, and the domain owners check the information. A leg that is not built yet is marked planned in the document. Nothing is built from a design nobody has approved.

7. Build

Developers build the datamodels and the routes in their own repositories, each change in a merge request that also updates the project's documentation and, when a leg changes, the solution document. Kloker can implement well-defined pieces of work as merge requests that a developer reviews. The framework adds retries, dead letters, logging and the correlation id to every route, so the code is mostly the business's own transformation.

8. Provision

A service needs things outside its code before it can run. Today they are set up by people:

What Who How
The topics the service uses, and access to read another domain's or organisation's topic The developer requests, the owning domain's DomainAdmin or the TenantAdmin approves In klok.dev, Broker → Requests, or as a merge request to the tenant's broker file in Git (Topics On The Klok Broker)
The service's own identity on the broker Platform staff A merge request in klok/environment/klok-environment-setup, applied with Ansible
The service's secrets Platform staff Written in Vault
The deployment manifest Platform staff, or the developer in a merge request The tenant's manifests repository, <tenant>/environment/<tenant>-deploy-manifests, which Argo CD applies

What a new project needs before its first deployment is listed in Onboarding A Tenant, section New Integration Project.

9. Merge And Release

Merging is always done by a person. The order matters when one change depends on another: a datamodel is merged before the code that uses it, and the solution document is merged before the legs it describes. A merge only starts a pipeline, so the next step waits for that pipeline's result, not for the merge:

A step needs Wait until
A new or changed datamodel its version is in the dependency catalog (the catalog records each release as a commit)
A topic or an access grant the request in klok.dev is applied
A new version of a service in production the service's pipeline on main has updated its deployment manifest in the tenant's manifests repository, and Argo CD has rolled it out

Pipelines on main may run in parallel, so a merge that happened first is not necessarily released first. How a release works is in Publishing And Release Flow.

10. Run And Verify

When a service starts, the framework checks that every topic it needs exists and that the service may use it; from klok-quarkus-extension 3.14.0 the routes that miss one are held and the rest of the service runs, an older extension version does not start at all, and either way its log says what to request (Topics On The Klok Broker). Once it runs, the developers verify on Run → Broker that messages flow and that nothing lands among the dead letters, and on Run → Process runs that the runs of a long-running process finish, and on Run → Logs they follow one business transaction through every leg it passed (Logs; klok.dev follows tenant klok's transactions today, and every tenant's is frontend-klok-dev#51). The business then checks the result with real cases. When a leg is on main and running, its planned marking is removed from the solution document. Following Delivery And Operation describes this from the business side.

11. Change

A change to an existing integration takes the same way, starting from its solution: the route id's prefix names the solution, its document says why the integration exists and how it is built, and the change request is written against it. A change that alters a leg's contract (a topic, a purpose, a datamodel, an API) updates the solution document in the same change as the code, so the document keeps describing what is built and deployed.

The Reference Example

Solution KLK010 Personnel Scheduling Services follows this way and is the example to copy. Its solution document shows each step:

Step In KLK010
Need A municipality keeps employments in its payroll system and schedules in its scheduling system. Every employment was registered twice and every worked shift was typed into payroll by hand, which caused pay errors.
Flows Employments from payroll to scheduling; worked schedule and absence from scheduling to payroll; substitute bookings from scheduling to payroll.
Information One domain datamodel, PersonnelScheduling_v1 (class C, domain HR), with three message types. It is neither system's format, and it carries three business rules: the scheduling side resolves where absence overlaps a shift, local times state their time zone, and a value filled in by default says so.
Design Everything that speaks to the payroll system is in its own projects, everything that speaks to the scheduling system in others, and the two sides meet only in the datamodel on the broker.
Topics When each municipality runs in its own tenant, the municipality publishes the employments in its own namespace and the scheduling vendor reads them with a consume grant that the municipality approves.

KLK008 AI Image Generation is the reference for a shared platform service, and has every section of a solution document.