Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
imholzj
Contributor III
Contributor III

tGroovy STDIN

What's best practice?

 

I have a groovy program that operates on STDIN, do I have to create a file first and pass the file name into tGroovy or can the file be fed (from tHttpRequest) and read from STDIN?

 

jji

Labels (1)
  • v7.x

2 Replies
Anonymous
Not applicable

Hello,

If I understand your requirement very well, do you want to use a tGroovy component to process rows?
Here is a tFlowtoIterate component which reads data line by line from the input flow and stores the data entries in iterative global variables.

The workflow looks like;

Input-->tflowtoiterate-->tGroovy(write your Groovy script).

Best regards

Sabrina

 

 

 

imholzj
Contributor III
Contributor III
Author

It's actually a json file that I want to parse in the Groovy script.

 

Right now I have to set an ENV var for fileIn and fileOut, and have the Groovy script use those vars to read and write the results.  I was hoping for a cleaner script that would just read the json from STDIN and write the results to STDOUT.

 

jji