-
Interface Summary
Interface |
Description |
Container |
|
GlobalContainer |
An instance of this class enables you to cache the values that you want to
read again when you next call any user-defined function in the same message
mapping.
|
ResultList |
You can use the ResultList.CC to find context changes in the input
array that the function was transferred to, for example:
a[index].equals(ResultList.CC)
|
Package com.sap.aii.mappingtool.tf7.rt Description
The documentation of this package describes classes for Function Libraries and user-defined functions in the Message Mapping and Mapping Template.
Before you can write source code in your IDE for Function Libraries and user-defined functions of a Message Mapping or Mapping Template, you must download the source code containing the signature of the functions
from the corresponding object editors.
Depending on the execution type you have choosen for a user-defined function in the object editor, different functions are available:
- Simple Functions (execution type = Single Values): This function type can process individual input values of a field for each function call. Therefore, simple functions expect single input values and return a string.
- Enhanced Functions (execution type = Values of a context or execution type = All values of the queue): This function type can process multiple input values of a field for each function call. Before you call the function, you can either import all the field values of a context or the whole queue for the field in an array.
Note that when dealing with large messages, saving the entire queue requires a lot of memory at runtime. In such cases it is therefore better to work with contexts.
For both function types you can use the following objects in the source code:
- Container:
This object enables you to cache the values that you want to read again when you next call the same user-defined function.
- GlobalContainer:
This object enables you to cache the values that you want to read again when you next call any user-defined function that is in the same message mapping.
For the advanced functions you have additionally
- ResultList:
This object returns the result of an advanced function.
Via the
Container and
GlobalContainer object, you can use objects from the Mapping API.
You find the documentation of these objects in the package
com.sap.aii.mapping.api.
Use the Lookup API to access resources. The API is described in the package
com.sap.aii.mapping.lookup
Java mapping programs are not permitted to be stateful. You are therefore not permitted to perform actions
such as writing data to a database table during a Java mapping. The Integration Server cannot
track such side effects. Therefore, if an attempt is made to resend a message that has not been received
by the receiver, the data may inadvertently be written to the database twice in a Java mapping.
Note for Java mapping programs (user-defined functions and Imported Archives), the programming restrictions imposed on J2EE application providers and especially the restrictions imposed on J2EE EJB providers are valid.
This means for example, you should not
- load and use JDBC drivers (use instead the Lookup API),
- use class loaders,
- use the package java.io (writing to or reading from file system),
- create and manage threads,
- change system properties (using java.lang.System.setProperties()),
- listen on, accept connections on, or multicast from a network socket.
For more on these restrictions, see chapter 25.1.2 of the EJB 2.1 specification.