10.8 Combining SAP BPM and the AEX
When developing an SAP BPM process, it’s important to use SAP BPM for what it was made for. Whenever the process uses an automated activity to call a service, it’s a good idea to consider making the service call the AEX. By doing so, we’re basically letting SAP BPM focus on human- and system-centric orchestration and letting the AEX focus on what it does best—play the role of an ESB.
This approach involves wrapping all the service calls to be made by SAP BPM via AEX. The communication between SAP BPM and AEX can be achieved using plain Simple Object Access Protocol (SOAP) or the XI 3.0 message protocol. For communication with the SAP backend, it’s also possible to use an RFC connection.
As we’ve discussed in the past sections, an automated activity is used to call services. You can specify the type of service call and the message protocol via the service reference, as shown in Figure 10.69.
The possible values to choose from in the Type dropdown are as follows:
-
RFC
Represents the RFC protocol. To be used when directly connecting SAP BPM to an SAP backend—bypassing the AEX. -
WS
Represents a web service or SOAP message protocol. -
XI
Represents the XI 3.0 message protocol.Figure 10.69 Choice of Type or Message Protocol to be Used When Calling a Service Interface from SAP BPM
After selecting the message protocol, further configurations will be needed in SAP NetWeaver Administrator after the SAP BPM processes have been deployed in the SAP NetWeaver server. These configurations will be explored in Chapter 11. When dealing with an asynchronous message, we recommend using the XI 3.0 message protocol, which is the preferred way to integrate the AEX and SAP BPM runtime.
To be more specific, SAP BPM can interact with the AEX when dealing with the following flow objects:
-
Start message
AEX can send a message to SAP BPM that acts as a trigger for the SAP BPM process. It requires an inbound service interface. -
Automated activity
SAP BPM calls a service exposed via AEX. It requires an outbound service interface to be used on the SAP BPM side. -
Intermediary event
A message is sent to the SAP BPM layer while passing through the AEX. It requires an inbound service interface to be imported on the SAP BPM side.
In the configuration of the Integrated Configurations (ICOs) or integrated flows (iFlows) in the AEX, you’ll need to represent SAP BPM by using a communication component (a business component). Another way that SAP BPM can take advantage of the AEX is by leveraging and reusing an operation mapping developed in the ES Repository. In the next sections, we’ll explore the configuration steps required to exchange messages between SAP BPM and the AEX.
10.8.1 Message from SAP BPM to the AEX
When calling a web service or sending a message from SAP BPM to the AEX, follow these steps:
- Import the outbound service interface used in SAP BPM’s automatic activity from the ES Repository.
- Assign the service interface to the automated activity in SAP BPM. Then, assign a service reference; it’s important to be aware that the default type of the message protocol is automatically set to WS. If you want to use the XI 3.0 message protocol, then you’ll need to change the Type field to XI (Figure 10.69).
- When configuring ICOs or iFlows, use a business component to represent the SAP BPM process.
- Create a communication sender channel that receives a message from SAP BPM. The sender communication channel can be configured by using the details specified in Table 10.14.
- Ensure that the outbound service interface used in the ICOs/iFlows is the same as the one used in the automated activity in SAP BPM.
Attribute Name | Attribute Values |
---|---|
Adapter type | SOAP |
Direction | Sender |
Message protocol | XI 3.0 |
Table 10.14 Configuration Details of a Sender Communication Channel Receiving a Message from SAP BPM
Note
Using the XI 3.0 message protocol enables message reliability in communications between SAP BPM and the AEX. This is especially important for asynchronous calls to and from SAP BPM.
10.8.2 Message from the AEX to SAP BPM
When sending a message from the AEX to SAP BPM, follow these steps:
- Model and configure the SAP BPM process to fit your requirements.
- Import the inbound service interface to be used in SAP BPM (in the start or intermediary event) from the ES Repository.
- When configuring the ICOs or iFlows, use a business component to represent the SAP BPM process.
-
Create a communication receiver channel to send the message to SAP BPM. The receiver communication channel can be configured using the details specified in Table 10.15.
Attribute Name Attribute Values Adapter type SOAP Direction Receiver Transport protocol HTTP Message protocol XI 3.0 Target URL http://<hostname>:<port>/MessagingSystem/receive/JPR/XI Table 10.15 Configuration Details of a Receiver Communication Channel Sending a Message to SAP BPM
- Ensure that the inbound service interface used has the Stateless (XI30-compatible) interface pattern. This same inbound service interface can be used in the SAP BPM process as a trigger for a start event or intermediate event (depending on your situation).
Note
The following limitations apply when dealing with XI 3.0 as the message protocol between the AEX and SAP BPM:
- The WSDL or service interface used must be imported from the ES Repository.
- The service interfaces in the ES Repository (to be used for communication between the AEX and SAP BPM) must use the XI 3.0 compatible pattern.
- Messages with attachments and acknowledgements aren’t supported by SAP BPM.
10.8.3 Leverage an ES Repository Mapping in SAP BPM
You can leverage the operation mappings created in the ES Repository. You typically need to import the operation mapping into the SAP BPM project. An operation mapping imported from the ES Repository is then treated as a stateless web service with the mapping’s input acting as a request of the web service and its output acting as a response of the web service. This is commonly called mapping as a service (MaaS).
The MaaS concept enables you to use a fully featured mapping environment that SAP PI provides to build complex transformations and reuse them in SAP BPM, irrespective of whether the underlying mapping is a message mapping, Java, or XSLT. To reuse an existing SAP PI mapping in SAP BPM, follow these steps:
- Place an automated activity step in the BPMN diagram of your business process.
- Import the desired operation mapping from the ES Repository. In your SAP BPM project, right-click on Operation Mappings (PI), and select Import Operation Mapping.
- A login pop-up appears so you can access the ES Repository.
-
After a successful logon, select the desired operation mapping from the repository (Figure 10.70 1).
Figure 10.70 Importing an Operation Mapping in the SAP BPM Process
- Click on the Finish button.
- The operation mapping is now present in the SAP BPM project, under Operation Mappings (PI) and WSDL Files 2.
- Go back to the SAP BPM automated activity, and under the Property view and Interface tab, select the imported service interface and operation.
-
From the Service Reference dropdown, select the New dropdown option to create a service group (Figure 10.71).
Figure 10.71 Create a New Service Reference for a Service Called from an Automated Activity
-
In the new pop-up, fill in the details, and select the Local Provider System checkbox (Figure 10.72).
Figure 10.72 Sample Details for Creating a New Service Reference
- Click on the Finish button. The result is a fully configured automated activity that calls and reuses an operation mapping. See the finished result in Figure 10.73.
Figure 10.73 Configuring the Imported Service Interface Properties in the Interface Tab
In most cases, the operation mapping to be used should be based on the asynchronous service interfaces. In addition, if you’ve imported an operation mapping containing a request and response message mapping, then only the request message mapping will be taken into account.
Note
To successfully import the operation mapping from the ES Repository, you need to configure the following settings in SAP NetWeaver Developer Studio:
- Enterprise Service Browser (Section 10.1.2).
- SAP PI tools configuration (Chapter 6, Section 6.1.2).