Assigning a Control Number in the Output Mapping

New guy here…

CloverETL is embedded within another product as a generic ETL tool which can call custom components of the vendor software. In general however, it’s still basic clover (Universal Data Readers, Writers,etc).

What I’m trying to figure out is how to assign a control number on the output. I’m trying to figure out a way to assign a control number to the output so that I can tie the output back to the input. The only way I see that I can get the input reflected in any way in the output is by creating a separate error port.

Is there a way to make either a singular result set (with success and failure, including the actual input data) OR alternatively get some type of auto-generated sequencer assigned on the output side.

Sorry if this is vague. If more details are needed, please let me know and I can elaborate. Thanks for the help…

Hello,
I’m not sure if I understand you properly, but if you want to parse data and send all (valid and invalid) records to the same output port, you need to parse it in the Reformat with our Parser.
Following graph:

<?xml version="1.0" encoding="UTF-8"?>
<Graph author="avackova" created="Mon Nov 08 09:20:03 CET 2010" modified="Mon Nov 08 10:33:42 CET 2010" modifiedBy="avackova" name="parsing" revision="1.8">
<Global>
<Metadata id="Metadata1" >
<Record fieldDelimiter=";" name="output" recordDelimiter="\n" type="delimited">
<Field name="data1" type="string"/>
<Field eofAsDelimiter="false" name="data2" type="integer"/>
<Field auto_filling="default_value" name="success" type="boolean"/>
</Record>
</Metadata>
<Metadata id="Metadata0">
<Record fieldDelimiter="|" name="rowData" recordDelimiter="\n" type="delimited">
<Field name="data" type="string"/>
</Record>
</Metadata>
<Property id="GraphParameter10" name="charset" value="UTF-8"/>
<Property fileURL="workspace.prm" id="GraphParameter0"/>
<Dictionary/>
</Global>
<Phase number="0">
<Node fileURL="${DATAIN_DIR}/linux_eol.txt" id="DATA_READER0" type="DATA_READER"/>
<Node id="REFORMAT0" transformURL="${TRANS_DIR}/Parsing.java" type="REFORMAT"/>
<Node debugPrint="true" id="TRASH0" type="TRASH"/>
<Edge fromNode="DATA_READER0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge0" inPort="Port 0 (in)" metadata="Metadata0" outPort="Port 0 (output)" toNode="REFORMAT0:0"/>
<Edge fromNode="REFORMAT0:0" guiBendpoints="" guiRouter="Manhattan" id="Edge1" inPort="Port 0 (in)" metadata="Metadata1" outPort="Port 0 (out)" toNode="TRASH0:0"/>
</Phase>
</Graph>

with Parsing.java:

import java.io.ByteArrayInputStream;
import java.io.IOException;

import org.jetel.component.DataRecordTransform;
import org.jetel.data.DataRecord;
import org.jetel.data.parser.DataParser;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.exception.TransformException;


public class Parsing extends DataRecordTransform {
	
	DataParser parser = new DataParser("${charset}");
	DataRecord tmp;
	DataRecord[] tmpArray;
	int successField;
	int lastDataField;

	@Override
	public boolean init() throws ComponentNotReadyException {
		//last field must be auto-filling to inform parser to skip this field
		//set eofAsDelimiter to before-last field, as record delimiter was stripped by Reader
		targetMetadata[0].getField(targetMetadata[0].getNumFields() - 2).setEofAsDelimiter(true);
		parser.init(targetMetadata[0]);
		tmp = new DataRecord(targetMetadata[0]);
		tmp.init();
		tmpArray = new DataRecord[]{tmp};
		successField = targetMetadata[0].getNumFields() - 1;
		return super.init();
	}
	
	@Override
	public int transform(DataRecord[] inputRecords, DataRecord[] outputRecords)
			throws TransformException {
		boolean success = true;
		tmp.reset();
		try {
			parser.setDataSource(new ByteArrayInputStream(inputRecords[0].getField(0).toString().getBytes("${charset}")));
			tmp = parser.getNext(tmp);
		} catch (Exception e) {
			e.printStackTrace();
			success = false;
		}finally{
			defaultTransform(tmpArray, outputRecords);
			outputRecords[0].getField(successField).setValue(success);
		}
		return 0;
	}

