cancel
Showing results for 
Search instead for 
Did you mean: 

Expressions in attachment

ashitre
Champ in-the-making
Champ in-the-making
In our process, we want to send attachments in the email (activiti email task). We will have attachment templates that will have expressions. Can activiti resolve expresssions in the attachment?
Or we have to parse the file and resolve the expressions and send it to email task?
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
No, Attachments are just files for Activiti … it doesn't allow for expression (plus, it would only work for text-format attachments)

ashitre
Champ in-the-making
Champ in-the-making
Thanks for the reply.

I have another query about Timer intermediate catch event. We need to send a mail 2 days prior to end date (so date-2). Is it possible to do it with this event.
I set Time date as ${end_date - 2}, but it fails with below exception
Caused by: org.activiti.engine.impl.javax.el.ELException: Cannot coerce '2016-02-14' to class java.lang.Long
        at org.activiti.engine.impl.juel.TypeConverterImpl.coerceToLong(TypeConverterImpl.java:176) [activiti-engine-5.19.0.jar:5.19.0]

It seems that it always consider left operand to be long for substraction.

Is there any other way to handle this scenario? Also, if I update the end_date in between, will this catching event will wait for new date or it will still consider old date?

trademak
Star Contributor
Star Contributor
Your expression is not a valid expression with the reason mentioned in the exception. You could implement a Helper class or a Spring bean that does some date calculation for you, and returns a valid date.

Best regards,