Claus Ibsen created CAMEL-24714:
-----------------------------------
Summary: camel-core-model - mark the expression properties
evaluated as predicates (filter, when, validate, ...) with @Metadata(predicate
= true) and in the catalog JSON
Key: CAMEL-24714
URL: https://issues.apache.org/jira/browse/CAMEL-24714
Project: Camel
Issue Type: Improvement
Components: camel-catalog, camel-core
Reporter: Claus Ibsen
Nothing in the model or the catalog says whether an EIP's expression is
evaluated as a predicate or as an expression: the JSON for filter, when,
validate and split is identical apart from the description text ("The predicate
expression to evaluate..."). The only place the difference exists is the
reifier, which calls createPredicate for filter, when (choice), validate, loop
(doWhile), aggregate (completion predicate), the onWhen, handled, continued and
retryWhile of onException and onCompletion, catch (onWhen), intercept,
interceptFrom and interceptSendToEndpoint (when), and createExpression
everywhere else.
Tooling needs to know: the YAML validator and the write-time Simple check
(CAMEL-24698) validate a simple: value as a predicate or an expression
depending on the EIP, from a hardcoded list; Kaoto, the docs and the sample
tool have the same question.
Mark it in the model, per property, as required is since CAMEL-24707:
* a boolean predicate() on @Metadata (default false), set on the expression
properties the reifier evaluates as predicates (the createPredicate sites above
are the list)
* the package plugin writes "predicate": true into the property in the catalog
models/*.json, next to "kind": "expression"
* the YAML validator, SourceValidator's Simple check and camel_catalog_sample
read it from the catalog instead of a list
* a test that every property annotated predicate = true is one the reifier
evaluates with createPredicate, so the annotation and the runtime cannot drift
apart
Discussed with Claus on 2026-09-13 while reviewing PR 26379.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)