[
https://issues.apache.org/jira/browse/CAMEL-4809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13178955#comment-13178955
]
Raul Kripalani commented on CAMEL-4809:
---------------------------------------
In order to detect if the ChoiceProcessor matched any of its clauses without
having to evaluate all predicates again, I added a new property
{{Exchange.LAST_MATCHING_CLAUSE}}. The ChoiceProcessor will set the value of
this property in the Exchange depending on the outcome of the evaluation:
* If a {{when}} is matched, its index will be stored
* If the {{otherwise}} is executed, then the string 'OTHERWISE' will be stored
* If no {{when}} is matched and no {{otherwise}} exists, the property will not
exist
I guess this feature will be useful in scenarios other than this particular
one, even for the end user. So it could get documented in the choice DSL page
too.
> interceptSendToEndpoint with predicate and skip
> -----------------------------------------------
>
> Key: CAMEL-4809
> URL: https://issues.apache.org/jira/browse/CAMEL-4809
> Project: Camel
> Issue Type: Improvement
> Components: camel-core, camel-spring
> Reporter: Raul Kripalani
> Attachments: interceptSendToEndpointConditionalSkip.diff,
> test-interceptor.xml
>
>
> The <when> clause in the interceptors behave like filters. This is okay with
> intercept and interceptFrom, where the only possible route manipulation is
> <stop />, which is expressed inside the routing block.
> However, with interceptSendToEndpoint there is one edge case that could cause
> ambiguity. When skipSendToEndpoint=true, along with a <when> clause, the user
> might expect that the skipping will only occur if the condition is met.
> However, it occurs always. The <when /> only determines whether the routing
> logic contained inside the body of the intercept block will occur or not.
> I propose to add a new attribute onlySkipWhenConditionMet, so that when this
> is true, the <when> clause will be evaluated to determine if the originally
> intended endpoint is actually skipped or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira