← All examples

EXAMPLE 04 · Runnable example

Add processing to an existing application

You can evaluate generated event processing inside an application you already operate. This example uses a small Java host that owns the processor lifecycle and reads each decision without a separate Mongoose service.

4 valid orders checked · Invalid input refused · Closed host refuses events

Synthetic demonstration with recorded results, not a customer case study. Reports require no registration.

SUGGESTED TEAM WORKFLOW

From a processor to an application-owned runtime

How your team can use the tools, with an owner and an output at each stage. The recorded demonstration is documented separately below.

This example embeds processing in a plain Java host. It checks lifecycle and outcomes; it does not run Mongoose or retain an audit bundle.

From a processor to an application-owned runtime1. Choose the boundary: Deployment responsibilities. 2. Embed the processor: Host + processor integration. 3. Own the lifecycle: Controlled execution. 4. Check the boundary: Observed test results. 5. Package for testing: Build + test report1. APPLICATION TEAMChoose the boundaryKeep the existing applicationin charge of hostingDeployment responsibilities2. DEVELOPER + LLMEmbed the processorUse the generated buildConnect inputs and outputsHost + processor integration3. APPLICATION HOSTOwn the lifecycleInitialize and startSerialize event calls; stopControlled execution4. TESTS + REVIEWERCheck the boundaryExercise invalid inputsrecovery and use after closeObserved test results5. APPLICATION TEAMPackage for testingLabel the host and processorShare settings and testsBuild + test reportPeople guide intent and approve changes. Each handoff carries the context needed for the next check.From a processor to an application-owned runtime1. Choose the boundary: Deployment responsibilities. 2. Embed the processor: Host + processor integration. 3. Own the lifecycle: Controlled execution. 4. Check the boundary: Observed test results. 5. Package for testing: Build + test report1. APPLICATION TEAMChoose the boundaryKeep the existing applicationin charge of hostingDeployment responsibilities2. DEVELOPER + LLMEmbed the processorUse the generated buildConnect inputs and outputsHost + processor integration3. APPLICATION HOSTOwn the lifecycleInitialize and startSerialize event calls; stopControlled execution4. TESTS + REVIEWERCheck the boundaryExercise invalid inputsrecovery and use after closeObserved test results5. APPLICATION TEAMPackage for testingLabel the host and processorShare settings and testsBuild + test report
Follow the same application from the initial question to a versioned handoff. Return to an earlier step when a check reveals a gap.
  1. Choose the boundary

    Decide where the generated processor fits into the existing application. Agree who owns configuration, inputs, outputs and lifecycle.

  2. Embed the processor

    Place the generated processor in the host. Connect its inputs and results through a small explicit boundary that can be tested without a hosted compiler call.

  3. Own the lifecycle

    The host starts the processor, controls access to its state and shuts it down. It must not make unsynchronized concurrent calls into a running processor.

  4. Check the boundary

    Check valid and refused inputs, a successful event after refusal, and refusal after the host closes. The supplied fixture records these outcomes in its test report.

  5. Package for testing

    Give the versioned host, processor and tests to the next reviewer. Configure production capture separately if the deployment needs audit investigations and evidence bundles.

The problem

Incremental adoption needs clear boundaries: who starts and stops the processor, how events reach it, how results return to the host, and what happens after invalid input or shutdown.

What was done in this recorded example · 4 stages
  1. Start under host ownership

    A plain Java application creates, initializes and starts the generated processor.

  2. Submit an order

    The host serializes access and supplies an explicit quantity, price and limit snapshot.

  3. Read and check the outcome

    The host receives rejected, accepted and rejected results, refuses an invalid input, then accepts a valid boundary case.

  4. Close the boundary

    The host stops and tears down the processor. A later submission is refused.

People review the rule and host boundary. Fluxtion supplies the generated coordination. The host serialises access and controls lifecycle. Where an investigation is needed, configured audit records can be paired with graph and source in the Analyser. Mongoose is an optional operating model for feeds, services and lifecycle integration.

The host handles a sequence, rejects invalid input and closes cleanly.

The host receives REJECTED, ACCEPTED and REJECTED for three successive orders. A zero-quantity order is refused; a later equality case is accepted. After the host closes, another submission is refused. The run uses the included generated processor and runtime JAR, with no Mongoose service or generation request.

Observed in the supplied synthetic fixture
Case or componentRecorded result
Sequential ordersREJECTED / ACCEPTED / REJECTED
Zero quantityRefused before dispatch
Next valid boundary orderACCEPTED
Submission after closeRefused by host

