How to pass parameters to tRest component

One Star

How to pass parameters to tRest component

Hi,
I have a job (see screenshot) whereby I am submitting a REST request with an http Body. I would like to make it more dynamic whereby I would pass a parameter value to the job e.g. right now you see the following:
<creationDate>2015-06-18T16:12:15.290-07:00</creationDate>
instead I would like to do something like
<creationDate>myDateParameter</creationDate>
where myDateParameter would come from a list of dates. How would I change this job to achieve that? Also, how do I specify parameter values?
Thanks,
Doug
One Star

Re: How to pass parameters to tRest component

Hi,
I suppose you can have a tJavaFlex between the 2 tREST to change the body as you want or to set 1 or more global variables then, in the body you can use these variables:
- in tJavaFlex:
globalMap.put("creationDate", what_you_want);
- in tRest, field Body:
 "<overwriteFiles>true</overwriteFiles>
blablabla"+globalMap.get("creationDate")+"blablabla"
It should works.
Let me know.
Regards,
Fred
One Star

Re: How to pass parameters to tRest component

Hi,
I suppose you can have a tJavaFlex between the 2 tREST to change the body as you want or to set 1 or more global variables then, in the body you can use these variables:
- in tJavaFlex:
globalMap.put("creationDate", what_you_want);
- in tRest, field Body:
 "<overwriteFiles>true</overwriteFiles>
blablabla"+globalMap.get("creationDate")+"blablabla"
It should works.
Let me know.
Regards,
Fred

One Star

Re: How to pass parameters to tRest component

Hi,
Put a tLogRow before tRest1 to see what is sent to this component.
Also, you can execute your job using the debug mode or put some traces in the service called by tRest1.
Fred