How can I implement more complex expression in a flow's condition? Simple conditions like:
${i > 0}
are handy and great but there are other times I need to do something a little more complex like:
${deadLine.after(now)}
Assuming deadLine
is an object of type Date
already defined in process instance and now
means new Date()
. How can I implement such expressions in a flow's condition? In Java I can:
ExpressionFactory factory = new ExpressionFactoryImpl();
SimpleContext context = new SimpleContext(new SimpleResolver());
factory.createValueExpression(context, "${deadLine}", java.util.Date.class).setValue(context, new java.util.Date());
factory.createValueExpression(context, "${now}", java.util.Date.class).setValue(context, new java.util.Date());
ValueExpression expr1 = factory.createValueExpression(context, "${deadLine.after(now)}", boolean.class);
System.out.println("Result = " + expr1.getValue(context));
But how can I do the same in a flow's condition?