	@Override
	public void postExecute() throws ComponentNotReadyException {
		try {
			parser.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		super.postExecute();
	}
}

reads row data with DataReader and parses it with Reformat. It adds parsing result (true or false) to each output record.

Hi Agata,

I gave it a try after importing the graph and the associated java code into my project. I used a dummy file just to see if it would flow through. Looks like it’s angry over the @ associated to to the “@Overide” lines.

Likely this is something glaringly obvious to a developer, unfortunately I’m not a developer.

But your understanding of the issue is exactly right, so I believe if I can get past this I should be fine.

below is the output from the run. I hope this helps.


INFO  [main] - ***  CloverETL framework/transformation graph runner ver 2.5, (c) 2002-06 D.Pavlis, released under GNU Lesser General Public License  ***
INFO  [main] - Running with framework version: 2.5 build#devel compiled March 3 2009
INFO  [main] - Running on 2 CPU(s), OS Windows XP, architecture x86, Java version 1.5.0_15, max available memory for JVM 65088 KB
INFO  [main] - Loading default properties from: defaultProperties
DEBUG [main] - Plugin org.jetel.bulkloader loaded.
	id - org.jetel.bulkloader
	version - 2.5.6
	provider-name - 
		component { type = ORACLE_DATA_READER; className = org.jetel.component.OracleDataReader;  }
		component { type = ORACLE_DATA_WRITER; className = org.jetel.component.OracleDataWriter;  }
		component { type = MYSQL_DATA_READER; className = org.jetel.component.MysqlDataReader;  }
		component { type = DB2_DATA_WRITER; className = org.jetel.component.DB2DataWriter;  }
		component { type = INFORMIX_DATA_WRITER; className = org.jetel.component.InformixDataWriter;  }
		component { type = MS_SQL_DATA_WRITER; className = org.jetel.component.MsSqlDataWriter;  }
		component { type = MYSQL_DATA_WRITER; className = org.jetel.component.MysqlDataWriter;  }
		component { type = POSTGRESQL_DATA_WRITER; className = org.jetel.component.PostgreSqlDataWriter;  }

DEBUG [main] - Plugin org.jetel.component loaded.
	id - org.jetel.component
	version - 2.5.6
	provider-name - null
		component { type = DATA_READER; className = org.jetel.component.DataReader;  }
		component { type = DATA_WRITER; className = org.jetel.component.DataWriter;  }
		component { type = DELIMITED_DATA_READER; className = org.jetel.component.DelimitedDataReader;  }
		component { type = DELIMITED_DATA_WRITER; className = org.jetel.component.DelimitedDataWriter;  }
		component { type = SIMPLE_COPY; className = org.jetel.component.SimpleCopy;  }
		component { type = CONCATENATE; className = org.jetel.component.Concatenate;  }
		component { type = SIMPLE_GATHER; className = org.jetel.component.SimpleGather;  }
		component { type = REFORMAT; className = org.jetel.component.Reformat;  }
		component { type = DB_INPUT_TABLE; className = org.jetel.component.DBInputTable;  }
		component { type = SORT; className = org.jetel.component.Sort;  }
		component { type = DB_OUTPUT_TABLE; className = org.jetel.component.DBOutputTable;  }
		component { type = FIXLEN_DATA_WRITER; className = org.jetel.component.FixLenDataWriter;  }
		component { type = DEDUP; className = org.jetel.component.Dedup;  }
		component { type = FIXLEN_DATA_READER; className = org.jetel.component.FixLenDataReader;  }
		component { type = MERGE; className = org.jetel.component.Merge;  }
		component { type = MERGE_JOIN; className = org.jetel.component.MergeJoin;  }
		component { type = EXT_MERGE_JOIN; className = org.jetel.component.MergeJoin;  }
		component { type = SORTED_JOIN; className = org.jetel.component.MergeJoin;  }
		component { type = TRASH; className = org.jetel.component.Trash;  }
		component { type = DB_EXECUTE; className = org.jetel.component.DBExecute;  }
		component { type = HASH_JOIN; className = org.jetel.component.HashJoin;  }
		component { type = EXT_HASH_JOIN; className = org.jetel.component.HashJoin;  }
		component { type = CHECK_FOREIGN_KEY; className = org.jetel.component.CheckForeignKey;  }
		component { type = DBF_DATA_READER; className = org.jetel.component.DBFDataReader;  }
		component { type = EXT_FILTER; className = org.jetel.component.ExtFilter;  }
		component { type = EXT_SORT; className = org.jetel.component.ExtSort;  }
		component { type = PARTITION; className = org.jetel.component.Partition;  }
		component { type = DATA_INTERSECTION; className = org.jetel.component.DataIntersection;  }
		component { type = AGGREGATE; className = org.jetel.component.Aggregate;  }
		component { type = SYS_EXECUTE; className = org.jetel.component.SystemExecute;  }
		component { type = RUN_GRAPH; className = org.jetel.component.RunGraph;  }
		component { type = KEY_GEN; className = org.jetel.component.KeyGenerator;  }
		component { type = APROX_MERGE_JOIN; className = org.jetel.component.AproxMergeJoin;  }
		component { type = DBJOIN; className = org.jetel.component.DBJoin;  }
		component { type = XLS_READER; className = org.jetel.component.XLSReader;  }
		component { type = XLS_WRITER; className = org.jetel.component.XLSWriter;  }
		component { type = CLOVER_WRITER; className = org.jetel.component.CloverDataWriter;  }
		component { type = CLOVER_READER; className = org.jetel.component.CloverDataReader;  }
		component { type = STRUCTURE_WRITER; className = org.jetel.component.StructureWriter;  }
		component { type = NORMALIZER; className = org.jetel.component.Normalizer;  }
		component { type = DENORMALIZER; className = org.jetel.component.Denormalizer;  }
		component { type = JMS_READER; className = org.jetel.component.JmsReader;  }
		component { type = JMS_WRITER; className = org.jetel.component.JmsWriter;  }
		component { type = LOOKUP_JOIN; className = org.jetel.component.LookupJoin;  }
		component { type = LOOKUP_TABLE_READER_WRITER; className = org.jetel.component.LookupTableReaderWriter;  }
		component { type = DATA_GENERATOR; className = org.jetel.component.DataGenerator;  }
		component { type = MULTI_LEVEL_READER; className = org.jetel.component.MultiLevelReader;  }
		component { type = SEQUENCE_CHECKER; className = org.jetel.component.SequenceChecker;  }
		component { type = TEXT_TABLE_WRITER; className = org.jetel.component.TextTableWriter;  }
		component { type = XML_XPATH_READER; className = org.jetel.component.XmlXPathReader;  }
		component { type = PACEMAKER; className = org.jetel.component.Pacemaker;  }
		component { type = SPEED_LIMITER; className = org.jetel.component.SpeedLimiter;  }
		component { type = JAVA_EXECUTE; className = org.jetel.component.JavaExecute;  }
		component { type = XML_WRITER; className = org.jetel.component.XmlWriter;  }
		component { type = XSL_TRANSFORMER; className = org.jetel.component.XSLDataTransformer;  }

DEBUG [main] - Plugin org.jetel.connection loaded.
	id - org.jetel.connection
	version - 2.5.6
	provider-name - null
		connection { type = JDBC; className = org.jetel.connection.jdbc.DBConnection;  }
		connection { type = JMS; className = org.jetel.connection.jms.JmsConnection;  }

DEBUG [main] - Plugin org.jetel.engine loaded.
	id - org.jetel.engine
	version - 2.5.6
	provider-name - null
		dictionaryEntry { type = string; className = org.jetel.graph.dictionary.StringDictionaryEntryProvider;  }

DEBUG [main] - Plugin org.jetel.jdbc loaded.
	id - org.jetel.jdbc
	version - 2.5.6
	provider-name - null
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.DB2Specific; name = DB2; database = DB2;  }
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.InformixSpecific; name = Informix; database = INFORMIX;  }
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.MSSQLSpecific; name = MS SQL; database = MSSQL;  }
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.MySQLSpecific; name = MySQL; database = MYSQL;  }
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.OracleSpecific; name = Oracle; database = ORACLE;  }
		jdbcSpecific { class = org.jetel.connection.jdbc.specific.impl.PostgreSpecific; name = PostgreSQL; database = POSTGRE;  }
		jdbcDriver { jdbcSpecific = MYSQL; dbDriver = org.gjt.mm.mysql.Driver; urlHint = jdbc:mysql://hostname:3306/database; name = MySQL; database = MYSQL; driverLibrary = lib/mysql/mysql-connector-java-5.1.5-bin.jar;  }
		jdbcDriver { jdbcSpecific = POSTGRE; dbDriver = org.postgresql.Driver; urlHint = jdbc:postgresql://hostname/database; name = PostgreSQL; database = POSTGRE; driverLibrary = lib/postgre/postgresql-8.3-603.jdbc3.jar;  }

DEBUG [main] - Plugin org.jetel.lookup loaded.
	id - org.jetel.lookup
	version - 2.5.6
	provider-name - null
		lookup { type = simpleLookup; className = org.jetel.lookup.SimpleLookupTable;  }
		lookup { type = dbLookup; className = org.jetel.lookup.DBLookupTable;  }
		lookup { type = rangeLookup; className = org.jetel.lookup.RangeLookupTable;  }

DEBUG [main] - Plugin org.jetel.sequence loaded.
	id - org.jetel.sequence
	version - 2.5.6
	provider-name - null
		sequence { type = SIMPLE_SEQUENCE; className = org.jetel.sequence.SimpleSequence;  }
		sequence { type = PRIMITIVE_SEQUENCE; className = org.jetel.sequence.PrimitiveSequence;  }

DEBUG [main] - Plugin org.jetel.thirdparty loaded.
	id - org.jetel.thirdparty
	version - 2.5.6
	provider-name - null
		component { type = XML_EXTRACT; className = org.jetel.component.XMLExtract;  }
		component { type = FILTER; className = org.jetel.component.Filter;  }
		component { type = LDAP_READER; className = com.linagora.component.LdapReader;  }
		component { type = LDAP_WRITER; className = com.linagora.component.LdapWriter;  }

DEBUG [main] - Plugin org.jetel.tlfunction loaded.
	id - org.jetel.tlfunction
	version - 2.5.6
	provider-name - null
		tlfunction { className = org.jetel.interpreter.extensions.MathLib; function = sqrt,log,log10,exp,round,pow,pi,e,random,abs; libraryName = math;  }
		tlfunction { className = org.jetel.interpreter.extensions.DateLib; function = today,dateadd,datediff,trunc,trunc_date; libraryName = date;  }
		tlfunction { className = org.jetel.interpreter.extensions.StringLib; function = concat,uppercase,lowercase,substring,left,right,trim,length,soundex,replace,split,char_at,is_blank,is_ascii,is_number,is_integer,is_long,is_date,remove_diacritic,remove_blank_space,get_alphanumeric_chars,translate,join,index_of,count_char,chop,remove_nonprintable,remove_nonascii,find,cut; libraryName = string;  }
		tlfunction { className = org.jetel.interpreter.extensions.ConvertLib; function = num2str,date2str,str2date,date2num,str2num,try_convert,base64byte,byte2base64,bits2str,str2bits,hex2byte,byte2hex,num2num,num2bool,bool2num,str2bool,long2date,date2long,to_string; libraryName = convert;  }
		tlfunction { className = org.jetel.interpreter.extensions.ContainerLib; function = remove_all,push,pop,poll,remove,insert,sort,copy,reverse; libraryName = container;  }

DEBUG [main] - Plugin cloveretl.engine.initiate loaded.
	id - cloveretl.engine.initiate
	version - 1.0
	provider-name - null
		dictionaryEntry { type = initiate.member; className = com.initiatesystems.etl.dictionary.MemberDictionaryProvider;  }
		component { type = MEMSEQNO_INCREMENT; className = com.initiatesystems.etl.component.MemSeqNoIncrementer;  }
		component { type = INITIATE_REFORMAT; className = com.initiatesystems.etl.component.InitiateReformat;  }
		connection { type = INITIATE; className = com.initiatesystems.etl.connection.InitiateConnection;  }
		component { type = MEMGET_DATA_READER; className = com.initiatesystems.etl.component.MemGetDataReader;  }
		component { type = MEMPUT_DATA_WRITER; className = com.initiatesystems.etl.component.MemPutDataWriter;  }
		component { type = MEMSEARCH; className = com.initiatesystems.etl.component.MemSearch;  }
		jdbcSpecific { class = com.initiatesystems.etl.connection.jdbc.specific.impl.InitiateDefaultSpecific; name = Initiate default; database = INITIATE_DEFAULT;  }
		jdbcSpecific { class = com.initiatesystems.etl.connection.jdbc.specific.impl.InitiateDB2Specific; name = Initiate DB2; database = INITIATE_DB2;  }
		jdbcSpecific { class = com.initiatesystems.etl.connection.jdbc.specific.impl.InitiateInformixSpecific; name = Initiate Informix; database = INITIATE_INFORMIX;  }
		jdbcSpecific { class = com.initiatesystems.etl.connection.jdbc.specific.impl.InitiateOracleSpecific; name = Initiate Oracle; database = INITIATE_ORACLE;  }
		jdbcSpecific { class = com.initiatesystems.etl.connection.jdbc.specific.impl.InitiateMSSQLSpecific; name = Initiate SQL Server; database = INITIATE_SQLSERVER;  }
		jdbcDriver { jdbcSpecific = INITIATE_DB2; dbDriver = com.initiatesystems.db.jdbc.db2.DB2Driver; urlHint = jdbc:initiatesystems:db2://hostname:50000;DatabaseName=database;DynamicSections=1000; name = Initiate DB2; database = INITIATE_DB2; driverLibrary = lib/madjdbc.jar;  }
		jdbcDriver { jdbcSpecific = INITIATE_INFORMIX; dbDriver = com.initiatesystems.db.jdbc.informix.InformixDriver; urlHint = jdbc:initiatesystems:informix://hostname:1533;DatabaseName=database;InformixServer=server;InitializationString=(set lock mode to wait); name = Initiate Informix; database = INITIATE_INFORMIX; driverLibrary = lib/madjdbc.jar;  }
		jdbcDriver { jdbcSpecific = INITIATE_ORACLE; dbDriver = com.initiatesystems.db.jdbc.oracle.OracleDriver; urlHint = jdbc:initiatesystems:oracle://hostname:1521;SID=sid;ServerType=dedicated;WireProtocolMode=2; name = Initiate Oracle; database = INITIATE_ORACLE; driverLibrary = lib/madjdbc.jar;  }
		jdbcDriver { jdbcSpecific = INITIATE_SQLSERVER; dbDriver = com.initiatesystems.db.jdbc.sqlserver.SQLServerDriver; urlHint = jdbc:initiatesystems:sqlserver://hostname:1433;DatabaseName=database;SelectMethod=cursor; name = Initiate SQL Server; database = INITIATE_SQLSERVER; driverLibrary = lib/madjdbc.jar;  }
		component { type = MEMSCORE; className = com.initiatesystems.etl.component.MemScore;  }
		component { type = MEM_DICTIONARY_WRITER; className = com.initiatesystems.etl.component.MemDictionaryWriter;  }
		component { type = MEM_DICTIONARY_READER; className = com.initiatesystems.etl.component.MemDictionaryReader;  }
		component { type = ADDRESS_DOCTOR_TRANSLITERATION; className = com.initiatesystems.etl.component.AddressDoctorTransliteration;  }
		component { type = ADDRESS_DOCTOR; className = com.initiatesystems.etl.component.AddressDoctor;  }
		component { type = GROUP1; className = com.initiatesystems.etl.component.Group1;  }
		component { type = MEMDELETE_DATA_WRITER; className = com.initiatesystems.etl.component.MemDeleteDataWriter;  }

INFO  [main] - Graph definition file: graphs/agata.grf
INFO  [main] - Checking graph configuration...
INFO  [main] - Graph configuration is valid.
INFO  [main] - Graph initialization (parsing)
INFO  [main] - register MBean with name:org.jetel.graph.runtime:type=CLOVERJMX_1290538684513_0
INFO  [WatchDog] - [Clover] Initializing phase: 0
DEBUG [WatchDog] -  initializing edges: 
DEBUG [WatchDog] -  all edges initialized successfully... 
DEBUG [WatchDog] -  initializing nodes: 
DEBUG [WatchDog] - Opening input file C:/Documents and Settings/dmelnyk/workspace_ordev_3/ordev/graphs/eid_report.out
DEBUG [WatchDog] - Reading input file C:/Documents and Settings/dmelnyk/workspace_ordev_3/ordev/graphs/eid_report.out
DEBUG [WatchDog] - 	DATA_READER0 ...OK
INFO  [WatchDog] -  (compiling dynamic source) 
INFO  [WatchDog] - compile Class: Parsing by Janino compiler
ERROR [WatchDog] - Error when creating object of class: Line 19, Column 7: Invalid character input "@" (character code 64)
org.codehaus.janino.Scanner$ScanException: Line 19, Column 7: Invalid character input "@" (character code 64)
	at org.codehaus.janino.Scanner.internalRead(Scanner.java)
	at org.codehaus.janino.Scanner.read(Scanner.java)
	at org.codehaus.janino.Parser.readOperator(Parser.java)
	at org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java)
	at org.codehaus.janino.Parser.parseClassBody(Parser.java)
	at org.codehaus.janino.Parser.parseClassDeclarationRest(Parser.java)
	at org.codehaus.janino.Parser.parsePackageMemberTypeDeclaration(Parser.java)
	at org.codehaus.janino.Parser.parseCompilationUnit(Parser.java)
	at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java)
	at org.codehaus.janino.Cookable.cook(Cookable.java)
	at org.codehaus.janino.Cookable.cook(Cookable.java)
	at org.codehaus.janino.Cookable.cook(Cookable.java)
	at org.jetel.util.compile.DynamicJavaCode.instantiateByJanino(DynamicJavaCode.java:187)
	at org.jetel.util.compile.DynamicJavaCode.instantiate(DynamicJavaCode.java:169)
	at org.jetel.component.RecordTransformFactory.loadClassDynamic(RecordTransformFactory.java:213)
	at org.jetel.component.RecordTransformFactory.loadClassDynamic(RecordTransformFactory.java:198)
	at org.jetel.component.RecordTransformFactory.createTransform(RecordTransformFactory.java:85)
	at org.jetel.component.Reformat.init(Reformat.java:246)
	at org.jetel.graph.Phase.init(Phase.java:154)
	at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:414)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:177)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:62)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at java.lang.Thread.run(Thread.java:595)
DEBUG [WatchDog] - 
DEBUG [WatchDog] - 			import java.io.ByteArrayInputStream;
			import java.io.IOException;
			
			import org.jetel.component.DataRecordTransform;
			import org.jetel.data.DataRecord;
			import org.jetel.data.parser.DataParser;
			import org.jetel.exception.ComponentNotReadyException;
			import org.jetel.exception.TransformException;
			
			
			public class Parsing extends DataRecordTransform {
			   
			   DataParser parser = new DataParser("${charset}");
			   DataRecord tmp;
			   DataRecord[] tmpArray;
			   int successField;
			   int lastDataField;
			
			   @Override
			   public boolean init() throws ComponentNotReadyException {
			      //last field must be auto-filling to inform parser to skip this field
			      //set eofAsDelimiter to before-last field, as record delimiter was stripped by Reader
			      targetMetadata[0].getField(targetMetadata[0].getNumFields() - 2).setEofAsDelimiter(true);
			      parser.init(targetMetadata[0]);
			      tmp = new DataRecord(targetMetadata[0]);
			      tmp.init();
			      tmpArray = new DataRecord[]{tmp};
			      successField = targetMetadata[0].getNumFields() - 1;
			      return super.init();
			   }
			   
			   @Override
			   public int transform(DataRecord[] inputRecords, DataRecord[] outputRecords)
			         throws TransformException {
			      boolean success = true;
			      tmp.reset();
			      try {
			         parser.setDataSource(new ByteArrayInputStream(inputRecords[0].getField(0).toString().getBytes("${charset}")));
			         tmp = parser.getNext(tmp);
			      } catch (Exception e) {
			         e.printStackTrace();
			         success = false;
			      }finally{
			         defaultTransform(tmpArray, outputRecords);
			         outputRecords[0].getField(successField).setValue(success);
			      }
			      return 0;
			   }
			
			   @Override
			   public void postExecute() throws ComponentNotReadyException {
			      try {
			         parser.close();
			      } catch (IOException e) {
			         // TODO Auto-generated catch block
			         e.printStackTrace();
			      }
			      super.postExecute();
			   }
			}
ERROR [WatchDog] - Phase initialization failed with reason: REFORMAT0 ...FAILED ! 
Reason: Transformation code is not compilable.
reason: org.codehaus.janino.Scanner$ScanException: Line 19, Column 7: Invalid character input "@" (character code 64)
REFORMAT0 ...FAILED ! 
Reason: Transformation code is not compilable.
reason: org.codehaus.janino.Scanner$ScanException: Line 19, Column 7: Invalid character input "@" (character code 64)
	at org.jetel.graph.Phase.init(Phase.java:159)
	at org.jetel.graph.runtime.WatchDog.executePhase(WatchDog.java:414)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:177)
	at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:62)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at java.lang.Thread.run(Thread.java:595)
