This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
With the introduction of NetWeaver Process Orchestration 7.31, where NetWeaver PI AEX, NetWeaver BPM and NetWeaver BRM can be installed in the same instance, many users are asking about the migration of ccBPM to NetWeaver BPM or, just simply, how to develop a stateful system-centric message orchestration business process using NetWeaver Process Orchestration 7.31, instead of using ccBPM.
This article describes the basics of stateful system-to-system message orchestration using NetWeaver BPM. A simple use-case scenario will be used to demonstrate the design and configuration requirement of integrating NetWeaver PI and NetWeaver BPM to cover similar use cases as ccBPM.
Author: William Li
Company: SAP Labs LLC
Created on: May 30, 2012
Author Bio
William Li is a member of the SAP NetWeaver Orchestration and Integration Team in SAP NetWeaver Solution Management. He has been with SAP since 1998 - originally as a SAP America consultant, as a developer at SAPLabs and then as a SAP NetWearver RIG member focused on Process Integration. He joined SAP NetWeaver Solution Management in April of 2010.
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
Differences between ccBPM and NetWeaver BPM............................................................................................ 4
ccBPM to NetWeaver BPM ............................................................................................................................. 5
Recommendations during Development ............................................................................................................ 5
NetWeaver BPM Design and Configuration ....................................................................................................... 6
NetWeaver PI Interfaces ................................................................................................................................. 6
NetWeaver PI Scenarios (Integrated Configurations) ..................................................................................... 6
Required receiver configuration for NW PI NW BPM ................................................................................. 7
Required sender configuration for NW BPM NW PI ................................................................................... 7
NetWeaver BPM Design for Outbound Messages from NW PI to NW BPM .................................................. 7
NetWeaver BPM Design for Inbound Messages from NW BPM to NW PI ..................................................... 8
NetWeaver BPM Design for evaluating conditions (if-then-else) .................................................................... 9
Import all the service interfaces between NW BPM and NW PI ................................................................... 16
Create local variable ..................................................................................................................................... 24
Model the Process ........................................................................................................................................ 29 Configure the Start Event ........................................................................................................................................... 30
Create and Configure “Send PO Request” Event ...................................................................................................... 33
Create and Configure “Wait for PO Response” Event ................................................................................................ 36
Create and Configure Gateway to Check for PO Error .............................................................................................. 40
Configure “Write PO Error File” Activity...................................................................................................................... 43
Create and Configure Gateway to Check for Customer Info Error ............................................................................. 46
Configure the “Write CustInfo Error File” Activity ....................................................................................................... 49
Configure the “Write PO CustInfo File” Activity .......................................................................................................... 50
Delete the Previously Created “dummy” Service Groups ........................................................................................... 51
Deploy the NW BPM Process ....................................................................................................................... 53
Running the Scenario.................................................................................................................................... 54
Additional Information ....................................................................................................................................... 55
Enterprise Service Repository Content ......................................................................................................... 55
With SAP NetWeaver Process Orchestration 7.31 (PRO 7.31), using a java-only installation, NetWeaver PI (AEX), NetWeaver BPM and NetWeaver BRM can be installed in the same SID. Without the ABAP stack, ccBPM is no longer available. NW PI will continue to be supported on the dual stack (and thus ccBPM could continue to be used for these use cases) but the direction forward is to support these scenarios with NW Process Orchestration. NW BPM is now the platform to develop stateful message orchestration between systems.
Prior to PRO 7.31, the WS adapter was used for integration between NW PI and NW BPM. However, the WS adapter is an ABAP adapter, which is no longer available in a java-only installation. Instead, the XI proxy is used by AEX. The XI proxy not only provides reliable messaging as in the WS adapter, but it is also much more performance oriented. Since NW PI 7.11, the XI proxy is implemented through the SOAP adapter.
This article goes through the basic configuration requirement for NW PI and NW BPM in stateful system-centric message orchestrations. (There is no user-interaction, only system messaging is involved). A typical ccBPM scenario will be used as a comparison to what is needed during the migration to NW BPM. The focus of the article is on the configuration of NW BPM, along with the NW PI requirement during interface design and communication channel configuration. Prior knowledge of ccBPM is not required for this article.
Since this article is on NW BPM development, it is assumed that the reader is familiar with NW PI development. NW PI development will not be covered in this article. Some details of the contents of the Enterprise Service Repository (ESR) and the Integration Directory (ID) are included in section 6 (Additional Information).
For this article, the scenario is as follow:
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
The business process contains the following steps:
1. A message containing purchase order information is sent to NW BPM. 2. NW BPM sends the message to a backend ERP system to create a purchase order via NW PI. 3. ERP sends the result of the PO creation back to NW BPM. 4. NW BPM checks the result to determine if the PO creation was successful. 5. If PO creation is successful, then proceed to retrieve customer information from a database via NW
PI. If not, then issue an error message to an error file. 6. NW BPM checks the result of the customer information retrieval. 7. If the customer exists, then proceed to combine the PO information with customer information and
writes them out to a file. If customer does not exist, then write out the information to an error file.
The basic areas of interest are:
1. Asynchronous messaging between NW PI and NW BPM, with correlation. 2. Synchronous messaging between NW PI and NW BPM. 3. Leverage of NW PI as the ESB mediation and integration abstraction layer between the stateful NW
BPM layer and heterogeneous backend applications. 4. Condition evaluation of data contents to determine next processing step (if-then-else). 5. Mapping and merging of messages. 6. Stateful orchestration of multiple heterogeneous backend systems.
IMPORTANT: It is extremely important that the Process Orchestration (or NW BPM) release matches that of the NWDS release. If the NWDS release is newer than that of Process Orchestration (or NW BPM), then there will an error during the deployment process from NWDS to the JEE server.
The NWDS can be downloaded from the following link: (Authorization is required for access.) https://nwds.sap.com/swdc/downloads/updates/netweaver/nwds/nw/731/
Differences between ccBPM and NetWeaver BPM
ccBPM is based on the BPEL (http://en.wikipedia.org/wiki/BPEL) standard. NetWeaver BPM is based on the BPMN (http://en.wikipedia.org/wiki/BPMN) standard. SAP is a member of the BPMN standard and actively contributes to it in addition to fulfill the commitment to support it internally through its different solutions (including NW BPM and others). Unfortunately these two standards are so different, no automated migrations can be provided. The main radical different can be attributes to BPEL is based on a block structured graph types while BPMN is more flexible and does not follow a block structure flow type. When comparing ccBPM and NW BPM, we see the following:
No need for Abstract Interfaces in NW BPM
No need for Operations Mapping in NW BPM
All integrations between NW PI and NW BPM will be using the XI-protocol via the SOAP adapter
Receiver (or inbound) interfaces from NW PI to NW BPM will have to be defined as XI30-compatible
in NW PI
NW BPM can interact with single- and/or dual-stack NW PI systems
NW BPM will use a standards based graphical notation: BPMN
Below is a ccBPM design for the sample scenario and the equivalent NetWeaver BPM design:
Recommendations during Development
Since we are using AEX as we want to leverage the unified solution on the Java Stack, we must use Integrated Configuration; Receiver Determination is no longer available. During the integration development for NW BPM and NW PI, I found the following to be very useful and helped minimize confusion and errors. These practices are most likely already being used by NW PI developers, but they still warrant mentioning again:
Include service interface properties in the name of the service interfaces: o Whether the interface is synchronous or asynchronous o Whether the interface is inbound or outbound
For example: CreatePO_Async_Out
The interfaces will have to be imported into NW BPM. Knowing the properties of the interface by just looking at the name will help minimize mistakes and save time.
Include SOAP adapter properties in the name of the SOAP communication channels: o Whether the communication channel is a sender or receiver o Whether the communication channel is based on XI30-compatible or SOAP 1.1 protocol
For example: S_SOAP_XI30
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
XI-protocol is used for integration between NW PI and NW BPM. However, SOAP with XI 3.0 protocol cannot be tested using standard tools, e.g. soapUI. Since we want to test all the configurations first in NW PI before we use them in NW BPM, we must also configure standard SOAP communication channels for testing purposes. When we are ready to use them with NW BPM, we can just simply change the Integrated Configuration to use the SOAP communication channel with XI30 protocol. Having this property in the name will help to minimize mistakes and save time, and for us to move between testing and using it in NW BPM.
Note: It is important to test all the Integrated Configurations first before using them in NW BPM.
NetWeaver BPM Design and Configuration
NetWeaver PI Interfaces
The scenario mentioned before will interact with NW PI to send and receive data. The following is a list of all the interfaces that will drive collaboration between NW and NW PI and the direction in which the data will flow from one solution to the other one:
1. Start Message: NW PI NW BPM (async) 2. Send PO: NW BPM NW PI (async) 3. Return PO number: NW PI NW BPM (async) 4. Get Customer Info: NW BPM NW PI (sync) 5. Write result: NW BPM NW PI (async) 6. Write error: NW BPM NW PI (async)
NetWeaver PI Scenarios (Integrated Configurations)
1. Start Message:
2. Send PO Request:
3. Return PO Number:
4. Retrieve Customer Information:
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
During the inbound service interface design and receiver adapter configuration, we must use the XI 3.0 protocol:
In ESR, Receiver (inbound) Service Interface: Stateless (XI30-Compatible)
In ID, SOAP Receiver Communication Channel: o Message Protocol: XI 3.0 o Target URL: http://localhost:50000/MessagingSystem/receive/JPR/XI o Authentication: Use logon data to non-SAP system
Required sender configuration for NW BPM NW PI
During the sender adapter configuration, we must use the XI 3.0 protocol: (there is no need to use the XI30-Compatible interface)
In ID, SOAP Sender Communication Channel: Message Protocol: XI 3.0
NetWeaver BPM Design for Outbound Messages from NW PI to NW BPM
For our sample scenario, there are two activities where NW BPM will receive messages from NW PI. These 2 icons denote message exchange entities in the BPMN standard. They can be used to receive, send or wait for events from and to other systems. More information can also be found on the BPMN 2.0 standard specification to which NW BPM adheres to. These two entities are described below:
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
Event based on Intermediate Message (RFC NW PI NW BPM)
The tasks required for these two activities in NW BPM are: (property configuration)
Define Event Trigger: a trigger must be created in NW BPM to wait for a specific message from NW PI.
Assign service interface and operation for the trigger: assign the interface and operations for the trigger. This defines the interface which NW BPM is waiting on.
Create local variables based on the data type of the service interface: local variables must be created to hold the data elements when the message interface is received. The local variables are imported into NW BPM.
Create output mapping from service interface to local variable: Create the mapping from the received message to the local variable.
Create Correlation Condition for Intermediate Message (based on a field in the inbound interface and a local variable): create the correlation to determine which message will be assigned to which NW BPM process when there are multiple concurrent processes in progress.
NetWeaver BPM Design for Inbound Messages from NW BPM to NW PI
For our sample scenario, the following are the activities where NW BPM will send messages to NW PI. These complement the previously introduced icons for exchanging messages before:
Automated Activity (Asynchronous message: NW BPM NW PI RFC)
Automated Activity (Synchronous message: NW BPM NW PI JDBC)
Automated Activity (Asynchronous message: NW BPM NW PI File)
Automated Activity (Asynchronous message: NW BPM NW PI File)
The tasks for these activities in NW BPM are: (property configuration)
Assign service interface and operation for the activity: this defines what interface is to be sent to NW PI
Assign XI-protocol and sender component name to Service Reference: Set the protocol to XI, which is expected by NW PI and also set the sender component name, which is the NW BPM systems. This is to determine which Integrated Configuration in NW PI is to be used, based on sender system, interface name and namespace.
Create local variables based on the data type of the service interface (for both request and response): create the local variable which will be used when sending the message (for asynchronous and synchronous interfaces) and receiving the response (for synchronous interface).
Create input (request) mapping from local variable to request service: create the mapping between the local variable and the request message type.
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
Create output (response) mapping from service interface to local variable: create the mapping between the response message type and the local variable in a synchronous interface.
NetWeaver BPM Design for evaluating conditions (if-then-else)
The following is a list of the available branching icons in the BPMN notation knows as gateways. These two will be used in this exercise to define different branching points that an instance in the business process can follow based on context.
Gateway – Exclusive Choice
Gateway – Exclusive Choice
The only task involved is to create the Condition Evaluation using the GUI tool. The expressions follow the XPath standard to access information in XML documents. In addition, it is possible to leverage other components like BRM to make more complex analysis on the business process instance content and determine the branch in the process to take. The graphical drag and drop XPath expression editor is shown below:
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
The following are the general guideline I followed during the design and configuration of stateful system-centric messaging and orchestration between NW PI and NW BPM:
(Please note, for this document, my definition of a scenario is an end-to-end message going through NW PI between a sender system and a receiver system. So for this exercise, we have 5 scenarios.)
1. From the requirement, design and construct all the NW PI objects in the Enterprise Service Repository (ESR) and the Integration Directory (ID). These include mainly the following: a. Interface design in the ESR. b. Integrated Configuration creation in ID for each end-to-end scenario. c. Communication channel configurations. (For the SOAP adapter, configure 2 for each
communication channel that integrates with NW BPM. One with SOAP 1.1 protocol and one with XI30 protocol. The SOAP 1.1 protocol is for testing purposes. The XI30 protocol is for runtime with NW BPM.)
2. Document each NW PI scenario as in section 4.2. This will be extremely helpful during the NW BPM development phase.
3. Test each NW PI scenario, using the communication channel with SOAP 1.1 protocol. We will not be able to test the “Start Message”, as it is SOAP-to-SOAP in NW BPM, and NW BPM does not exist yet. For testing, I use soapUI. The “WSNavigator” in the SAP JEE can also be used. But, soapUI allows me to save my web service and data for testing. soapUI can be freely obtained from http://soapui.org .
4. After successful testing, change the relevant SOAP communication channels from using SOAP 1.1 to XI30. Please note, these are the SOAP communication channels that connect between NW PI and NW BPM.
After the completion of the above, we are now ready to develop the NW BPM process. For the steps below, we will assume all the NW PI artifacts in the ESR and ID are complete and ready to go. We will focus only on the NW BPM tool.
It is extremely important to highlight that this is in line with traditional SOA practices where the appropriate services are exposed for consumption by other composite entities. In our case, this will be NW BPM. This exercise follows this methodology. First, we identify the services that are needed. Then they are provisioned and fulfilled. Lastly, we are ready to create the higher abstraction orchestration layer that can create other value added services on top of these more granular services.
In NW BPM, I normally follow the high-level steps below:
1. Import all the NW PI-NW BPM interfaces into NW BPM. This is where the diagrams in section 4.2 become extremely useful. By looking at the diagrams we can see immediately the relevant interfaces. These interfaces will be used by NW BPM to send/receive messages to/from NW PI.
2. Create all the local variables which will be used to hold the information to integrate between NW BPM and NW PI, including the correlation variable. In this scenario, the correlation will be based on the order number. If there are any other local variables, we should also create them, e.g. we may use a counter in our business process.
3. Design the flow of the process. In this exercise, the NW BPM artifacts are: a. Start Event: already exist b. Automated Activity: to send message from NW BPM to NW PI c. Event based on intermediate message: to wait for message from NW PI d. Exclusive Choice Gateway: to evaluate the content of messages to determine next step
4. Configure the properties of each NW BPM artifact. 5. If we need to include additional steps in the business process, e.g. add another scenario, we should
still follow the same steps here and edit the NW BPM appropriately.
19 The wizard expects to assign a service reference to the imported interface even though it doesn’t make any sense for inbound interfaces. Unfortunately, the wizard cannot distinguish between inbound or outbound interfaces.
Select the option: Create new
Enter name: dummy1 (We
will delete this later.)
Click: Finish
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
In the Properties tab below the modeler, select Data Type. The sting data type is the default. This is what we want. However, if we have an integer variable, e.g. counter, we can define it as integer here.
Local variables based on the service interface.
After receiving a message, the content of that message will need to be put into a local variable so that we can use it during the business process, e.g. evaluating the content to determine next steps (if-then-else) or select the data to send to another system (retrieving or updating information on another system).
When sending a message, we will need to populate the outbound interface with contents of local variables. During this process, we can
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
also populate the outbound interface from contents of multiple local variables.
In our example, we will need the local variables based on the following interfaces:
StartMsg_Async_In: this is the interface which triggers the business process. It contains the PO create information. From the ESR, the data type is DT_orders.
Orders_Async_Out: this contains the PO create information. From the ESR, the data type is DT_orders.
po_Async_In: this contains the PO number and any messages associated with the PO creation. From the ESR, the data type is DT_po_number.
GetCustInfo_Sync_Out: this contains the request and response messages to retrieve customer information from a database. We don’t need a local variable for the request message, because we can get that from DT_orders, which contains the customer number. However, we will need the response message containing the retrieved customer information. From the ESR, the data type for the response message is DT_CustResp.
CustPO_Async_Out: this contains the PO and customer information which we will use to write out to files. The same interface is used for successful and error information. The content of the outbound interface can come from DT_po_number and DT_CustResp. Therefore, we don’t have any need of any
local variables from this interface.
In summary, we will need the following data types as local variable:
DT_orders
DT_po_number
DT_CustResp
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
37 In the Service dropdown, select: StartMsg_Async_in
This is the inbound message to start the business process.
The Operations is automatically selected.
Click: Finish
38 We will now need to populate the received message to a local variable so we can use it later in the process. We will also need to populate the local variable, orderNumber, which is used as the correlation id for the process.
In Properties, click: Output
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
51 We will now need to map the request message with the right data.
In Properties tab, select: Input Mapping
52 The local variable, orders, contains the data we need for the request. So, we will need to map orders to the Message Type, MT_orders
of the request interface.
Select record, under orders,
on the left side.
Drag-n-drop it to record under MT_orders on the right side.
Create and Configure “Wait for PO Response” Event
53 Create next step in the process, which is to wait for the PO create response. Since this is asynchronous, we will also need to include the correlation condition.
Select “Send PO Request” event, a context menu will appear.
Select: Event
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
63 The correlation will compare the orderNumber that is used to start the process and the order_number in the PO response message. If the condition is true, then the process will be used.
After the “string-equal”, enter a “(“.
On the right side, under ContextLocalMT_po, double-click on order_number. (this is the PO response message sent to NW PI)
Enter a “,” after it.
64 Under ContextGlobal, double-click on orderNumber.
It should appear on the left side in definition box.
Enter “)” to complete
condition expression.
Create and Configure Gateway to Check for PO Error
65 The next step is to create conditional check on whether the PO response is valid. An invalid response will have “ERROR” as the PO number.
Select “Wait for PO Response”.
From the context menu, select: Gateway
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
81 We need to map the request message to retrieve the customer info.
For the Input Mapping, map custNo to cust_number as
shown.
82 We also need to map the response message containing the customer info.
For the Output Mapping, map MT_CustResp to CustResp as shown.
Create and Configure Gateway to Check for Customer Info Error
83 The next step is to create conditional check on whether the Customer Info response is valid. An invalid response will have “ERROR” as the customer number.
Select “Get Cust Info”.
From the context menu, select: Gateway
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
86 Follow similar steps 68-74, create 2 automated activities to write the error file and to write a good file, and configure the Gateway condition evaluation.
We should end up with a completed process.
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
When we provide an invalid vendor id, then we get an error message.
With an invalid customer id, we get a different error message. The PO number was return, but the customer number has an error.
Additional Information
For this article, the NW PI designs and configurations in the ESR and ID are assumed and done beforehand. Only the NW BPM development steps are detailed.
For FYI purposes, without going into the step-by-step procedures, the ESR and ID artifacts used in this article is listed below.
Enterprise Service Repository Content
Each Scenario is contained in its own folder, along with the RFCs used:.
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
The Integration Directory configurations were done with Integrated Configuration. This is because the NW PI system is a Java-only installation.
NW BPM will work just as well with a dual-stack installation. The same configurations in NW BPM can be used. The only requirement is the XI30 protocol for the SOAP communication channel.
NetWeaver BPM for System-to-System Message Orchestration (Including Migration of ccBPM to NW BPM)
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com