Hi everyone,
I am new to flowable. We have the requirement to send 3 remainder email in some interval of days (30, 60 and 90 days) to notify the user if he is not completing user task (Complete From). In each email (html body content) we have to place content like
"No actions has been performed as on ${System_Date}. Hence it requires your action to complete
How to get current ${System_Date} from flowable API or in some way?
Thanks in advance!
Can someone guide me on above solution?
When you are in a spring environment, the easiest solution is to create an e.g. “ModelUtil” bean, which contains util functions, usable in expressions.
For example, create a bean like this in your spring boot project:
@Component("util")
public class MyModelUtil {
public String dateFormatted() {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
.withZone(ZoneId.systemDefault());
return formatter.format(Instant.now());
}
}
The bean is automatically exposed to be available in expressions (as all beans are by default) and can be used in any expression:
${util.dateFormatted()}
Use the code only as inspiration.
1 Like
@arthware Thank you for your reply. Let me try integrating and update here.
Get ClockReader
instance from pocessEngineConfiguration
. ClockReader
has methods for getting current time. Use the value in the expression.
Regards
Martin