Skip to content

Instantly share code, notes, and snippets.

@viksingh
Forked from SriniBlog/setDynamicFileName.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/d82c194080ede37d45bea1d895f14035 to your computer and use it in GitHub Desktop.
Save viksingh/d82c194080ede37d45bea1d895f14035 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