Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
Created December 22, 2015 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SriniBlog/5fa3e71e5943051849c7 to your computer and use it in GitHub Desktop.
Save SriniBlog/5fa3e71e5943051849c7 to your computer and use it in GitHub Desktop.
This method is used in SAP PI Mapping UDF to write the Dynamic Configuration
public boolean setDynamicConfiguration(String Namespace, String FieldName, 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(Namespace, FieldName);
//Write the 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