Skip to content
Development preview · 2.0.0-SNAPSHOT

From a definition to an executable process

Two invocations processing orders A-42 and A-43 can use the same definition. They share its steps and connections, while each has its own input, variables, and current execution position. The reusable process plan and an invocation’s execution state are separate.

TBBPM and BPMN both express actions, conditions, and branches, but their XML and some execution rules differ. CompileFlow translates each definition according to its format’s rules into a shared process plan. Each backend executes the behavior in that plan without interpreting the XML again.

Process or architecture diagram

compileflow-tbbpm and compileflow-bpmn each read their format’s model, validate it, and supply a ProcessSemanticCompilerProvider that converts nodes and expressions into a ProcessSemanticPlan. The plan describes nodes, expressions, and control flow without making each executor interpret both XML formats. It is a static description; the current position and variable values for an individual invocation are execution state, managed by the backend. Definition loading enforces byte limits before parsing. The shared XML parser disables DTD support and external entities.

compileflow-core starts the engine, reads definitions within size limits, and uses StructuredControlFlowAnalyzer to analyze branches, joins, and loops. The resulting StructuredControlFlowPlan and semantic plan are immutable and shared by the execution backends.

The default compiled backend generates Java. The interpreted backend executes the same plans. Durable also saves the state needed to continue. Preflight, warm-up, source generation, and first execution follow the same rules but perform different amounts of preparation. The engine caches generated classes and bytecode; applications use public APIs rather than those classes or parser models.

For example, a parallel gateway can split an order process into stock and shipping-price lookups. If the next step needs both results, a parallel join brings those paths back together. CompileFlow keeps each concurrent branch’s variables and other execution state in a separate frame. After the branches join, their shared next step runs once.

A gateway with one incoming transition and several outgoing transitions splits execution. One with several incoming transitions and one outgoing transition joins branches. A parallel or inclusive gateway cannot do both: use a join followed by a split. An exclusive gateway may combine a merge and a decision; each arrival selects one outgoing path without synchronizing concurrent branches. Other node types cannot introduce multiple branches.

Parallel and inclusive branches must rejoin through a gateway of the same type. No additional join gateway is required when every branch finishes at an End node without a shared subsequent step. The analyzer uses dominance and post-dominance to identify where each branch begins, which nodes it contains, and where it joins. Preflight rejects unreachable nodes, cross-container edges, ambiguous joins, overlapping regions, and unsupported nested concurrency.

An exclusive gateway selects one branch. Parallel and inclusive gateways follow their respective selection and merge rules, which are defined in the format specifications.

A fresh execution accepts only declared param variables, with defaults applied to omitted parameters. return and inner variables are not fresh-execution inputs. A trigger starts a new invocation from supplied declared state, which can include param, return, and inner variables. Durable continues an existing Run from a committed checkpoint.

Durable saves the exact source bytes and model type so recovery can choose the correct parser. After parsing, the machine, continuation, Turn, Wait, Timer, and Effect use the shared plans. Durable runtime code does not depend on TBBPM or BPMN implementation packages, and machine generation does not select behavior by model type. Format frontends likewise do not depend on Durable. Each frontend works with supported execution APIs and Store Providers.

TBBPM is CompileFlow’s compact native format. BPMN supports only the documented executable subset of BPMN 2.0: the executable subset and its additional constraints are defined by the format reference. CompileFlow-specific data uses the cf: namespace. Valid BPMN syntax alone does not make a file executable in CompileFlow. Unsupported collaboration, compensation, human-task, and other out-of-profile elements fail validation.

For ordinary ProcessEngine calls, both formats use the same Action policy rules:

  • maxAttempts: integer, 1..100.
  • backoffMultiplier: finite double, >= 1.0.
  • Duration settings use whole-millisecond ISO-8601 duration values.
  • An ordinary Action has at most one policy element, invocationPolicy. Durable Effect recovery uses a separate policy.
  • Timeout cancellation is cooperative.
  • Java Error instances, including AssertionError, are never retried.

Durable distinguishes replayable and effect Actions by their recovery behavior. Effect recovery uses effectPolicy; Durable rejects non-default synchronous invocationPolicy settings.

Recognizing an element in the parser is only the first step. The implementation also needs syntax rules, validation, and execution behavior in the shared plan. Attributes must not be silently ignored, and generated code must perform the operations specified by that plan.

Use these documents to locate the rules:

Topic Definition
TBBPM syntax and semantics TBBPM specification and TBBPM.xsd
BPMN extension syntax and semantics BPMN extension specification and CompileFlowBpmnExtensions.xsd
Supported nodes Node support
Correspondence between formats Process format reference
Parser and schema registration checks scripts/check_spec_impl_parity.py

See Execution flow for runtime behavior, Supported surfaces for application APIs, and the Extension guide for supported extension points.