cancel
Showing results for 
Search instead for 
Did you mean: 

SCI: add 1 day to date in Exchange Property using Camel Simple Expression language

AlanWaters
Participant
0 Kudos
217

Hi there,

I'm trying to add 1 day to a date that's in an Exchange Property, but it keeps erroring.

My understanding was that the following syntax would work:

${date:property.CamelCreatedTimestamp+24h}

But when I try it as follows:

SCI_exch_prop.png

It returns this error:

java.lang.IllegalArgumentException - Command not supported for dateExpression: property.date_in

Any idea how I can do this using Camel? Please note: I can't use 'date:now' which will give me the current date - I need to work with the date that's fed in from a property.

(I know I can use Groovy for the calculation, but I'm trying to keep it simple)

Many thanks,
Alan

 

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor
0 Kudos

This option cannot be used unless property.date_in is of type java.util.Date.  The manner in which it is declared means it is going to be of type java.lang.String.

 

Regards,

Ryan Crosby

AlanWaters
Participant
0 Kudos
Many thanks for the information, Ryan. Is there a way to force property.date_in to be type java.util.Date?
Ryan-Crosby
Active Contributor
@AlanWaters only if you were to use a Groovy script to create the object because it doesn't appear to be supported in the simple Camel expressions.
AlanWaters
Participant
OK, thanks Ryan. I'll just use a Groovy script to do the calculation. Much appreciated 🙂

Answers (0)