hi,
i want to pass the ${VALUE} from the partition transformer to the java class it is running, how can i do that?
Graph parameters can be accessed by calling getGraph().getGraphProperties() method.
So in case of Partition a very small example that sends data to output port given by graph parameter “partitionSetting” would be like this:
public class MyPartition extends DataPartitionFunction {
@Override
public int getOutputPort(DataRecord arg0) throws TransformException {
return Integer.parseInt(getGraph().getGraphProperties().getProperty("partitionSetting"));
}
@Override
public boolean supportsDirectRecord() {
return false;
}
}
hi,
i tried it but the getGraph() is null.
any idea why?
thank you its working.
Which class or interface does your Java class extend/implement? DataPartitionFunction or something else (PartitionFunction, …)?
when i tried implement PartitionFunction it didnt work
then i changed to extend DataPartitionFunction and its ok now.