Java Transformation Script Basics

LabKey Support Forum (Inactive)
Java Transformation Script Basics trent  2015-12-08 14:01
Status: Closed
 
Hi,

I'm on LabKey 14.1 at the moment, and I'm trying to get a transformation script going. After not having a good result with the perl version, I decided to give it a go in Java.

I'm a little confused by the runDataFile line. I can see that by looking at other examples - the destination you need to write to is the last value on the line (index 3). I've verified this with a simple:

outputWriter.write("ParticipantID\tSequenceNum\tHCVSequence");
outputWriter.newLine();
outputWriter.write("4\t4\tAGCTA");

Where outputWriter points to that path: C:\Program Files\LabKey Server\files\VHKEY3\@files\assaydata\Sequences-2015-12-09-0811.tsv

But where should I be getting the input from? I thought it was the second value, but when I check the file length, it's coming back as 0:

File f = new File(this.inputFilePath);
if (f.length() == 0 ){
// throw new Exception("Input file '" + this.inputFilePath + "' is empty");
}

Which gives me: Input file 'C:\Program Files\LabKey Server\files\VHKEY3\@files\TransformAndValidationFiles\AssayId_70\82\runDataFile.tsv' is empty

Additionally:

if (!f.exists()){
    throw new Exception("Input file '" + f.getAbsolutePath() + "' is not existent");
}

Input file 'C:\Program Files\LabKey Server\files\VHKEY3\@files\TransformAndValidationFiles\AssayId_70\64\runDataFile.tsv' is not existent

And when I check that path - indeed I only see the runProperties.tsv file. Have I got something mixed up here?
 
 
trent responded:  2015-12-08 14:29
I see now I should have been looking at the line beginning with "runDataUploadedFile" for the input file?