Show TOC

Methods for Connecting to PMILocate this document in the navigation structure

Use

You have the option of connecting your adapter to the Process Monitoring Infrastructure (PMI). In the SAP environment, technical processes often extend beyond system boundaries (as is the case in Business Process Management, for instance). By connecting to PMI, you can monitor these processes.

PMI collects data from various different systems by means of PMI agents, which make their data available centrally for evaluation purposes.

More information: Process Monitoring Infrastructure

Prerequisites

Before PMI entries can be written, you must gain access to an object that implements PMIAccess. To do this, use the object PublicAPIAccess.

getPMIAccess() gives you a PMIAccess object.

More information: XI Message Interfaces

Integration

The PMI trace data is initially collected in the memory before being uploaded asynchronously to the PMI server. The effect on the monitored system and its performance is kept to a minimum.

SAP systems that are involved in cross-system message exchange (tRFC, for example) are automatically connected to PMI.

PMI is integrated with SAP Solution Manager. SAP Solution Manager joins the business process view with technical tracing that extends beyond system boundaries.

More information: Process Monitoring with PMI (Process Monitoring Infrastructure)

Interface Overview

Characteristic Value

Name

AF PMI Access

Purpose

Create PMI data

Type

Interface in facade com.sap.aii.af.ifc.facade

Technical name

com.sap.engine.interfaces.messaging.api.pmi

Certification

Optional

Syntax

JavaDoc package com.sap.engine.interfaces.messaging.api.pmi

Activities

Call the following methods in your adapter:

PMIAccess Methods

Method Name Meaning

invokeAdapterInboundAgent

Use the method in a sender adapter to log the receipt of a message as quickly as possible.

The method requires a message ID. It does not have to be an XI message ID if the MessageIDMapper is then used to map the message ID to an XI message ID.

More information: Generating, Persisting, and Mapping a Message ID

invokeCPALookupAgent

Records the address information for a given message ID.

If you have called invokeAdapterInboundAgent, the method must be called for a sender adapter.

invokeIDMappingAgent

Must be implemented in the adapter to make PMI aware of the mapping between the external ID and the XI message ID.

You must implement this method if invokeAdapterInboundAgent is called using an external message ID and the MessageIDMapper service is not used.

invokeAdapterOutboundAgent

Can be called in receiver direction so that outbound processing of the message is recorded.

If you call the method by using an external message ID, the adapter must call either
invokeIDMappingAgent
or use the MessageIDMapper to make PMI aware of the ID mapping.

invokeAFStatusAgent, invokeChannelDeterminationAgent, invokeXIRA…

For internal use only.

  • You do not need to include any other PMIAccess methods.
  • If the XI message ID is set in one of the methods listed above, it must be a hexadecimal string if you use callPMIAgent() and this is set to TRUE.
Example

The example below outlines an internal adapter method that sends a preconverted message (class MyMessage) to an external protocol. The XI message ID is forwarded as a second parameter as an IGUID to enable PMI monitoring and message ID mapping.

package com.mycompany.XI.adapter.impl;

import com.sap.aii.af.service.idmap.MessageIDMapper;

import com.sap.engine.interfaces.messaging.api.pmi.PMIAccess;

import com.sap.guid.IGUID;

public void sendMessage(MyMessage message, IGUID xmbmsgid) throws MyException {

try {

//Important: Use hex string XI message ID representation for PMI

//logging (inside mapper).The archiving interval for the ID mapping is set to 1 day

messageIDMapper.createIDMap(xmbmsgid.toHexString(),externalMsgId,

System.currentTimeMillis() + 1000*3600*24);

} catch(Throwable t) {

}

// Write PMI endpoint entry

try {

PMIAccess.invokeAdapterOutboundAgent(externalMsgId, "JMS", qos);

} catch (Throwable t) {

TRACE.catching(SIGNATURE,t); // Ignore

}