Skip to Content

SAP PI custom adapter entry point/data flow

Apr 10, 2017 at 07:30 AM


avatar image

I'm working on a custom adapter that will need to connect to an EIS, fetch some data

and write it to a channel. My starting point was this tutorial (which modifies the default

file adapter present in sap po).

In the SPIManagedConnectionFactory there are a number of methods called by the

J2EE engine: start(), startMCF()/stop(), stopMCF().

The call hierarchy starts a local thread over the SPIManagedConnectionFactory

instance (as it implements Runnable):

start() --> startMCF() --> startRunnable()

which executes the run() method in a separate thread.

In run(), a ModuleProcessor object is instantiated:

ModuleProcessor mp = null;

mp = lookUpModuleProcessor(propWaitNum);

where the lookup method is:

private ModuleProcessor lookUpModuleProcessor(int retryNum) 
                           throws ResourceException {

final String SIGNATURE = "lookUpModuleProcessor()";
ModuleProcessor mp = null;
try {
    mp = 
    ModuleProcessorFactory.getModuleProcessor(true, retryNum, propWaitTime);
} catch (Exception e) {
    throw re;
    TRACE.debugT(SIGNATURE, XIAdapterCategories.CONNECT_AF, "Lookup of XI AF    MP entry ejb was succesfully.");
    return mp;

Later in the code, the run() method invokes method runChannel()

that connects to an HTTP end point and retrieves a response as a byte array.

It then calls createMessage() which creates

message object, wraps it around a ModuleData object and it sends it to the


// Process the module
ModuleProcessorFactory.getModuleProcessor(true, 1, 1000).process(channel.getObjectId(), md);

Thus, it seems that the SPIManagedConnectionFactory object is a client to the adapter.

Is this correct?

Is the factory object sending data to the adapter which is later processed by a

CCIInteraction object in method execute()?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Fariha Kazi Oct 26, 2017 at 05:36 AM

Hello ,

May be its too late. But for others.

Adapter has three parts.

1) session management

2) Transaction managemnt

3) Security management

CCIInteraction class deals with transaction management for Receiver Adapter..

The call method here is the place where you send data to your EIS and.expect a response if synchronous.

The Session has already been established in the SPIManagedConnection when you arrive at this point.



10 |10000 characters needed characters left characters exceeded