Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Groovy - Issue calling calc script template inside a groovy script

in Planning 26 comments

Summary:

I have a groovy rule that executes a calc that references a Template. I am passing the template name using a variable.

I am getting a generic error. If I print the calcScript, that is giving the correct result, but the rule is unable to compile it.

Any help on this will be of great help.

/*Code Snippet*/

Cube cube = operation.application.getCube("WFPln")
String TempName = "Test_Script"

StringBuilder calcScript = StringBuilder.newInstance()

calcScript << """

FIX("BU_None")

%Template(name:="${TempName}",application:="JLLFPA",plantype:="WFPln",dtps:=())

ENDFIX
"""

println calcScript
cube.executeCalcScript(calcScript.toString())

Error:

A method called by the script failed on line: 17, with error: Invalid Calc Script syntax [

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!