Skip to content

Instantly share code, notes, and snippets.

@viksingh
Forked from SriniBlog/getDynamicFileName.java
Created February 9, 2018 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksingh/0c84048e722d834651d71a8d5c70b4a6 to your computer and use it in GitHub Desktop.
Save viksingh/0c84048e722d834651d71a8d5c70b4a6 to your computer and use it in GitHub Desktop.
This method is used in SAP PI Mapping UDF to read the FileName from the Dynamic Configuration
public String getDynamicFileName(Container container) throws StreamTransformationException{
String FileValue = "";
try{
//Get the DynamicConfiguration instance
DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Define key to read from the Dynamic Configuration
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
//Read the FileName parameter from the Dynamic Configuration based on the key
FileValue = config.get(key1);
}catch(Exception ee){
FileValue = "";
}
return FileValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment