Solved

Groovy interpreter? I am befuddled.

  • 4 April 2022
  • 2 replies
  • 60 views

Userlevel 5
Badge +16

I’m at a loss here. 

I was under the impression that the workflow engine uses Groovy to interpret any java code you enter but some operators fail the syntax check.

 

For example if I attempt to create a list using groovy syntax.

def clientlist = [];

 

this will cause a syntax error stating that “[“ is unexpected.

Fine I can work around that by doing 

def clientlist = xpath:{/workflow/select/clients}

 

Where the xpath points to a list, but it will not allow me to do something such as 

clientlist.each{

random stuff

more random stuff

additional random stuff

}

 

I don’t mind using Javascript but some things are easier in Java and I kind of assumed that I could just follow Groovy syntax to make sure stuff worked. 

What am I missing?

 

icon

Best answer by Orazan 4 April 2022, 20:50

View original

If you have a question or comment, please create a topic

2 replies

Userlevel 6
Badge +15

Good afternoon.  As Groovy syntax is not always backward compatible to Java syntax in some cases, we recommend using Java syntax.  Please let me know if you have any questions.

 

Userlevel 5
Badge +16

Thanks. I will keep that in mind.