Codegen workflow

Step 5/7 · 20 min · Intermediate

4H integrations start from a FIX profile (ROE + .spec XML), not from hand-written tag numbers in application code.

Pipeline

ROE.md  →  lucid.spec / examplebank.spec  →  validate  →  codegen  →  *.jar bindings

Commands in the package

# Validate structure and dictionary references
./bin/4h-validate-spec --strict path/to/profile.spec

# Generate Java sources / JAR (profile name varies)
./bin/4h-codegen --spec path/to/profile.spec --out generated/

Exact flags match your package VERSION — run with --help if unsure.

What codegen gives you

  • Typed getters/setters for messages defined in the spec
  • Repeating group helpers (critical for ExampleBank quotes)
  • Compile-time field names instead of magic set(55, …) strings

Typical workflow for a new counterparty

  1. Write or adapt ROE (message set, constraints, comp IDs)
  2. Author spec XML aligned with ROE
  3. Validate before codegen — fix errors early
  4. Codegen → add generated JAR to classpath
  5. Wire SessionManager + application callbacks using generated types

When things break

Symptom Check
Validate fails on group ROE vs spec mismatch on NoQuoteEntries style tags
Compile errors after regen Application code used removed custom tags
Runtime reject on 55 Symbol format in ROE vs what venue expects

Next steps