public abstract class AbstractTransformation extends Object
AbstractTransformation
.
The implementing class needs a default constructor
. For each
message a new instance is created with the default constructor
.
Afterwards setHelper(AbstractHelper)
is called before
transform(TransformationInput, TransformationOutput)
is called.
Example The following example shows how the MAPPING_TRACE and RECEIVER_NAME
parameters are set and evaluated in a Java mapping program:
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import java.util.HashMap;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
public class JavaMapping extends AbstractTransformation {
public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException {
getTrace().addInfo("...");
// ...
String receiverName = (String) in.getInputHeader().getReceiverInterface();
// ...
}
}
It is possible that different instances of the implementing class are
executed in parallel in different Threads
. Take care about
this when using static fields or static methods. Java mapping programs are
not permitted to be stateful. It is 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 also that you cannot call java.lang.System.exit()
or
java.lang.System.setProperties()
within a Java mapping and
that you cannot use a ClassLoader
in the classes of an
imported archive.
For reading files from an imported Archive
getClass().getResourceAsStream(String
name)
can be used.Modifier | Constructor and Description |
---|---|
protected |
AbstractTransformation() |
Modifier and Type | Method and Description |
---|---|
AbstractHelper |
getHelper()
Return an
AbstractHelper for this Java mapping program. |
AbstractTrace |
getTrace()
the the method returns null before the method setHelper is called. during
the mapping runtime this is executed: calling constructor(); calling
setHelper(...); calling transform(
|
void |
setHelper(AbstractHelper helper)
ONLY FOR XI INTERNAL USE!
|
abstract void |
transform(TransformationInput in,
TransformationOutput out) |
public abstract void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException
in
- the transformation inputout
- the transformation outputStreamTransformationException
- StreamTransformationExceptionpublic final AbstractTrace getTrace()
public final AbstractHelper getHelper()
AbstractHelper
for this Java mapping program.AbstractHelper
for this Java mapping program.public final void setHelper(AbstractHelper helper)
transform(TransformationInput, TransformationOutput)
is called to
set the AbstractHelper
object.helper
- the AbstractHelper
for this Java mapping program.Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.mapping.lib.facade
|
api
|
BC-XI
|
Copyright 2019 SAP AG Complete Copyright Notice