cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping PI 7.1 - Dynamic Configuration

Former Member
0 Kudos

Hi Everybody,

I have written a JAVA map and inside which I am reading file name from the header.

ASMA is also checked in the adapter.

I need to take the filename at runtime and pass it to a field.

Below is the piece of code I have written for Dynamic Configuration.

private Map param;

DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

String MyFileName = dynamicconfiguration.get(key);

I am getting a runtime error when I test the mapping (End to End).

Is something wrong with the code shown above?

Something specific needs to be done wrt PI 7.1??

Helpful Answers will be rewarded points.

Thanks & Regards,

RK

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks

rajasekhar_reddy14
Active Contributor
0 Kudos

>

> private Map param;

>

> DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");

>

> DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

> String MyFileName = dynamicconfiguration.get(key);

>

The code looks correct,instead of developing a Java mapping,whu dont you create as UDF ,my advice create UDF and map to root node it will def work.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); 
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName"); 
 String newfilename= dynamicconfiguration.get(key);
 
conf.put(key, newfilename);
return "";

> I am getting a runtime error when I test the mapping (End to End).

>

Test interface end to end,then only Dynamic conf will work

Regards,

Raj

former_member204873
Contributor
0 Kudos

check these blogs and verify your steps:

/people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14