Show TOC Start of Content Area

Function documentation Connection to PMI  Locate the document in its SAP Library 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.

Integration

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

SAP systems that exchange messages with other systems (for example, tRFC or the Runtime Workbench) are connected to PMI automatically.

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

For more information about process monitoring with PMI, see Process Monitoring with PMI (Process Monitoring Infrastructure). 

Interface Overview

Characteristic

Value

Name

AF PMI Access

Purpose

Create PMI data

Type

Java library

Technical name

Com.sap.aii.af.service.pmi

Certification

Optional

Syntax

See: JavaDoc (.\index) package com.sap.aii.af.service.pmi

Activities

      Use the PMIAccess class to set PMI events. The Adapter Framework calls the PMIAccess class.

      Adapters can implement the following PMIAccess methods to monitor the entire message processing:

PMIAccess Methods

Method Name

Meaning

invokeAdapterInboundAgent

Can be used by the adapter in the sender/inbound direction to report the arrival of a new message as soon 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.

The method must be called for the adapter in the sender/inbound direction if invokeAdapterInboundAgent was called previously.

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/outbound 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.

      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.aii.af.service.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

    }

 

End of Content Area