Skip to Content

PI Java - Access Adapter Additional Parameters into UDF

I have an UDF to do somethings and it has some hardcode values (variables) and we need to avoid the hardcoding.

I tryed configuring the hardcoded values as Additional Parameters into:

Communication Channel -> Parameters -> Advanced -> Advanced Mode -> Additional Parameters

But I don't know how to access them on the UDF. I tryed with the code bellow, but I get a null value:

DynamicConfiguration confTest = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey keyTest = DynamicConfigurationKey.create( "http:/"+"/","<ADDITIONAL PARAMETER NAME>");

String testString = confTest.get(keyTest);

int testInt = testString.length();

Does anyone know how to access them from UDF code?

Best Regards,

Gregory Mayorga.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 18, 2017 at 06:34 PM

    Hi Gregory!

    It's worth noting, that additional parameters for file adapter are described in SAP Note 801926. You can't use your own custom parameters.

    In addition to Manoj's answer: in order to make your UDF's more reusable you should use function arguments and parameters instead of hard-coded values. Further you can assign values to it using payload values or message/operation mapping parameters.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 11, 2017 at 10:23 AM

    Hi Gregory!

    Have you got any answer to your question?

    I have a similar requirement of reading deltasync.maxDateFromLastRun in the lookup udf. This parameter is defined under additional parameters in SFSF channel.

    Add comment
    10|10000 characters needed characters exceeded