Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
Created December 22, 2015 16:45
Show Gist options
  • Save SriniBlog/e60c6facdc1d5ebb5f35 to your computer and use it in GitHub Desktop.
Save SriniBlog/e60c6facdc1d5ebb5f35 to your computer and use it in GitHub Desktop.
This method is used in SAP PI Mapping UDF to write the FileName Dynamic Configuration
public boolean setDynamicFileName(String FieldValue, Container container) throws StreamTransformationException{
boolean success = false;
try{
//Get the DynamicConfiguration instance
DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Define key to write in the Dynamic Configuration
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
//Write the FileName parameter from the Dynamic Configuration based on the key
config.put(key1, FieldValue);
success = true;
}catch(Exception ee){
success = false;
}
return success;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment