You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SoaMattH <ma...@netpacket.com.au> on 2010/01/04 23:32:16 UTC

Re: Not sure of syntax or if its possible or an example


I am just having a little difficulty on the syntax and the doco at the juel
web site 
on el is a bit light on

What I have done:

<camel:to uri="bean:receiverBean?method=processData" />
<camel:choice>
    <camel:when>
        <camel:el>{$out.body ==
'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
        <camel:to ref="incidentFilePriorProcessedEndPoint"/>
    </camel:when>
    <camel:when>
        <camel:el>{$out.body ==
'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
        <camel:to ref="incidentFileDeadLetterEndPoint"/>
    </camel:when>
    <camel:when>
        <camel:el>{$out.body ==
'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
        <camel:to ref="incidentFileDeadLetterEndPoint"/>
    </camel:when>
    <camel:otherwise>
        <camel:to ref="incidentFileProcessedEndPoint"/>
    </camel:otherwise>
</camel:choice>
        
Every thing is going through the otherwise clause so I am thinking
that I am acessing and comparing the return enum incorrectly?
Any help on syntax would be appreciated. Usuallin in JSP's you go eq rather
than ==

--Matt







Claus Ibsen-2 wrote:
> 
> Yeah
> 
> There should be a <camel:method> to call a method on a bean.
> 
> 
> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
> wrote:
>>
>>
>> I am just looking at
>> http://camel.apache.org/content-based-router.html
>> so seems like my initial thoughts were close.
>>
>> --Matt
>>
>>
>>
>> SoaMattH wrote:
>>>
>>>
>>> I am using camel 2.0.
>>> I want to call a bean as part of my xml route configuration and
>>> then evaluate where to go with somthing like:
>>>
>>> ....
>>> <camel:to uri="bean:recieverA?method=processA" />
>>> <camel:choice>
>>>     <camel:when>
>>>         <camel:el></camel:el>
>>>         <camel:to ref="EndPointA"/>
>>>     </camel:when>
>>>     <camel:when>
>>>         <camel:el></camel:el>
>>>         <camel:toref="EndPointB"/>
>>>     </camel:when>
>>> </camel:choice>
>>> .....
>>>
>>> are there any examples of how this is done ?
>>>
>>> --Matt
>>>
>>>
>>>
>>>
>>
>>
>> -----
>> /* ----------------------
>> ** Matt Hannay
>> ** Unix Java C
>> ** Software Engineer
>> ** ------------------- */
>> --
>> View this message in context:
>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020450.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Not sure of syntax or if its possible or an example

Posted by Claus Ibsen <cl...@gmail.com>.
Try with a simpler example to get the syntax correct

Maybe try
>'foo' == 'foo'</el>

To get the syntax correct.

However you can also try the Camel Simple language which can use == operator
http://camel.apache.org/simple.html

<camel:simple>${body} == 'ALLREADY_PROCESSED'</camel:simple>



On Thu, Jan 7, 2010 at 4:16 AM, SoaMattH <ma...@netpacket.com.au> wrote:
>
>
>
> SoaMattH wrote:
>>
>>
>> I have also tried
>> <camel:el>{$body == "ALLREADY_PROCESSED"}</camel:el>
>> <camel:el>{$body eq "ALLREADY_PROCESSED"}</camel:el>
>> <camel:el>{$body.equals( "ALLREADY_PROCESSED")}</camel:el>
>> <camel:el>${in.body == "ALLREADY_PROCESSED"}</camel:el>
>>
>> but still the otherwise continues to be executed ?
>>
>> Does any one have any clues?
>>
>>
>> --Matt
>>
>>
>>
>> SoaMattH wrote:
>>>
>>>
>>> Just to clarify the body is Body:ALLREADY_PROCESSED
>>>
>>>
>>> SoaMattH wrote:
>>>>
>>>>
>>>> The syntax on the el has me a little stumped?
>>>> I put some logging in to se what is in the Exchange and the two points
>>>> of interest are:
>>>>
>>>> BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
>>>> Body:ALLREADY_PROCESSED
>>>>
>>>> I have tried:
>>>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>>>     <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
>>>>     <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
>>>> And the   </camel:otherwise> is always executed .......
>>>>
>>>> What am I doing wrong in the el ?
>>>>
>>>> ....
>>>> <camel:to uri="bean:receiverFile?method=process" />
>>>> <camel:choice>
>>>>   <camel:when>
>>>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>>>     <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>   </camel:when>
>>>>   <camel:when>
>>>>     <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
>>>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>   </camel:when>
>>>>   <camel:when>
>>>>     <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
>>>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>   </camel:when>
>>>>   <camel:otherwise>
>>>>     <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
>>>>     <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>   </camel:otherwise>
>>>> </camel:choice>
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> I have also made the assumption that the return object ends up in
>>>>>> out.body is this the case?
>>>>>>
>>>>>
>>>>> You should just use ${body} in 99% of the cases as Camel uses the
>>>>> Pipes And Filters EIP pattern (pipeline) in a route when you have
>>>>> multiple steps, which you have as you got: to + choice = 2 steps. So
>>>>> the OUT from to becomes IN for the choice.
>>>>>
>>>>>
>>>>>> --Matt
>>>>>>
>>>>>>
>>>>>>
>>>>>> SoaMattH wrote:
>>>>>>>
>>>>>>>
>>>>>>> I am just having a little difficulty on the syntax and the doco at
>>>>>>> the
>>>>>>> juel web site
>>>>>>> on el is a bit light on
>>>>>>>
>>>>>>> What I have done:
>>>>>>>
>>>>>>> <camel:to uri="bean:receiverBean?method=processData" />
>>>>>>> <camel:choice>
>>>>>>>     <camel:when>
>>>>>>>         <camel:el>{$out.body ==
>>>>>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>>>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>>>>     </camel:when>
>>>>>>>     <camel:when>
>>>>>>>         <camel:el>{$out.body ==
>>>>>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>>>     </camel:when>
>>>>>>>     <camel:when>
>>>>>>>         <camel:el>{$out.body ==
>>>>>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>>>     </camel:when>
>>>>>>>     <camel:otherwise>
>>>>>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>>>>     </camel:otherwise>
>>>>>>> </camel:choice>
>>>>>>>
>>>>>>> Every thing is going through the otherwise clause so I am thinking
>>>>>>> that I am acessing and comparing the return enum incorrectly?
>>>>>>> Any help on syntax would be appreciated. Usually in in JSP's you go
>>>>>>> eq
>>>>>>> rather than ==
>>>>>>>
>>>>>>> --Matt
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Claus Ibsen-2 wrote:
>>>>>>>>
>>>>>>>> Yeah
>>>>>>>>
>>>>>>>> There should be a <camel:method> to call a method on a bean.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am just looking at
>>>>>>>>> http://camel.apache.org/content-based-router.html
>>>>>>>>> so seems like my initial thoughts were close.
>>>>>>>>>
>>>>>>>>> --Matt
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> SoaMattH wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I am using camel 2.0.
>>>>>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>>>>>> then evaluate where to go with somthing like:
>>>>>>>>>>
>>>>>>>>>> ....
>>>>>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>>>>>> <camel:choice>
>>>>>>>>>>     <camel:when>
>>>>>>>>>>         <camel:el></camel:el>
>>>>>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>>>>>     </camel:when>
>>>>>>>>>>     <camel:when>
>>>>>>>>>>         <camel:el></camel:el>
>>>>>>>>>>         <camel:toref="EndPointB"/>
>>>>>>>>>>     </camel:when>
>>>>>>>>>> </camel:choice>
>>>>>>>>>> .....
>>>>>>>>>>
>>>>>>>>>> are there any examples of how this is done ?
>>>>>>>>>>
>>>>>>>>>> --Matt
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> -----
>>>>>>>>> /* ----------------------
>>>>>>>>> ** Matt Hannay
>>>>>>>>> ** Unix Java C
>>>>>>>>> ** Software Engineer
>>>>>>>>> ** ------------------- */
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Claus Ibsen
>>>>>>>> Apache Camel Committer
>>>>>>>>
>>>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>>>> Open Source Integration: http://fusesource.com
>>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -----
>>>>>> /* ----------------------
>>>>>> ** Matt Hannay
>>>>>> ** Unix Java C
>>>>>> ** Software Engineer
>>>>>> ** ------------------- */
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Claus Ibsen
>>>>> Apache Camel Committer
>>>>>
>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>> Open Source Integration: http://fusesource.com
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>> Twitter: http://twitter.com/davsclaus
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
> -----
> /* ----------------------
> ** Matt Hannay
> ** Unix Java C
> ** Software Engineer
> ** ------------------- */
> --
> View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27031518.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Not sure of syntax or if its possible or an example

Posted by SoaMattH <ma...@netpacket.com.au>.


SoaMattH wrote:
> 
> 
> I have also tried
> <camel:el>{$body == "ALLREADY_PROCESSED"}</camel:el>
> <camel:el>{$body eq "ALLREADY_PROCESSED"}</camel:el>
> <camel:el>{$body.equals( "ALLREADY_PROCESSED")}</camel:el>
> <camel:el>${in.body == "ALLREADY_PROCESSED"}</camel:el>
> 
> but still the otherwise continues to be executed ?
> 
> Does any one have any clues?
> 
> 
> --Matt
> 
> 
> 
> SoaMattH wrote:
>> 
>> 
>> Just to clarify the body is Body:ALLREADY_PROCESSED
>> 
>> 
>> SoaMattH wrote:
>>> 
>>> 
>>> The syntax on the el has me a little stumped?
>>> I put some logging in to se what is in the Exchange and the two points
>>> of interest are:
>>> 
>>> BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
>>> Body:ALLREADY_PROCESSED
>>> 
>>> I have tried:
>>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>>     <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
>>>     <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
>>> And the   </camel:otherwise> is always executed .......
>>> 
>>> What am I doing wrong in the el ?
>>> 
>>> ....
>>> <camel:to uri="bean:receiverFile?method=process" />
>>> <camel:choice>
>>>   <camel:when>
>>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>>     <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>   </camel:when>
>>>   <camel:when>
>>>     <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
>>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>   </camel:when>
>>>   <camel:when>
>>>     <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
>>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>   </camel:when>
>>>   <camel:otherwise>
>>>     <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
>>>     <camel:to ref="incidentFileProcessedEndPoint"/>
>>>   </camel:otherwise>
>>> </camel:choice>
>>> 
>>> 
>>> 
>>> Claus Ibsen-2 wrote:
>>>> 
>>>> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
>>>> wrote:
>>>>>
>>>>>
>>>>> I have also made the assumption that the return object ends up in
>>>>> out.body is this the case?
>>>>>
>>>> 
>>>> You should just use ${body} in 99% of the cases as Camel uses the
>>>> Pipes And Filters EIP pattern (pipeline) in a route when you have
>>>> multiple steps, which you have as you got: to + choice = 2 steps. So
>>>> the OUT from to becomes IN for the choice.
>>>> 
>>>> 
>>>>> --Matt
>>>>>
>>>>>
>>>>>
>>>>> SoaMattH wrote:
>>>>>>
>>>>>>
>>>>>> I am just having a little difficulty on the syntax and the doco at
>>>>>> the
>>>>>> juel web site
>>>>>> on el is a bit light on
>>>>>>
>>>>>> What I have done:
>>>>>>
>>>>>> <camel:to uri="bean:receiverBean?method=processData" />
>>>>>> <camel:choice>
>>>>>>     <camel:when>
>>>>>>         <camel:el>{$out.body ==
>>>>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>>>     </camel:when>
>>>>>>     <camel:when>
>>>>>>         <camel:el>{$out.body ==
>>>>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>>     </camel:when>
>>>>>>     <camel:when>
>>>>>>         <camel:el>{$out.body ==
>>>>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>>     </camel:when>
>>>>>>     <camel:otherwise>
>>>>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>>>     </camel:otherwise>
>>>>>> </camel:choice>
>>>>>>
>>>>>> Every thing is going through the otherwise clause so I am thinking
>>>>>> that I am acessing and comparing the return enum incorrectly?
>>>>>> Any help on syntax would be appreciated. Usually in in JSP's you go
>>>>>> eq
>>>>>> rather than ==
>>>>>>
>>>>>> --Matt
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Claus Ibsen-2 wrote:
>>>>>>>
>>>>>>> Yeah
>>>>>>>
>>>>>>> There should be a <camel:method> to call a method on a bean.
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> I am just looking at
>>>>>>>> http://camel.apache.org/content-based-router.html
>>>>>>>> so seems like my initial thoughts were close.
>>>>>>>>
>>>>>>>> --Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> SoaMattH wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am using camel 2.0.
>>>>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>>>>> then evaluate where to go with somthing like:
>>>>>>>>>
>>>>>>>>> ....
>>>>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>>>>> <camel:choice>
>>>>>>>>>     <camel:when>
>>>>>>>>>         <camel:el></camel:el>
>>>>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>>>>     </camel:when>
>>>>>>>>>     <camel:when>
>>>>>>>>>         <camel:el></camel:el>
>>>>>>>>>         <camel:toref="EndPointB"/>
>>>>>>>>>     </camel:when>
>>>>>>>>> </camel:choice>
>>>>>>>>> .....
>>>>>>>>>
>>>>>>>>> are there any examples of how this is done ?
>>>>>>>>>
>>>>>>>>> --Matt
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> -----
>>>>>>>> /* ----------------------
>>>>>>>> ** Matt Hannay
>>>>>>>> ** Unix Java C
>>>>>>>> ** Software Engineer
>>>>>>>> ** ------------------- */
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Claus Ibsen
>>>>>>> Apache Camel Committer
>>>>>>>
>>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>>> Open Source Integration: http://fusesource.com
>>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> /* ----------------------
>>>>> ** Matt Hannay
>>>>> ** Unix Java C
>>>>> ** Software Engineer
>>>>> ** ------------------- */
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>> 
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27031518.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Not sure of syntax or if its possible or an example

Posted by SoaMattH <ma...@netpacket.com.au>.

I have also tried
<camel:el>{$body == "ALLREADY_PROCESSED"}</camel:el>
<camel:el>{$body eq "ALLREADY_PROCESSED"}</camel:el>
<camel:el>{$body.equals( "ALLREADY_PROCESSED")}</camel:el>
<camel:el>${in.body == "INCIDENT_ALLREADY_PROCESSED"}</camel:el>

but still the otherwise continues to be executed ?

Does any one have any clues?


--Matt



SoaMattH wrote:
> 
> 
> Just to clarify the body is Body:ALLREADY_PROCESSED
> 
> 
> SoaMattH wrote:
>> 
>> 
>> The syntax on the el has me a little stumped?
>> I put some logging in to se what is in the Exchange and the two points of
>> interest are:
>> 
>> BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
>> Body:ALLREADY_PROCESSED
>> 
>> I have tried:
>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
>> And the   </camel:otherwise> is always executed .......
>> 
>> What am I doing wrong in the el ?
>> 
>> ....
>> <camel:to uri="bean:receiverFile?method=process" />
>> <camel:choice>
>>   <camel:when>
>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>   </camel:when>
>>   <camel:when>
>>     <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>   </camel:when>
>>   <camel:when>
>>     <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>   </camel:when>
>>   <camel:otherwise>
>>     <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
>>     <camel:to ref="incidentFileProcessedEndPoint"/>
>>   </camel:otherwise>
>> </camel:choice>
>> 
>> 
>> 
>> Claus Ibsen-2 wrote:
>>> 
>>> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
>>> wrote:
>>>>
>>>>
>>>> I have also made the assumption that the return object ends up in
>>>> out.body is this the case?
>>>>
>>> 
>>> You should just use ${body} in 99% of the cases as Camel uses the
>>> Pipes And Filters EIP pattern (pipeline) in a route when you have
>>> multiple steps, which you have as you got: to + choice = 2 steps. So
>>> the OUT from to becomes IN for the choice.
>>> 
>>> 
>>>> --Matt
>>>>
>>>>
>>>>
>>>> SoaMattH wrote:
>>>>>
>>>>>
>>>>> I am just having a little difficulty on the syntax and the doco at the
>>>>> juel web site
>>>>> on el is a bit light on
>>>>>
>>>>> What I have done:
>>>>>
>>>>> <camel:to uri="bean:receiverBean?method=processData" />
>>>>> <camel:choice>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:otherwise>
>>>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>>     </camel:otherwise>
>>>>> </camel:choice>
>>>>>
>>>>> Every thing is going through the otherwise clause so I am thinking
>>>>> that I am acessing and comparing the return enum incorrectly?
>>>>> Any help on syntax would be appreciated. Usually in in JSP's you go eq
>>>>> rather than ==
>>>>>
>>>>> --Matt
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Yeah
>>>>>>
>>>>>> There should be a <camel:method> to call a method on a bean.
>>>>>>
>>>>>>
>>>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>> I am just looking at
>>>>>>> http://camel.apache.org/content-based-router.html
>>>>>>> so seems like my initial thoughts were close.
>>>>>>>
>>>>>>> --Matt
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> SoaMattH wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> I am using camel 2.0.
>>>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>>>> then evaluate where to go with somthing like:
>>>>>>>>
>>>>>>>> ....
>>>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>>>> <camel:choice>
>>>>>>>>     <camel:when>
>>>>>>>>         <camel:el></camel:el>
>>>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>>>     </camel:when>
>>>>>>>>     <camel:when>
>>>>>>>>         <camel:el></camel:el>
>>>>>>>>         <camel:toref="EndPointB"/>
>>>>>>>>     </camel:when>
>>>>>>>> </camel:choice>
>>>>>>>> .....
>>>>>>>>
>>>>>>>> are there any examples of how this is done ?
>>>>>>>>
>>>>>>>> --Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -----
>>>>>>> /* ----------------------
>>>>>>> ** Matt Hannay
>>>>>>> ** Unix Java C
>>>>>>> ** Software Engineer
>>>>>>> ** ------------------- */
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>>
>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>> Open Source Integration: http://fusesource.com
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> -----
>>>> /* ----------------------
>>>> ** Matt Hannay
>>>> ** Unix Java C
>>>> ** Software Engineer
>>>> ** ------------------- */
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>> 
>>> 
>>> 
>>> -- 
>>> Claus Ibsen
>>> Apache Camel Committer
>>> 
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>> 
>>> 
>> 
>> 
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27031498.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Not sure of syntax or if its possible or an example

Posted by Claus Ibsen <cl...@gmail.com>.
Maybe try some of the other scripting languages
mvel
ognl
groovy

to see if they can evaluate that expression

or maybe you need to use .equals instead of ==



On Wed, Jan 6, 2010 at 2:14 AM, SoaMattH <ma...@netpacket.com.au> wrote:
>
>
> Just to clarify the body is Body:ALLREADY_PROCESSED
>
>
> SoaMattH wrote:
>>
>>
>> The syntax on the el has me a little stumped?
>> I put some logging in to se what is in the Exchange and the two points of
>> interest are:
>>
>> BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
>> Body:ALLREADY_PROCESSED
>>
>> I have tried:
>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
>> And the   </camel:otherwise> is always executed .......
>>
>> What am I doing wrong in the el ?
>>
>> ....
>> <camel:to uri="bean:receiverFile?method=process" />
>> <camel:choice>
>>   <camel:when>
>>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>>     <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>   </camel:when>
>>   <camel:when>
>>     <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>   </camel:when>
>>   <camel:when>
>>     <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
>>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>   </camel:when>
>>   <camel:otherwise>
>>     <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
>>     <camel:to ref="incidentFileProcessedEndPoint"/>
>>   </camel:otherwise>
>> </camel:choice>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
>>> wrote:
>>>>
>>>>
>>>> I have also made the assumption that the return object ends up in
>>>> out.body is this the case?
>>>>
>>>
>>> You should just use ${body} in 99% of the cases as Camel uses the
>>> Pipes And Filters EIP pattern (pipeline) in a route when you have
>>> multiple steps, which you have as you got: to + choice = 2 steps. So
>>> the OUT from to becomes IN for the choice.
>>>
>>>
>>>> --Matt
>>>>
>>>>
>>>>
>>>> SoaMattH wrote:
>>>>>
>>>>>
>>>>> I am just having a little difficulty on the syntax and the doco at the
>>>>> juel web site
>>>>> on el is a bit light on
>>>>>
>>>>> What I have done:
>>>>>
>>>>> <camel:to uri="bean:receiverBean?method=processData" />
>>>>> <camel:choice>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:when>
>>>>>         <camel:el>{$out.body ==
>>>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>>     </camel:when>
>>>>>     <camel:otherwise>
>>>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>>     </camel:otherwise>
>>>>> </camel:choice>
>>>>>
>>>>> Every thing is going through the otherwise clause so I am thinking
>>>>> that I am acessing and comparing the return enum incorrectly?
>>>>> Any help on syntax would be appreciated. Usually in in JSP's you go eq
>>>>> rather than ==
>>>>>
>>>>> --Matt
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Claus Ibsen-2 wrote:
>>>>>>
>>>>>> Yeah
>>>>>>
>>>>>> There should be a <camel:method> to call a method on a bean.
>>>>>>
>>>>>>
>>>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>> I am just looking at
>>>>>>> http://camel.apache.org/content-based-router.html
>>>>>>> so seems like my initial thoughts were close.
>>>>>>>
>>>>>>> --Matt
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> SoaMattH wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> I am using camel 2.0.
>>>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>>>> then evaluate where to go with somthing like:
>>>>>>>>
>>>>>>>> ....
>>>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>>>> <camel:choice>
>>>>>>>>     <camel:when>
>>>>>>>>         <camel:el></camel:el>
>>>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>>>     </camel:when>
>>>>>>>>     <camel:when>
>>>>>>>>         <camel:el></camel:el>
>>>>>>>>         <camel:toref="EndPointB"/>
>>>>>>>>     </camel:when>
>>>>>>>> </camel:choice>
>>>>>>>> .....
>>>>>>>>
>>>>>>>> are there any examples of how this is done ?
>>>>>>>>
>>>>>>>> --Matt
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -----
>>>>>>> /* ----------------------
>>>>>>> ** Matt Hannay
>>>>>>> ** Unix Java C
>>>>>>> ** Software Engineer
>>>>>>> ** ------------------- */
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> Apache Camel Committer
>>>>>>
>>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>>> Open Source Integration: http://fusesource.com
>>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>> Twitter: http://twitter.com/davsclaus
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> -----
>>>> /* ----------------------
>>>> ** Matt Hannay
>>>> ** Unix Java C
>>>> ** Software Engineer
>>>> ** ------------------- */
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>>
>
>
> -----
> /* ----------------------
> ** Matt Hannay
> ** Unix Java C
> ** Software Engineer
> ** ------------------- */
> --
> View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27026755.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Not sure of syntax or if its possible or an example

Posted by SoaMattH <ma...@netpacket.com.au>.

Just to clarify the body is Body:ALLREADY_PROCESSED


SoaMattH wrote:
> 
> 
> The syntax on the el has me a little stumped?
> I put some logging in to se what is in the Exchange and the two points of
> interest are:
> 
> BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
> Body:ALLREADY_PROCESSED
> 
> I have tried:
>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>     <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
>     <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
> And the   </camel:otherwise> is always executed .......
> 
> What am I doing wrong in the el ?
> 
> ....
> <camel:to uri="bean:receiverFile?method=process" />
> <camel:choice>
>   <camel:when>
>     <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
>     <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>   </camel:when>
>   <camel:when>
>     <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>   </camel:when>
>   <camel:when>
>     <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
>     <camel:to ref="incidentFileDeadLetterEndPoint"/>
>   </camel:when>
>   <camel:otherwise>
>     <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
>     <camel:to ref="incidentFileProcessedEndPoint"/>
>   </camel:otherwise>
> </camel:choice>
> 
> 
> 
> Claus Ibsen-2 wrote:
>> 
>> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
>> wrote:
>>>
>>>
>>> I have also made the assumption that the return object ends up in
>>> out.body is this the case?
>>>
>> 
>> You should just use ${body} in 99% of the cases as Camel uses the
>> Pipes And Filters EIP pattern (pipeline) in a route when you have
>> multiple steps, which you have as you got: to + choice = 2 steps. So
>> the OUT from to becomes IN for the choice.
>> 
>> 
>>> --Matt
>>>
>>>
>>>
>>> SoaMattH wrote:
>>>>
>>>>
>>>> I am just having a little difficulty on the syntax and the doco at the
>>>> juel web site
>>>> on el is a bit light on
>>>>
>>>> What I have done:
>>>>
>>>> <camel:to uri="bean:receiverBean?method=processData" />
>>>> <camel:choice>
>>>>     <camel:when>
>>>>         <camel:el>{$out.body ==
>>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>>     </camel:when>
>>>>     <camel:when>
>>>>         <camel:el>{$out.body ==
>>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>     </camel:when>
>>>>     <camel:when>
>>>>         <camel:el>{$out.body ==
>>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>>     </camel:when>
>>>>     <camel:otherwise>
>>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>>     </camel:otherwise>
>>>> </camel:choice>
>>>>
>>>> Every thing is going through the otherwise clause so I am thinking
>>>> that I am acessing and comparing the return enum incorrectly?
>>>> Any help on syntax would be appreciated. Usually in in JSP's you go eq
>>>> rather than ==
>>>>
>>>> --Matt
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Claus Ibsen-2 wrote:
>>>>>
>>>>> Yeah
>>>>>
>>>>> There should be a <camel:method> to call a method on a bean.
>>>>>
>>>>>
>>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> I am just looking at
>>>>>> http://camel.apache.org/content-based-router.html
>>>>>> so seems like my initial thoughts were close.
>>>>>>
>>>>>> --Matt
>>>>>>
>>>>>>
>>>>>>
>>>>>> SoaMattH wrote:
>>>>>>>
>>>>>>>
>>>>>>> I am using camel 2.0.
>>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>>> then evaluate where to go with somthing like:
>>>>>>>
>>>>>>> ....
>>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>>> <camel:choice>
>>>>>>>     <camel:when>
>>>>>>>         <camel:el></camel:el>
>>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>>     </camel:when>
>>>>>>>     <camel:when>
>>>>>>>         <camel:el></camel:el>
>>>>>>>         <camel:toref="EndPointB"/>
>>>>>>>     </camel:when>
>>>>>>> </camel:choice>
>>>>>>> .....
>>>>>>>
>>>>>>> are there any examples of how this is done ?
>>>>>>>
>>>>>>> --Matt
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> -----
>>>>>> /* ----------------------
>>>>>> ** Matt Hannay
>>>>>> ** Unix Java C
>>>>>> ** Software Engineer
>>>>>> ** ------------------- */
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Claus Ibsen
>>>>> Apache Camel Committer
>>>>>
>>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>>> Open Source Integration: http://fusesource.com
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>> Twitter: http://twitter.com/davsclaus
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>> -----
>>> /* ----------------------
>>> ** Matt Hannay
>>> ** Unix Java C
>>> ** Software Engineer
>>> ** ------------------- */
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>> 
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>> 
>> 
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27026755.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Not sure of syntax or if its possible or an example

Posted by SoaMattH <ma...@netpacket.com.au>.

The syntax on the el has me a little stumped?
I put some logging in to se what is in the Exchange and the two points of
interest are:

BodyType:afullyqualified.ProcessedStatusEnum.ProcessedStatusEnum,
Body:INCIDENT_ALLREADY_PROCESSED

I have tried:
    <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
    <camel:el>{$body = 'ALLREADY_PROCESSED'}</camel:el>
    <camel:el>{$body.equals('ALLREADY_PROCESSED')}</camel:el>
And the   </camel:otherwise> is always executed .......

What am I doing wrong in the el ?

....
<camel:to uri="bean:receiverFile?method=process" />
<camel:choice>
  <camel:when>
    <camel:el>{$body == 'ALLREADY_PROCESSED'}</camel:el>
    <camel:to ref="incidentFilePriorProcessedEndPoint"/>
  </camel:when>
  <camel:when>
    <camel:el>{$body == 'INCIDENT_PROCESSED_FAILURE'}</camel:el>
    <camel:to ref="incidentFileDeadLetterEndPoint"/>
  </camel:when>
  <camel:when>
    <camel:el>{$body == 'NOT_PROCESSED_YET'}</camel:el>
    <camel:to ref="incidentFileDeadLetterEndPoint"/>
  </camel:when>
  <camel:otherwise>
    <camel:to uri="log:afullyqualified?showAll=true&amp;level=FATAL"/>
    <camel:to ref="incidentFileProcessedEndPoint"/>
  </camel:otherwise>
</camel:choice>



Claus Ibsen-2 wrote:
> 
> On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au>
> wrote:
>>
>>
>> I have also made the assumption that the return object ends up in
>> out.body is this the case?
>>
> 
> You should just use ${body} in 99% of the cases as Camel uses the
> Pipes And Filters EIP pattern (pipeline) in a route when you have
> multiple steps, which you have as you got: to + choice = 2 steps. So
> the OUT from to becomes IN for the choice.
> 
> 
>> --Matt
>>
>>
>>
>> SoaMattH wrote:
>>>
>>>
>>> I am just having a little difficulty on the syntax and the doco at the
>>> juel web site
>>> on el is a bit light on
>>>
>>> What I have done:
>>>
>>> <camel:to uri="bean:receiverBean?method=processData" />
>>> <camel:choice>
>>>     <camel:when>
>>>         <camel:el>{$out.body ==
>>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>>     </camel:when>
>>>     <camel:when>
>>>         <camel:el>{$out.body ==
>>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>     </camel:when>
>>>     <camel:when>
>>>         <camel:el>{$out.body ==
>>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>>     </camel:when>
>>>     <camel:otherwise>
>>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>>     </camel:otherwise>
>>> </camel:choice>
>>>
>>> Every thing is going through the otherwise clause so I am thinking
>>> that I am acessing and comparing the return enum incorrectly?
>>> Any help on syntax would be appreciated. Usually in in JSP's you go eq
>>> rather than ==
>>>
>>> --Matt
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>>
>>>> Yeah
>>>>
>>>> There should be a <camel:method> to call a method on a bean.
>>>>
>>>>
>>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>>> wrote:
>>>>>
>>>>>
>>>>> I am just looking at
>>>>> http://camel.apache.org/content-based-router.html
>>>>> so seems like my initial thoughts were close.
>>>>>
>>>>> --Matt
>>>>>
>>>>>
>>>>>
>>>>> SoaMattH wrote:
>>>>>>
>>>>>>
>>>>>> I am using camel 2.0.
>>>>>> I want to call a bean as part of my xml route configuration and
>>>>>> then evaluate where to go with somthing like:
>>>>>>
>>>>>> ....
>>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>>> <camel:choice>
>>>>>>     <camel:when>
>>>>>>         <camel:el></camel:el>
>>>>>>         <camel:to ref="EndPointA"/>
>>>>>>     </camel:when>
>>>>>>     <camel:when>
>>>>>>         <camel:el></camel:el>
>>>>>>         <camel:toref="EndPointB"/>
>>>>>>     </camel:when>
>>>>>> </camel:choice>
>>>>>> .....
>>>>>>
>>>>>> are there any examples of how this is done ?
>>>>>>
>>>>>> --Matt
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> /* ----------------------
>>>>> ** Matt Hannay
>>>>> ** Unix Java C
>>>>> ** Software Engineer
>>>>> ** ------------------- */
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>>
>>>
>>
>>
>> -----
>> /* ----------------------
>> ** Matt Hannay
>> ** Unix Java C
>> ** Software Engineer
>> ** ------------------- */
>> --
>> View this message in context:
>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27026749.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Not sure of syntax or if its possible or an example

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jan 4, 2010 at 11:59 PM, SoaMattH <ma...@netpacket.com.au> wrote:
>
>
> I have also made the assumption that the return object ends up in
> out.body is this the case?
>

You should just use ${body} in 99% of the cases as Camel uses the
Pipes And Filters EIP pattern (pipeline) in a route when you have
multiple steps, which you have as you got: to + choice = 2 steps. So
the OUT from to becomes IN for the choice.


> --Matt
>
>
>
> SoaMattH wrote:
>>
>>
>> I am just having a little difficulty on the syntax and the doco at the
>> juel web site
>> on el is a bit light on
>>
>> What I have done:
>>
>> <camel:to uri="bean:receiverBean?method=processData" />
>> <camel:choice>
>>     <camel:when>
>>         <camel:el>{$out.body ==
>> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>>     </camel:when>
>>     <camel:when>
>>         <camel:el>{$out.body ==
>> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>     </camel:when>
>>     <camel:when>
>>         <camel:el>{$out.body ==
>> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>>     </camel:when>
>>     <camel:otherwise>
>>         <camel:to ref="incidentFileProcessedEndPoint"/>
>>     </camel:otherwise>
>> </camel:choice>
>>
>> Every thing is going through the otherwise clause so I am thinking
>> that I am acessing and comparing the return enum incorrectly?
>> Any help on syntax would be appreciated. Usually in in JSP's you go eq
>> rather than ==
>>
>> --Matt
>>
>>
>>
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Yeah
>>>
>>> There should be a <camel:method> to call a method on a bean.
>>>
>>>
>>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>>> wrote:
>>>>
>>>>
>>>> I am just looking at
>>>> http://camel.apache.org/content-based-router.html
>>>> so seems like my initial thoughts were close.
>>>>
>>>> --Matt
>>>>
>>>>
>>>>
>>>> SoaMattH wrote:
>>>>>
>>>>>
>>>>> I am using camel 2.0.
>>>>> I want to call a bean as part of my xml route configuration and
>>>>> then evaluate where to go with somthing like:
>>>>>
>>>>> ....
>>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>>> <camel:choice>
>>>>>     <camel:when>
>>>>>         <camel:el></camel:el>
>>>>>         <camel:to ref="EndPointA"/>
>>>>>     </camel:when>
>>>>>     <camel:when>
>>>>>         <camel:el></camel:el>
>>>>>         <camel:toref="EndPointB"/>
>>>>>     </camel:when>
>>>>> </camel:choice>
>>>>> .....
>>>>>
>>>>> are there any examples of how this is done ?
>>>>>
>>>>> --Matt
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> -----
>>>> /* ----------------------
>>>> ** Matt Hannay
>>>> ** Unix Java C
>>>> ** Software Engineer
>>>> ** ------------------- */
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>>
>
>
> -----
> /* ----------------------
> ** Matt Hannay
> ** Unix Java C
> ** Software Engineer
> ** ------------------- */
> --
> View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Not sure of syntax or if its possible or an example

Posted by SoaMattH <ma...@netpacket.com.au>.

I have also made the assumption that the return object ends up in 
out.body is this the case?

--Matt



SoaMattH wrote:
> 
> 
> I am just having a little difficulty on the syntax and the doco at the
> juel web site 
> on el is a bit light on
> 
> What I have done:
> 
> <camel:to uri="bean:receiverBean?method=processData" />
> <camel:choice>
>     <camel:when>
>         <camel:el>{$out.body ==
> 'fullyqualified.ProcessedStatusEnum.ALLREADY_PROCESSED'}</camel:el>
>         <camel:to ref="incidentFilePriorProcessedEndPoint"/>
>     </camel:when>
>     <camel:when>
>         <camel:el>{$out.body ==
> 'fullyqualified.ProcessedStatusEnum.PROCESSED_FAILURE'}</camel:el>
>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>     </camel:when>
>     <camel:when>
>         <camel:el>{$out.body ==
> 'fullyqualified.ProcessedStatusEnum.NOT_PROCESSED_YET'}</camel:el>
>         <camel:to ref="incidentFileDeadLetterEndPoint"/>
>     </camel:when>
>     <camel:otherwise>
>         <camel:to ref="incidentFileProcessedEndPoint"/>
>     </camel:otherwise>
> </camel:choice>
>         
> Every thing is going through the otherwise clause so I am thinking
> that I am acessing and comparing the return enum incorrectly?
> Any help on syntax would be appreciated. Usually in in JSP's you go eq
> rather than ==
> 
> --Matt
> 
> 
> 
> 
> 
> 
> 
> Claus Ibsen-2 wrote:
>> 
>> Yeah
>> 
>> There should be a <camel:method> to call a method on a bean.
>> 
>> 
>> On Thu, Dec 31, 2009 at 8:32 AM, SoaMattH <ma...@netpacket.com.au>
>> wrote:
>>>
>>>
>>> I am just looking at
>>> http://camel.apache.org/content-based-router.html
>>> so seems like my initial thoughts were close.
>>>
>>> --Matt
>>>
>>>
>>>
>>> SoaMattH wrote:
>>>>
>>>>
>>>> I am using camel 2.0.
>>>> I want to call a bean as part of my xml route configuration and
>>>> then evaluate where to go with somthing like:
>>>>
>>>> ....
>>>> <camel:to uri="bean:recieverA?method=processA" />
>>>> <camel:choice>
>>>>     <camel:when>
>>>>         <camel:el></camel:el>
>>>>         <camel:to ref="EndPointA"/>
>>>>     </camel:when>
>>>>     <camel:when>
>>>>         <camel:el></camel:el>
>>>>         <camel:toref="EndPointB"/>
>>>>     </camel:when>
>>>> </camel:choice>
>>>> .....
>>>>
>>>> are there any examples of how this is done ?
>>>>
>>>> --Matt
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> -----
>>> /* ----------------------
>>> ** Matt Hannay
>>> ** Unix Java C
>>> ** Software Engineer
>>> ** ------------------- */
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p26976141.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>> 
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>> 
>> 
> 
> 


-----
/* ----------------------
** Matt Hannay
** Unix Java C
** Software Engineer
** ------------------- */
-- 
View this message in context: http://old.nabble.com/Not-sure-of-syntax-or-if-its-possible-or-an-example-tp26975789p27020826.html
Sent from the Camel - Users mailing list archive at Nabble.com.