Why this matters

This fixture shows a concrete incremental adoption boundary: an existing Java host owns lifecycle and receives synchronous decisions. The demonstration works without a separate Mongoose service; the right production operating model can be assessed in a pilot.

Apply it to your process

Choose an existing event boundary and define a small integration slice. Evaluate lifecycle ownership, backpressure, error handling, state and observability in the real host before choosing whether embedded operation or Mongoose is the better fit.

See the five-stage pilot journey
Technical appendix: reproduce the result and inspect the files

Run this example

Reproduction prerequisites

Use Python 3 and JDK 21. Download the public, version-pinned runtime below; no account or compiler credit is required for this download or these reproduction runs.

Download fluxtion-runtime 1.1.3 · Published Maven metadata

Maven coordinates: com.telamin.fluxtion:fluxtion-runtime:1.1.3.

The runtime’s published metadata declares AGPL-3.0. Its terms are separate from the example code’s Apache 2.0 licence. See the published licence and product licensing.

Download into the unzipped example directory:

curl -fL https://repo.repsy.io/mvn/fluxtion/fluxtion-public/com/telamin/fluxtion/fluxtion-runtime/1.1.3/fluxtion-runtime-1.1.3.jar \
  -o fluxtion-runtime-1.1.3.jar

Expected SHA-256 (the runner checks this before compiling):

2bd45eb62409403422d5a676a7ad177f1984aa80dc399c20ceb6b467eab4b775

Unzip the host reproduction package, then run from its embedded-host directory. The sibling order-check tree supplies the processor and host class:

Download this example’s source and reproduction package

python3 run.py \
  --runtime ./fluxtion-runtime-1.1.3.jar \
  --out results

The runner verifies the runtime hash, compiles the supplied processor and host, then checks the host lifecycle and sequential decisions. It captures the summary, portable commands and source hashes. No generation, model or Mongoose service is called.

The host deliberately discards audit output; the other examples’ audit records are separate executions. See the README for this boundary and the included demo licence.

This runner builds the released generated source. Upstream describes compiler 1.0.83; this example does not require a generation call.

Captured files

Detailed walkthrough

  1. Construct the processor

    EmbeddedHost creates the included OrderLimitProcessor, then calls init and start. It owns that instance for the lifetime of the host.

  2. Send an explicit input

    The host constructs an Order with quantity, unit price and a limit snapshot, then passes it to onEvent. This fixture performs no live database or network lookup.

  3. Read the result

    After the event returns, the host reads the Decision node's outcome. It is a synchronous integration boundary for this sample, not a promise about all possible component behaviours.

  4. Control concurrent access

    The host serialises decide and close calls with synchronized methods. The sample does not dispatch concurrent events into a shared processor. A production host must choose its queueing, scheduling and state ownership deliberately.

  5. Exercise rejection and recovery

    A sequence changes the supplied limit between orders. A bad input fails before dispatch. The next valid order is checked to establish that this refusal did not damage subsequent processing.

  6. Stop under host ownership

    close calls stop and tearDown once. A later submission throws an IllegalStateException. The sample does not claim graceful draining, persistence or recovery after a process crash.

Scope and interpretation

  • A minimal Java host and synthetic inputs, not integration into a customer application.
  • No latency, throughput, memory, crash-recovery or GraalVM-native result is reported. The capture suite and embedded-host suite are separate runs.
  • Generation entitlements, runtime licensing and production or redistribution rights remain separate; technical independence from the hosted compiler does not determine those rights.

Example code is released under Apache 2.0. Runtime, third-party and general customer-output terms remain separate. Member hashes compare bytes; they do not certify a business decision.

Read and download
No registration. Pages, PDFs and source package are public for released examples.
Run the supplied code
No Telamin sign-in. Python 3, JDK 21 and the separately supplied runtime 1.1.3 JAR.
Use the playground
Pre-generated order example runs signed out. Its code editor is best on a desktop or laptop. The first run downloads a Java runtime.
Generate or interpret
Your own processor requires sign-in and allowance. Review data flows and licensing before generating.

Continue exploring

The reuse example connects stock, value, limit and risk checks from two separately packaged libraries.

Reuse component libraries

ONE WORKFLOW. A REVIEWABLE RESULT.

Discuss a pilot on your process.

Bring the workflow owner, a representative process and the constraints that matter. We will agree what the evaluation should establish.

Discuss a pilot