MVEL2 Handle a try/catch block

372 views Asked by At

I need to handle a try catch block in a mvel compiled expression called from Java, something like this

try {
  func1()
} catch (Exception e) {
 ...do something
}
func2()

From my understandings of http://mvel.documentnode.com/ it's not possible. Am I correct? Any idea to achieve this inside the expression? Sadly I can't split the expression to handle the exception in Java or modify functions.
Thanks

1

There are 1 answers

0
Rinkesh patil On

yes u are right we cannot write try/catch block in mvel instead we can use ternary.