Skip to content

TIE 0.5.0

Choose a tag to compare

@themarioga themarioga released this 09 Nov 16:22
· 10 commits to main since this release

Definitions can now be written back as JSON or YAML, and fields can compute their value with an expression. Programmable fields come with a new optional module, tie-jexl. Without expressions, 0.5.0 behaves like 0.4.0.

Added

  • DefinitionWriter.toJson / toYaml: a definition built with the Java API, or loaded, written as the document DefinitionLoader reads back.
    • The definition is validated first.
    • Keys follow the schema order and defaults are left out, so equal definitions give the same text.
    • Literal credentials are written as ***.
  • Programmable fields: expression on a field computes its final value.
    • On import, expressions run after the other steps of every field, in declaration order. They see value, the other fields, the parent record (parent, parent.parent), today and the context variables. The result is converted to the field's type and validated.
    • On export, they run over the supplied values.
    • New SPI ExpressionEngine (Tie.Builder.expressionEngine) and line error code EXPRESSION_FAILED.
  • New module tie-jexl: JexlExpressionEngine, with Apache Commons JEXL in a restricted sandbox:
    • no class access, loops, new or side effects;
    • misspelt names are errors;
    • functions tie:age, tie:years, tie:blank, tie:date, tie:format and tie:coalesce.
  • Spring Boot starter: registers a JexlExpressionEngine when tie-jexl is on the classpath.
fields:
  - { name: birthDate, type: DATE }
  - name: idDocument
    expression: "value != null ? value : (tie:age(birthDate) < 16 ? parent.idDocument : null)"
Tie tie = Tie.builder().expressionEngine(new JexlExpressionEngine()).build();
String yaml = DefinitionWriter.toYaml(definition);

Changed

  • FieldDefinition has a new expression component, so its canonical constructor changed. The builder is unaffected.
  • A credential equal to ***, what DefinitionWriter writes for a literal one, is now a configuration problem.
  • copyFrom of a field with an expression is now a configuration problem.

Artifacts

Artifact
io.github.tie-integration-engine:tie-core:0.5.0 The library
io.github.tie-integration-engine:tie-jexl:0.5.0 Optional programmable fields with Apache Commons JEXL (new)
io.github.tie-integration-engine:tie-spring-boot-starter:0.5.0 Optional Spring Boot 4 auto-configuration

Available on Maven Central:

<dependency>
    <groupId>io.github.tie-integration-engine</groupId>
    <artifactId>tie-core</artifactId>
    <version>0.5.0</version>
</dependency>

The jars, with their sources and javadoc, are attached below. Requires Java 25.

Documentation