file:readFile that uses "jelly:com.niku.union.gel.FileTagLibrary", retains data from files that it read before.

Document ID : KB000009130
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Steps to Reproduce this issue are as below:

1. Create a text files called 1.txt with the following content: 

hello,world,1.1 

hello,world,1.2 

hello,world,1.3 

 

2. Create a text files called 2.txt with the following content: 

hello,world,2.1 

hello,world,2.2 

hello,world,2.3 

 

3. Create a text files called 3.txt with the following content: 

hello,world,3.1 

hello,world,3.2 

hello,world,3.3 

 

4. Create a GEL script with the following content: 

<gel:script 

xmlns:file="jelly:com.niku.union.gel.FileTagLibrary" 

xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" 

xmlns:core="jelly:core"> 

 

<core:forEach items="1.txt, 2.txt, 3.txt" var="infile"> 

<file:readFile fileName="${infile}" delimiter="," var="infileParsed" embedded="false"/> 

 

<gel:out>Processing file: ${infile}</gel:out> 

<core:forEach items="${infileParsed.rows}" var="row" indexVar="i" begin="1" step="1"> 

<gel:out>${row[0]}, ${row[1]}, ${row[2]}</gel:out> 

</core:forEach> 

</core:forEach> 

 

</gel:script> 

 

5. Run this GEL at the command prompt: gel -script 

 

Expected Results: Each occurrence of "Processing file: " would show only the contents of that file following it

 

Actual Results: Each occurrence of "Processing file: " would shows contents of all previous files as well as itself 

Environment:
Versions 14.3, 14.4, 15.1, 15.2, 15.3 of CA PPM.
Cause:

This was caused by a defect with ID DE37803.

Resolution:

The defect has been fixed in CA PPM 15.4