In my scenario I have the need to set default identical yet dynamic values on multiple output tables.
I have a global ctl file which I import into transformations.
Within this I have set up a number of maps for the fields to be written depending on type and I can then check the output metadata for those fields and write them where found with the relevant setValue function.
Now, the issue comes where I want to write these on multiple output ports as I cannot reference the ports if they don’t exist on the particular reformat I’m using.
For instance:
ReformatA has 2 output ports
ReformatB has 1 output port
If my method sets $out.0 and $out.1 then Clover will throw an error initializing as ReformatB does not have 2 output ports.
So I want to pass the record itself into the method as a parameter rather than specifically write to the output port in the code, that way I can do it dynamically… problem being CTL doesn’t seem to support the datatype of “record” as an input parameter.
The other option is being able to dynamically check for the connected ports within the function and handle it accordingly.
Does anyone have an idea as to how I can achieve this or am I just banging my head against a brick wall here?
For now I have created a ctl file for each input port with the exact same function in it (allbeit referencing different ports) and I then just include the ones I need but this is far from ideal as I need to import multiple ctl files each time and then use a different method name for each output port.
Any and all help much appreciated.
Cheers
Simon