In Clover Engine 2.6 transform interface has been improved. Return value is int with meaning:
< -1 -- fatal error / user defined SKIP = -1 -- error / skip record >= 0 -- send to a specified output port ALL = Integer.MAX_VALUE -- send to all output ports
Mappings written in CTL don't require any modification. However, mapping written in java must be modified to a new form. There are two ways to migrate to Clover 2.6 – use import wizard or make changes by hand.
This wizard converts graphs with inline java code. Java sources in standalone files are not converted and you must make changes by hand.
Import by steps:
You must change all java classes implementing interface RecordTransform, RecordNormalize or RecordDenormalize or extends from abstract classes DataRecordTransform, DataRecordNormalize or DataRecordDenormalize. Change return type of transform method to int. For RecordDenormalize you must also rename method addInputRecord to append and method getOutputRecord to transform.
old code:
class MyTransform implements RecordTransform {
...
public boolean transform(DataRecord[] sources, DataRecord[] target) throws TransformException {
...
if(...) {
// success
return true;
} else {
// some problem occured, skip record
return false;
}
}
}
new code:
class MyTransform implements RecordTransform {
...
public int transform(DataRecord source, DataRecord target, int idx) {
...
if(...) {
// success
return ALL;
} else {
// some problem occured, skip record
return SKIP;
}
}
}
old code:
public class MyNormalize implements RecordNormalize {
...
public boolean transform(DataRecord source, DataRecord target, int idx) {
...
if(...) {
// success
return true;
} else {
// some problem occured, skip record
return false;
}
}
}
new code:
public class MyNormalize implements RecordNormalize {
...
public int transform(DataRecord source, DataRecord target, int idx) throws TransformException
...
if(...) {
// success
return OK;
} else {
// some problem occured, skip record
return SKIP;
}
}
}
old code:
public class MyDenormalize implements RecordDenormalize {
...
public boolean addInputRecord(DataRecord inRecord) {
return true;
}
public boolean getOutputRecord(DataRecord outRecord) {
...
if(...) {
// success
return true;
} else {
// some problem occured, skip record
return false;
}
}
new code:
public class MyDenormalize implements RecordDenormalize {
...
public int append(DataRecord inRecord) {
return 0;
}
public int transform(DataRecord outRecord) {
...
if(...) {
// success
return OK;
} else {
// some problem occured, skip record
return SKIP;
}
}