Last active
December 14, 2015 15:57
-
-
Save SriniBlog/2447b8f79a41d5a9d07e to your computer and use it in GitHub Desktop.
Learn to write Dynamic Configuration in SAP PI Java Mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: Vanamala Srinivas | |
* Website: www.sriniblog.com | |
* Note: This is just a snippet and use it as a reference. | |
* Complete Blog: http://sriniblog.com/read-write-dynamic-configuration-in-sap-pi-using-java-mapping/ | |
*/ | |
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException | |
{ | |
trace = (AbstractTrace) getTrace(); //Capture trace object and write trace for debugging purpose. | |
DynConfig = arg0.getDynamicConfiguration(); //get the DynamicConfiguration Running Instance | |
if( DynConfig == null){ | |
throw new StreamTransformationException("Unable to load the Dynamic Configuration Object!"); | |
} | |
//Define the Key that we want to read | |
DynamicConfigurationKey Key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName"); | |
//Write Dynamic Configuration | |
try{ | |
DynConfig.put(Key, "This is a custom set"); | |
}catch(Exception ee){ | |
trace.addInfo("Unable to write the Dynamic Configuration!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment