Use
Integration
· MappingTrace object to write messages to the trace.
· GlobalContainer object to exchange values between different user-defined functions.
· Map object to access mapping runtime constants.
Features
Methods of the Container Object
Method(s) | Use |
void | Saves the obj object under the name parName in a container for a user-specific function. |
Object | Returns the parameter that was saved under the parName name in this user-specific function by using the setParameter method. If no such parameter exists, getParameter returns null. |
AbstractTrace getTrace(); | Returns a MappingTrace object with which you can transfer messages to the mapping trace. |
GlobalContainer getGlobalContainer(); | Returns a GlobalContainer object with which you can save the values that can be read by any user-specific functions in the same message mapping. |
java.util.Map container.getTransformationParameters() | Returns a map with the mapping runtime constants. For a description of which constants you can access by using this map, see Java Mapping. The constants are attributes of the class com.sap.aii.mapping.api.StreamTransformationConstants (also see the example below). |
Example
The following source code queries the constant INTERFACE_NAMESPACE in a user-defined function, displays it as information by using the MappingTrace object and returns it as a result of the function:
AbstractTrace trace;
String headerField;
java.util.Map map;
trace = container.getTrace();
// get constant map
map = container.getTransformationParameters();
headerField = (String) map.get(
StreamTransformationConstants.INTERFACE_NAMESPACE);
trace.addInfo("INTERFACE_NAMESPACE:" + headerField);
return headerField;
At design time, the mapping runtime constants do not yet have any values. Therefore, the mapping editor only displays a test string for each constant in the test environment.
See also: Special Access to Mapping Runtime Constants.
No comments:
Post a Comment