Caused by: Transformation code is not compilable.
reason: org.codehaus.janino.Scanner$ScanException: Line 19, Column 7: Invalid character input "@" (character code 64)
	at org.jetel.component.RecordTransformFactory.loadClassDynamic(RecordTransformFactory.java:217)
	at org.jetel.component.RecordTransformFactory.loadClassDynamic(RecordTransformFactory.java:198)
	at org.jetel.component.RecordTransformFactory.createTransform(RecordTransformFactory.java:85)
	at org.jetel.component.Reformat.init(Reformat.java:246)
	at org.jetel.graph.Phase.init(Phase.java:154)
	... 6 more
ERROR [WatchDog] - !!! Phase finished with error - stopping graph run !!!
INFO  [WatchDog] - ----------------------** Final tracking Log for phase [0] **---------------------
INFO  [WatchDog] - Time: 23/11/10 14:07:29
INFO  [WatchDog] - Node                   Status     Port      #Records         #KB  Rec/s    KB/s
INFO  [WatchDog] - ----------------------------------------------------------------------------------
INFO  [WatchDog] - DATA_READER0           READY          
INFO  [WatchDog] -  %cpu:..                          Out:0            0           0      0       0
INFO  [WatchDog] - REFORMAT0              ERROR          
INFO  [WatchDog] -  %cpu:..                           In:0            0           0      0       0
INFO  [WatchDog] -                                   Out:0            0           0      0       0
INFO  [WatchDog] - TRASH0                 N/A            
INFO  [WatchDog] -  %cpu:..                           In:0            0           0      0       0
INFO  [WatchDog] - ---------------------------------** End of Log **--------------------------------
INFO  [WatchDog] - Execution of phase [0] successfully finished - elapsed time(sec): 0
INFO  [WatchDog] - -----------------------** Summary of Phases execution **---------------------
INFO  [WatchDog] - Phase#            Finished Status         RunTime(sec)    MemoryAllocation(KB)
INFO  [WatchDog] - 0                 ERROR                              0              3405
INFO  [WatchDog] - ------------------------------** End of Summary **---------------------------
INFO  [WatchDog] - WatchDog thread finished - total execution time: 0 (sec)
INFO  [main] - Freeing graph resources.
ERROR [main] - Execution of graph failed !


