Invoking Transform class by passing params

I have a setup where in we have central sandbox and individual sandboxes. Central sandbox houses all common graphs which are invoked by individual sandboxes on need by basis.
I have a requirement, where in i need to transform certain data. So my reformat component will receive 3 params, A,B,C and i will set graph properties with these params.
something like getGraph().getGraphProperties().setProperty(VALUE_A, “A” );
something like getGraph().getGraphProperties().setProperty(VALUE_B, “B” );
etc…

To avoid redundancy, i was hoping of creating one transform class, keep it in central sandbox and have each individual sandbox invoke it through reformat component, by passing the param values.
Kind of like invoking method.

Is this possible?

Hi Varkashy,

Yes it is possible, put compiled transformation class on application server classpath (e.g. [tomcat]\lib) and then refer in “Transform class” property of Reformat.

Hi , thanks for your input.

By putting file in the class path i was able to invoke it across different sandboxes.
However, is there a way to pass params to the transform method of the class? i.e. passing params received by reformat component’s input port?

Hi Varkashy,

Yes, it is possible. Sample of reading input port is visible here: viewtopic.php?f=4&t=5444#p8588 in file passing_parameters.grf

There is simple trick to generate sample of Java code:

1. prepare graph including Reformat with sample CTL2 code accessing ports
2. in code editor, press “Convert to Java” int the top-right corner of dialog
3. you should see CTL2 code equivalent in Java