Skip to Content

PI Java - Access Adapter Additional Parameters into UDF

Jan 18, 2017 at 04:14 PM


avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Manoj K Jan 18, 2017 at 04:53 PM


If you want to re-use the same UDF for multiple parameters and namespace check this.



10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov 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.

10 |10000 characters needed characters left characters exceeded
tarika manchanda 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.

10 |10000 characters needed characters left characters exceeded