Hello,
you use really old version of CloverETL. I strongly recommend to update CloverETL as such old version is not supported any more. Following code is valid for for CloverETL 2.9 and could work with your CloverETL:

import java.io.ByteArrayInputStream;

import org.jetel.component.DataRecordTransform;
import org.jetel.data.DataRecord;
import org.jetel.data.parser.DataParser;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.exception.TransformException;


public class Parsing extends DataRecordTransform {
   
   DataParser parser;
   DataRecord tmp;
   DataRecord[] tmpArray;
   int successField;
   int lastDataField;
   String charset;

   public boolean init() throws ComponentNotReadyException {
      //last field must be auto-filling to inform parser to skip this field
      //set eofAsDelimiter to before-last field, as record delimiter was stripped by Reader
      targetMetadata[0].getField(targetMetadata[0].getNumFields() - 2).setEofAsDelimiter(true);
      charset = parameters.getProperty("charset");
      parser = new DataParser(charset);
      parser.init(targetMetadata[0]);
      tmp = new DataRecord(targetMetadata[0]);
      tmp.init();
      tmpArray = new DataRecord[]{tmp};
      successField = targetMetadata[0].getNumFields() - 1;
      return super.init();
   }
   
   public int transform(DataRecord[] inputRecords, DataRecord[] outputRecords)
         throws TransformException {
      boolean success = true;
      tmp.reset();
      try {
         parser.setDataSource(new ByteArrayInputStream(inputRecords[0].getField(0).toString().getBytes(charset)));
         tmp = parser.getNext(tmp);
      } catch (Exception e) {
         e.printStackTrace();
         success = false;
      }finally{
         defaultTransform(tmpArray, outputRecords);
         outputRecords[0].getField(successField).setValue(success);
      }
      return 0;
   }

   public void finished() {
      parser.close();
      super.finished();
   }
}

You also need to add charset attribute to your Reformat node:

<Node charset="${charset}" id="REFORMAT0" transformURL="${TRANS_DIR}/Parsing.java" type="REFORMAT"/>