Customer Portal

passing ${VALUE} from graph to java

Comments 5

  • Avatar
    jraszyk
    0
    Comment actions Permalink
    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;
    }
    }
  • Avatar
    eyal
    0
    Comment actions Permalink
    hi,
    i tried it but the getGraph() is null.
    any idea why?
  • Avatar
    eyal
    0
    Comment actions Permalink
    thank you its working.
  • Avatar
    jraszyk
    0
    Comment actions Permalink
    Which class or interface does your Java class extend/implement? DataPartitionFunction or something else (PartitionFunction, ...)?
  • Avatar
    eyal
    0
    Comment actions Permalink
    when i tried implement PartitionFunction it didnt work
    then i changed to extend DataPartitionFunction and its ok now.

Please sign in to leave a comment.