luigidemasi commented on code in PR #26813:
URL: https://github.com/apache/camel/pull/26813#discussion_r4091901593


##########
core/camel-core-model/src/main/java/org/apache/camel/model/ChoiceDefinition.java:
##########
@@ -45,10 +47,14 @@
           description = "Routes messages to different steps based on a series 
of conditions (predicates),"
                         + " similar to if-elseif-else in Java. Each condition 
is evaluated in order until one matches.")
 @XmlRootElement(name = "choice")
-@XmlType(propOrder = { "whenClauses", "otherwise" })
+@XmlType(propOrder = { "selector", "whenClauses", "otherwise" })
 @XmlAccessorType(XmlAccessType.FIELD)
 public class ChoiceDefinition extends NoOutputDefinition<ChoiceDefinition> {
 
+    @XmlElement
+    @Metadata(description = "Expression evaluated once per entry into this 
choice. Its String result is matched against literal when values. Cannot be 
combined with precondition mode or predicate branches.")
+    @DslArg
+    private ExpressionSubElementDefinition selector;

Review Comment:
   Removed in 7c10c75e1bf5. Category evaluation now uses Set Property/Set 
Header followed by ordinary Choice predicates. The core EIP model, Choice 
runtime, serializers, metadata and schemas match the original base. Tests cover 
one evaluation per step, first/later/otherwise branches and reevaluation after 
changed input in a loop.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._



##########
core/camel-core-model/src/main/java/org/apache/camel/model/BasicExpressionNode.java:
##########
@@ -36,7 +36,7 @@ public abstract class BasicExpressionNode<T extends 
BasicExpressionNode<T>> exte
 
     @Metadata(required = true,
               description = "Expression used as the predicate to evaluate 
whether this when should trigger and route the message or not.")
-    @XmlElementRef
+    @XmlElementRef(required = false)

Review Comment:
   Restored in 7c10c75e1bf5, including `@XmlElementRef(required = true)`. Both 
XML schemas and the Choice/When YAML definitions match the original base; 
`when` continues to require its expression.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._



##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/ChoiceProcessor.java:
##########
@@ -71,7 +97,7 @@ public boolean process(final Exchange exchange, final 
AsyncCallback callback) {
             // as we should only pick one processor
             boolean matches = false;
             try {
-                matches = filter.matches(exchange);
+                matches = (selector == null || values.get(i).equals(selected)) 
&& filter.matches(exchange);

Review Comment:
   The selector path is removed in 7c10c75e1bf5. `ChoiceProcessor` matches the 
original base, including its predicate evaluation, stream-cache handling and 
branch counters. Category results are stored before entering the existing 
Choice processor.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._



##########
dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/pom.xml:
##########
@@ -38,6 +38,10 @@
     </properties>
 
     <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-semantic</artifactId>

Review Comment:
   Fixed in 7c10c75e1bf5. `camel-yaml-dsl-deserializers` has no semantic 
dependency or semantic-specific resolver case. `camel-semantic` contributes its 
resolver through the existing provider SPI and declares YAML-common as 
optional. A default resolver preparse callback prepares whole-resource 
declarations before routes, including clearing definitions for a valid empty 
sequence on reload. Schema generation uses a build-plugin dependency.
   
   Isolated consumer runs confirm that ordinary YAML routes run without 
`camel-semantic`, and semantic predicates run without YAML or SnakeYAML. 
Declaration ordering, cross-resource references, deletion/rename reload, schema 
and completion tests pass.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._



##########
core/camel-api/src/main/java/org/apache/camel/spi/PropertyConfigurer.java:
##########
@@ -37,6 +37,24 @@
  */
 public interface PropertyConfigurer {
 
+    /**
+     * Optionally binds a value before resolving bean or class references. 
Property placeholders are resolved before
+     * this call when placeholder resolution was requested by the caller. This 
allows an option that owns reference
+     * resolution and lifecycle to retain the reference text. Returning false 
leaves the normal binding behavior
+     * unchanged.
+     *
+     * @param  camelContext the Camel context
+     * @param  target       the target instance
+     * @param  name         the property name
+     * @param  value        the value before reference resolution
+     * @param  ignoreCase   whether to ignore case for matching the property 
name
+     * @return              true if the property was configured
+     * @since               4.23
+     */
+    default boolean configureRaw(CamelContext camelContext, Object target, 
String name, Object value, boolean ignoreCase) {

Review Comment:
   Fixed in 7c10c75e1bf5. Adapter configuration now takes a plain registry bean 
name or FQCN; registry lookup has precedence. Standard property binding passes 
those strings through, so `configureRaw` and its call site are removed. Tests 
retain type checking before class construction, bean identity/lifecycle 
ownership, placeholder configuration and startup-failure cleanup. Documentation 
and the issue contract use the unprefixed names.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to