
How to store data of first and last file in Multi File Import in separate objects
For this example the customer demanded an separate visualisation of data of first and last test in an endurance testing with thousends of files, evaluated by jBEAM with Multi File Import. To solve that requirement, we used two memory functions in jBEAM. This functions were named "first_test" and "last_test" and got the file importer as producer. To trigger this memory functions we used a Groovy-script in Multi File Import. This script was executed by Multi File Import after each file. The script contained the following source:
println "Groovy script invoked.";
miComp = jC.getComponentByName("MultiImport");
println "MultiImport component found: " + miComp.getName();
doc1Comp = jC.getComponentByName("first_test");
println "MultiImport nextFileIndex: " + miComp.getSelectedFileIndex();
fileIndex = miComp.getSelectedFileIndex();
if (fileIndex == 0) {
doc1Comp.copyDataObjects();
doc2Comp = jC.getComponentByName("last_test");
doc2Comp.getResultObject(1).clear();
}
if (fileIndex == miComp.getFilesCount() - 1) {
doc2Comp = jC.getComponentByName("last_test");
doc2Comp.copyDataObjects();
}
return;