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 script to pass subvariable in DLR

Summary:

Hi Experts,

Im trying to pass subvariable for start period and end period on the Json payload , it shows the method is invalid, it might be an easy one for you guys, where Im missing, pls correct me

def strsPeriod = operation.application.getSubstitutionVariableValue("CurPeriod")
if (strsPeriod == null)
throwVetoException("Substitution Variable CurPeriod not present or set.")
print strsperiod

HttpResponse<String> jsonResponse = operation.application.getConnection("MQ").post()
.body(json(["jobType":"INTEGRATION", "jobName":"SRULE", "startPeriod":"Feb-23", "endPeriod":"Feb-23", "importMode":"REPLACE", "exportMode":"STORE_DATA"]))
.asString();

Content (please ensure you mask any confidential information):


Version (include the version you are using, if applicable):



Code Snippet (add any code snippets that support your topic, if applicable):

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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