bpm mdm integration

80
SAP NetWeaver How-To Guide How to Integrate Master Data Management (MDM) and Business Process Management (BPM) Applicable Releases: SAP NetWeaver Master Data Management 7.1 Topic Area: Enterprise Information Management Capability: Master Data Management Version 2.10 July 2010

Upload: ved-aralkar

Post on 27-Oct-2014

62 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: BPM MDM Integration

SAP NetWeaver

How-To Guide

How to Integrate Master Data

Management (MDM) and Business

Process Management (BPM)

Applicable Releases:

SAP NetWeaver Master Data Management 7.1

Topic Area:

Enterprise Information Management

Capability:

Master Data Management

Version 2.10

July 2010

Page 2: BPM MDM Integration

© Copyright 2010 SAP AG. All rights reserved.

No part of this publication may be reproduced or

transmitted in any form or for any purpose without the

express permission of SAP AG. The information contained

herein may be changed without prior notice.

Some software products marketed by SAP AG and its

distributors contain proprietary software components of

other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are

registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel

Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390,

OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP,

Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix,

i5/OS, POWER, POWER5, OpenPower and PowerPC are

trademarks or registered trademarks of IBM Corporation.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader

are either trademarks or registered trademarks of Adobe

Systems Incorporated in the United States and/or other

countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered

trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame,

WinFrame, VideoFrame, and MultiWin are trademarks or

registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or

registered trademarks of W3C®, World Wide Web

Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems,

Inc., used under license for technology invented and

implemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP

NetWeaver, and other SAP products and services

mentioned herein as well as their respective logos are

trademarks or registered trademarks of SAP AG in

Germany and in several other countries all over the world.

All other product and service names mentioned are the

trademarks of their respective companies. Data contained

in this document serves informational purposes only.

National product specifications may vary.

These materials are subject to change without notice.

These materials are provided by SAP AG and its affiliated

companies ("SAP Group") for informational purposes only,

without representation or warranty of any kind, and SAP

Group shall not be liable for errors or omissions with

respect to the materials. The only warranties for SAP

Group products and services are those that are set forth in

the express warranty statements accompanying such

products and services, if any. Nothing herein should be

construed as constituting an additional warranty.

These materials are provided “as is” without a warranty of

any kind, either express or implied, including but not

limited to, the implied warranties of merchantability,

fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including

without limitation direct, special, indirect, or consequential

damages that may result from the use of these materials.

SAP does not warrant the accuracy or completeness of the

information, text, graphics, links or other items contained

within these materials. SAP has no control over the

information that you may access through the use of hot

links contained in these materials and does not endorse

your use of third party web pages nor provide any warranty

whatsoever relating to third party web pages.

SAP NetWeaver “How-to” Guides are intended to simplify

the product implementation. While specific product

features and procedures typically are explained in a

practical business context, it is not implied that those

features and procedures are the only approach in solving a

specific business problem using SAP NetWeaver. Should

you wish to receive additional information, clarification or

support, please refer to SAP Consulting.

Any software coding and/or code lines / strings (“Code”)

included in this documentation are only examples and are

not intended to be used in a productive system

environment. The Code is only intended better explain and

visualize the syntax and phrasing rules of certain coding.

SAP does not warrant the correctness and completeness of

the Code given herein, and SAP shall not be liable for

errors or damages caused by the usage of the Code, except

if such damages were caused by SAP intentionally or

grossly negligent.

Disclaimer

Some components of this product are based on Java™. Any

code change in these components may cause unpredictable

and severe malfunctions and is therefore expressively

prohibited, as is any decompilation of these components.

Any Java™ Source Code delivered with this product is only

to be used by SAP’s Support Services and may not be

modified or altered in any way.

Page 3: BPM MDM Integration

Document History

Document Version Description

2.10

Terminology updated to reflect changes in the user interface of the

MDM Web Dynpro Configuration Manager

2.00 The How To Consume MDM Web Dynpro Components v1.0 guide has

been split into the following two guides:

How To Build Web Applications Using MDM Web Dynpro

Components

Explains how MDM Web Dynpro components are consumed by other custom Web Dynpro components to create a Web Dynpro application with the flexibility to run as a stand-alone application or

in a portal environment.

Note

During the course of this guide, there are references to the How To Build Web Applications Using MDM Web Dynpro Components guide which is available on SAP Developer Network (SDN) at

http://www.sdn.sap.com/irj/sdn/howtoguides.

The direct link to the guide is: https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/600

333e0-9bf7-2c10-1f99-bf5dcf661949

How To Integrate MDM and BPM

This guide concentrates on how to integrate MDM and BPM using MDM Web Dynpro components and Web services. This is the

current v2.0 you are reading.

1.00 First official release of this guide – How To Consume MDM Web Dynpro

Components

Page 4: BPM MDM Integration

Typographic Conventions

Type Style Description

Example Text Words or characters quoted

from the screen. These

include field names, screen

titles, pushbuttons labels,

menu names, menu paths,

and menu options.

Cross-references to other

documentation

Example text Emphasized words or

phrases in body text, graphic

titles, and table titles

Example text File and directory names and

their paths, messages,

names of variables and

parameters, source text, and

names of installation,

upgrade and database tools.

Example text User entry texts. These are

words or characters that you

enter in the system exactly as

they appear in the

documentation.

<Example

text>

Variable user entry. Angle

brackets indicate that you

replace these words and

characters with appropriate

entries to make entries in the

system.

EXAMPLE TEXT Keys on the keyboard, for

example, F2 or ENTER.

Icons

Icon Description

Caution

Note or Important

Example

Recommendation or Tip

Page 5: BPM MDM Integration

Table of Contents

1. Business Scenario .......................................................................................................... 1

2. Prerequisites.................................................................................................................... 3

3. Consuming an MDM Web Dynpro Component in a BPM Process ................................ 5

4. Consuming MDM Web Dynpro Components and MDM Web Services ........................ 14

5. Passing MDM Semantic Data Between BPM Process Steps Using a Wrapper

Application ..................................................................................................................... 55

6. BPM and UWL Mapping using worklistVariable ........................................................... 73

Page 6: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 1

1. Business Scenario

Business Process Management (BPM)

SAP NetWeaver BPM is used to build composite business processes, mainly service-based processes

that support both human-centric and system-centric workflows (human interaction and process

integration).

SAP NetWeaver Master Data Management (MDM) – Web Dynpro Components

SAP NetWeaver MDM provides consistent, accurate, timely master data that is accessible across an

enterprise from a centralized database called the MDM repository.

The SAP NetWeaver MDM Web Dynpro Configuration Manager (WD Configuration Manager) is a

wizard-based tool that exposes MDM repository metadata and is used for configuring MDM Web

Dynpro components. These components are reusable units of code that are used as building blocks

for developing modular Web applications; they can also be extended with Java coding. They are

consumed (as used components), by custom developed Web Dynpro wrapper applications and can be

used for customizing or applying different types of business logic to suit a variety of business

scenarios such as Business Process Management (BPM).

There are two ways in which an MDM Web Dynpro component can be consumed in a BPM process:

Directly, by referencing a Web Dynpro component from a BPM scenario (this is only applicable

for an Item Details component)

For example, MDM Web Dynpro components can be embedded during design time in a BPM process without any coding.

Indirectly, by referencing a custom wrapper application from a BPM scenario

Typically a BPM process would involve a combination of MDM Web Dynpro components and MDM

Web services. For example you can have a BPM process consisting of an automated step using MDM

Web services (for creating a new record), and a human step using MDM Web Dynpro components (for

modifying a record, or as a final approval step).

The examples in this guide focus on master data creation scenarios. There are two approaches on

how to model a BPM process when creating and maintaining an MDM record:

Not saving the record in the MDM repository until the final step

In this case, all the record data is passed between the BPM steps stored in the BPM context. An example of this approach can be seen in the example, Passing MDM Semantic Data

Between BPM Process Steps Using a Wrapper Application on page 55.

CAUTION

The BPM context stores the data that controls the execution of a workflow. For performance reasons, it is not recommended to keep the entered master data in the

BPM context since you have to pass the complete master data from step to step.

From the start, saving the record after each step (ensuring that the record exists in the

repository).

This is done by using the Web Service CheckOutAsNew functionality or the Checkout Records

operation for existing records. In this case, only the record ID is passed between the BPM

steps using the BPM context.

Page 7: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 2

Examples of this approach are:

Consuming an MDM Web Dynpro Component in a BPM Process on page 5.

Consuming MDM Web Dynpro Components and MDM Web Services on page 14.

In the final step, you can either:

Check in the record using the Web service Check In Records operation.

Roll back the record using the Web service Roll Back Records operation. This deletes

the record if it is checked out as new or it reverses the changes for the checked out

record.

Examples

The following sections of this guide show examples of how to consume Web Dynpro components in a

BPM process:

The first example is a simple BPM process that only includes a human task.

For more information, see Consuming an MDM Web Dynpro Component in a BPM Process on page 5.

The second example shows how to configure a BPM process that consumes MDM Web Dynpro

components and MDM Web Services. It includes both human and automated tasks.

For more information, see Consuming MDM Web Dynpro Components and MDM Web Services

on page 14.

The third example demonstrates two main aspects of BPM and Web Dynpro integration:

Firstly we show you how to create a Web Dynpro wrapper application consisting of an

MDM Web Dynpro Item Details component, which includes semantic data entered by the

user.

We then show you how to create a BPM process that consumes the above wrapper

application and passes the semantic data to the BPM context.

For more information, see Passing MDM Semantic Data Between BPM Process Steps Using a Wrapper Application on page 55.

A Universal Worklist (UWL) only displays information related to a BPM task and does not give

any details regarding the actual record on which the task needs to be performed. This example

shows how to map key identifying data (for example, customer name, part number), for a record

belonging to a BPM task, to a worklistVariable. This data is then displayed in the UWL enabling

the user to easily identify the record on which to perform the task.

For more information, see BPM and UWL Mapping using worklistVariable on page 73.

Page 8: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 3

2. Prerequisites ...

Prior knowledge of Web Dynpro and BPM. For more information, see SAP Help Portal at

help.sap.com.

You have read the guide, How to Build Web Applications Using MDM Web Dynpro

Components, which is available on SAP Developer Network (SDN) at

http://www.sdn.sap.com/irj/sdn/howtoguides.

The direct link is How To Build Web Applications Using MDM Web Dynpro Components.

Before you can develop a BPM process that consumes MDM WD components, the following

must be in place:

SAP NetWeaver Composition Environment (CE) 7.11 SP04 (or higher) and SAP

NetWeaver Application Server (AS) Java is installed and running.

SAP NetWeaver Developer Studio (NWDS) is installed and running and is the same

version as the SAP NetWeaver AS Java you are running.

You are using SAP NetWeaver MDM 7.1 SP04 or higher.

The MDM repository is mounted and loaded.

MDM JAVA API 7.1.is deployed.

For more information, see http://service.sap.com/installmdm71 MDM Java

and .NET API Developer Guide Obtaining the Java API Libraries and Reference and

also Deploying the Java API and MDM Connector Using JSPM.

MDM JAVA WD FRAMEWORK 7.1 7.11 is deployed.

For more information, see http://service.sap.com/installmdm71 MDM Web

Dynpro Components Guide Deploying the MDM Web Dynpro Components

Framework.

You have run the MDM Web Dynpro Configuration Manager application, and configured

your components.

For more information, see http://service.sap.com/installmdm71 MDM Web

Dynpro Components Guide Configuring a Project in the MDM WD Configuration

Manager.

You have imported the MDM Web Dynpro and MDM Java API software components (SC) to

your workspace as follows:

a. In the SAP NetWeaver Developer Studio (NWDS), choose the Development

Infrastructure perspective as follows:

Window Open Perspective Other Development Infrastructure.

b. Import the MDM_JAVA_API software component to your LocalDevelopment development

track as follows:

i. In the context menu of the LocalDevelopment track, choose Import SC… to open

the Import Software Component screen.

ii. Browse for the MDMJ710<SP-Number>_P<Patch-Number>.sca file.

c. Import the MDM_JAVA_WD_FRAMEWORK software component to your development track

exactly as you did in step b above for the API. You import the MDMJAVAWDFRW<SP-

Number>_P<Patch-Number>.sca file.

Page 9: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 4

Two new software components appear in the LocalDevelopment track – MDM_JAVA_API

and MDM_JAVA_WD_FRAMEWORK.

d. Add a new dependency to the MyComponents SC, for the MDM_JAVA_API and

MDM_JAVA_WD FRAMEWORK software components.

You have created a Destination to establish a connection to the MDM repository.

For more information, see http://service.sap.com/installmdm71 MDM Web

Dynpro Components Guide Creating a Destination for the MDM Repository.

Page 10: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 5

3. Consuming an MDM Web Dynpro Component

in a BPM Process

This example is a simple BPM process that only includes an Update operation (human task). We

demonstrate how to directly reference an Item Details WD component from a BPM process.

This is the result that we want to achieve:

...

Procedure

Important

Ensure that you have carried out all the prerequisite steps.

For more information, see Prerequisites on page 3.

Create a new development component (DC) project

Info

You have already imported the Web Dynpro software component (SC) to your workspace. You are now going to create a new development component (DC) project.

1. In the SAP NetWeaver Developer Studio (NWDS), choose the Process Composer perspective

as follows:

File New Process Composer Development Component.

2. Choose the software component (SC) where you want the development component (DC) project

to be created (that is, in the LocalDevelopment track, select the MyComponents software

component).

Info

Local Development is the name of a local development track, within which there is a software component called MyComponents.

Page 11: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 6

3. Name the new DC project, test/mdmprocess.

Set the dependencies

Info

DCs can depend on one another and use each other. To enable a DC to use the functionality of another DC, you have to publish their functions in a set of public interfaces called public parts and a dependency to the public part of the DC must be

declared. When you declare dependencies, you should select only those public parts that

your component actually uses.

4. Choose the Development Infrastructure perspective.

5. In the context menu of the test/mdmprocess DC, choose Show In Component Properties.

Page 12: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 7

6. In the Dependencies tab, add dependencies to the Public Parts of the relevant component – in

this example it is the tc/mdm/wdcomps/itemdetails/wd component.

7. Choose Next and Finish to complete this activity.

Create a new BPM process

8. In the context menu of the Processes node, create a new process called MDMProcess.

Add a new task

9. Go back to the Process Composer perspective and expand the new test/mdmprocess DC.

Page 13: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 8

10. In the context menu of the Tasks node, add a new task to the project.

11. Name the new task, Update Record Data.

12. Choose Finish to create the Update Record Data task.

Define the User Interface

13. From the tab of the new Update Record Data task, choose the Overview tab.

14. Choose the Item Details component and its Public Part, ITEM_DETAILS.

Page 14: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 9

15. Choose Next to select the Item Details component and its Interface View,

ItemDetailsCompInterfaceView.

16. Choose Next and select the completeTaskEvent as the Completion Event.

Page 15: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 10

17. Choose Finish to complete defining the user interface.

Assign potential owners for the new task

18. Navigate to the Roles tab and choose the User, Role, or Group defined in the User

Management Engine (UME).

19. Search for and add the UME user. For this example, we have selected Administrator.

CAUTION

Be sure that the user is a trusted MDM user.

For more information, see the MDM Web Dynpro Guide Defining a Trusted

Connection on SAP Service Marketplace at http://service.sap.com/installmdm71

20. Save the changes. The task is now configured.

Define the BPM process flow

21. In the context menu of the new MDMProcess, open the Process Modeler.

Page 16: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 11

22. Add the Update Record Data task to the MDMProcess (drag and drop).

23. Use the sequence flow connectors to connect the steps of the process.

Page 17: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 12

Define input mappings for the new process

24. In the Properties tab of the Update Record Data task, choose Input Mapping and enter the

internal record ID of the record that needs updating.

25. Specify the Item Details configuration and enter the name of the project, the name of the

component, and the ID in inverted commas.

26. Save the changes.

27. Build and deploy the new DC.

Page 18: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 13

Start the new BPM process

CAUTION

Ensure that the user ID has been assigned to the following two roles:

Every User Core Role (eu_core_user)

Adds the Home TLN (portal Top Level Navigation) entry that includes the UWL for accessing BPM tasks at runtime

BPEM End User (com.sap.bpem.Enduser)

Enables running a BPM job

For more information, see SAP Help Portal at http://help.sap.com/ SAP NetWeaver

SAP NetWeaver CE. Open the SAP Library documentation that corresponds to your SAP

NetWeaver CE version. Open the Developer’s Guide Modeling Processes with Process

Composer.

28. To run the process, see the next example, Consuming MDM Web Dynpro Components and

MDM Web Services Start the BPM Process.

Page 19: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 14

4. Consuming MDM Web Dynpro Components

and MDM Web Services

Background:

In this example, we show you how to configure a BPM process that consumes both an MDM Web

Dynpro component (human step), as well as an MDM Web service (automated step).

Note

All screen captures were taken from SAP NetWeaver CE 7.2.

Process

The process in our example includes three main steps consisting of one automated task and two

human tasks: ...

1. Create new record – an automated task using the Create Records MDM Web service operation.

Recommendation

You may want to allow one or more users to edit a record over an extended period of time as part of a collaborative process. You also want this record to be invisible to others until the user is ready to commit the changes, and only then make the record visible to all users. In this case, consider using the Web Service CheckoutAsNew functionality.

CheckoutAsNew functionality is integrated into the Create Records Web service

operation.

You can also use the Create Records operation to check out a new (rather than an existing) record, thus creating a private new record.

In the final step, you can either:

Check in the record using the Web service CheckIn Records operation

Roll back the record using the Web service Rollback Records operation (this

deletes the record if it is checked out as new, or it reverses the changes for the

checked out record).

2. Update the created record – a human task, directly referencing an MDM Item Details WD

component.

3. Approve/Reject – a human task directly referencing an MDM Item Details WD component,

which has been configured with a toolbar including custom buttons.

Page 20: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 15

This is the result we want to achieve:

Repository Schema

This example is based on an MDM Material repository with the following schema:

One main table, Products

A Material_Number field code is used as the record identifier in the BPM process

Procedure

Important

Ensure that you have carried out all prerequisite steps.

For more information, see Prerequisites on page 3.

Generate the CreateRecords MDM Web service operation

...

1. Assign MDM_WS_Generator and MDM_WD_CONFIGURATOR actions to the relevant role.

For more information, see http://service.sap.com/installmdm71 MDM Web

Dynpro Guide Installing the MDM Web Dynpro Environment.

2. Using the MDM Web Service Generator wizard, generate and deploy an MDM_CreateRecords

Web service operation. Take note of the following steps in the wizard:

In step 2, select the Create action on the Main table.

Page 21: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 16

In step 3, select the Material_Number field as the record identifier.

For more information, see http://service.sap.com/installmdm71 MDM Web

Services Guide Generating a New Web Service.

Configure the Item Details WD component

3. Using the MDM WD Configuration Manager, add a new Project and configure an Item Details WD component.

For more information, see http://service.sap.com/installmdm71 MDM Web Dynpro

Components Guide Configuring a Project in the MDM WD Configuration Manager.

Important

Be sure that you select the Complete Task Button in step 1 of the Item Details wizard.

Create a BPM development component (DC) project

For more information, see Consuming an MDM Web Dynpro Component in a BPM Process on

page 5 Create a new development component (DC) project.

4. Name the new DC, mdmbpm. This is the result:

5. In the Development Component perspective, add a dependency to the Item Details component:

Create a new BPM Process

6. In the context menu of the Processes node, create a new process and name it

MDM_BPM_Process.

Page 22: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 17

7. Complete the steps of the wizard and keep all default entries.

Add a human task (UpdateRecord)

8. From the Process Composer perspective, expand the new mdmbpm DC.

9. Using the context menu of the Task node, add a new human task to the project, and name it

UpdateRecord.

Define the User Interface

10. Select the ItemDetailsComp Interface View.

11. Select completeTaskEvent as the Completion Event.

For more information, see Consuming an MDM Web Dynpro Component in a BPM Process on

page 5 Define the User Interface.

Page 23: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 18

Assign a Potential User

12. For assigning a potential owner for the new task, search for and add the UME user. For this

example, we have selected Administrator (a trusted MDM user).

For more information, see Consuming an MDM Web Dynpro Component in a BPM Process on

page 5 Assign Potential Owners for the new task.

The human task, UpdateRecord is now configured.

Add an automated task

The automated task invokes the Create Records Web service operation (which we have already

created in step 2 above).

13. Locate the Web Service Description Language (WSDL) for the MDM_CreateRecord Web

service (deployed from the Web Service Generator) as follows:

a. From the SAP NetWeaver Administrator (NWA), navigate to SOA Management

Application and Scenario Communications Single Service Administration.

Page 24: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 19

b. From the Service Definitions tab, search for the deployed Web service,

MDM_CreateRecordVi.

Result

14. From the WSDLs tab, choose the WSDL link.

15. Copy the WSDL URL from the browser. For example:

http://<hostname>:<port>/MDM_CreateRecord/HTTPNone?wsdl&style=document

&mode=ws_policy

Import the WSDL to the BPM Process

16. In the context menu of the WSDL Files node, choose Import WSDL....

17. Enter the URL of the WSDL (copy and paste from the previous step).

Page 25: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 20

18. Choose Next to create a new Service Group for the CreateProduct Web service task and

enter the Name and Description – for example, MDM_BPM_SG.

Note

This name will later be used in the NWA to configure a Provider System and Service

Group.

For more information, see Configure the WS system provider and related properties below.

Page 26: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 21

19. Choose Finish to achieve the following result:

Note

The ApproveReject human task will be defined later.

Define the BPM process flow

20. Drag and drop the MDM_CreateRecordVi task (automated task), to the process drawing

palette and call it createProducts.

21. Drag and drop the UpdateRecord task (human task) to the process drawing palette and call it

UpdateRecord.

Page 27: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 22

22. Connect both steps into a single process using the sequence flow connectors.

Page 28: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 23

Define input and output mapping

For the createProducts step:

23. Select the createProducts step and choose Input Mapping.

Page 29: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 24

24. Enter the value MDM_BPM as input to the destinationName element (MDM_BPM is the MDM

destination you defined as a prerequisite before starting this procedure).

25. Enter the value false as input to the applyNullValuesToMdm element.

Page 30: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 25

26. Enter the value None as input to the checkoutAsNew element.

27. Enter the value New Product Material Number as input to the materialNumber element

(this string will be updated in the Material Number MDM field by the CreateProduct Web

service).

Page 31: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 26

28. Choose Output Mapping for the createProducts step.

Page 32: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 27

29. Create a BPM artifact by dragging and dropping the dataObject on to the drawing palette and

renaming it Record_ID.

Page 33: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 28

30. Map the output of the createProducts step to the Record_ID by connecting the

dataObject from the response to the Record_ID of the process context.

Page 34: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 29

31. Because we are mapping a dataObject from a list (the response of the Web service), to a

string, there is a compilation error (a red x on the link). To solve this, double click the link to

open a Rules and Functions popup window and select string-join().

32. Use the string-join function, with an empty string separator (“”).

The following is the result:

Before:

createCustOrgResponse/Response/ExecutionStatus/dataObject

After:

string-join(createCustOrgResponse/Response/ExecutionStatus/

dataObject,"")

Page 35: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 30

For the UpdateRecord step:

33. Select the UpdateRecord step and map the Record_ID from the process context as input to

the internalId element.

Page 36: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 31

34. Reference the MDM WD component configurations by assigning the names of the Web Dynpro

project (MDM_UpdateRecord) and Item Details component (UpdateRecord) configurations as

input to the projectConfigName and componentConfigName respectively (these are the

names you configured in the MDM WD Configuration Manager).

Page 37: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 32

35. Save, build, and deploy the new process.

Configure the WS Provider System and related properties

Note

This part of the procedure is only relevant for the Web service automatic step, createProduct.

There are three configuration steps:

System Connections: Communication Profile

System Connections: Provider System

Applications Communications: Configuration

Page 38: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 33

System Connections: Communication Profile

36. Create a new Provider System for the Web service as follows:

From the SAP NetWeaver Administrator, (NWA), navigate to SOA Management Technical

Configuration System Connections, and choose the Communication Profiles tab.

37. Choose New to open the New Profile wizard.

38. Complete the two steps of the wizard:

In the General step, name the new Communication Profile MDM_BPM_Profile.

Page 39: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 34

In the Connectivity Type step, leave the default values for the Authentication properties, Reliable Messaging, and Transport Binding settings.

The result is:

Page 40: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 35

System Connections: Provider System

39. Choose the Provider Systems tab.

40. Choose New to open the New Provider System wizard.

Page 41: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 36

41. Complete the steps of the wizard as follows:

Step 1 – Provider System

System Type = Java

DB Host = the host name where the Web service is deployed

Step 2 – Connectivity Types

a. Check WS in the Connectivity Type column to expand the screen where you update the additional properties.

b. Select MDM_BPM_Profile from the Profile Name dropdown list (this is the Communication Profile you configured in the previous step).

c. Select WSDL.

Page 42: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 37

d. Update the URL field with the MDM_CreateRecord Web service WSDL URL (generated above):

http://<hostname>:<port>/MDM_CreateRecord/HTTPNone?wsdl&style=doc

ument&mode=ws_policy

Page 43: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 38

You have now completed configuring a new Provider System called bpm on <hostname>.

Page 44: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 39

Applications Communications: Configuration

In this step we configure the inbound and outbound communication of the application. We will assign the newly created Provider System, bpm on <hostname> to the Service Group MDM_BPM_SG.

42. From the SAP NetWeaver Administrator (NWA), navigate to SOA Management

Application and Scenario Communication Application Communication.

43. Search for your deployed BPM project. You can enter *mdm*.

44. Select the project from the result. In this example the BPM project name is test-mdmbpm.

45. Choose Edit.

46. From the Consumed Services tab, choose Assign Provider System.

Page 45: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 40

47. Select bpm on <hostname>, which is the Provider System you created in the previous steps.

Page 46: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 41

You have completed the Application Configuration step. The result is as follows:

Page 47: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 42

Add a new human task (ApproveRecord)

You now configure the ApproveRecord task using the Item Details component with the Custom

Toolbar option.

48. Define a new Item Details component in the MDM WD Configuration Manager called ApproveRecord as shown in the following screen capture:

49. In the Custom Toolbar step of the WD Configuration Manager Item Details wizard, add the following two custom buttons on the toolbar: Approve and Reject.

Page 48: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 43

50. Update their Status Text with Record_Is_Approved and Record_is_Not_Approved respectively.

Info

The Status Text is a string value that is passed to the process context (using the BPMStatus parameter), when any of the custom buttons are pressed at runtime by the user.

51. Go back to the NWDS and from the Process Composer, perspective, expand the mdmbpm DC,

and add a new human task to the project using the context menu of the Task node.

52. Name this task ApproveRecord.

Page 49: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 44

53. Define the User Interface and assign a Potential User as we did for the UpdateRecord human task above.

54. Add the ApproveRecord human task to the process by dragging and dropping it on to the process drawing palette.

55. Link this task to the UpdateRecord task and connect it to the End step.

Define input and output mapping

56. Select the ApproveRecord step, and choose Input Mapping.

57. Set the Input Mapping for the process context Record_ID and map it as input to the internalId element.

Page 50: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 45

58. Assign the MDM WD Configuration Manager project, MDM_UpdateRecord, and the Item Details component configuration, ApproveRecord , to the projectConfigName and componentConfigName respectively.

Page 51: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 46

59. Define Output Mapping for the ApproveRecord step.

Create an artifact by dragging and dropping the BPMStatus (located under the IOData node), on to the drawing palette.

Note

This example demonstrates just one of the options for creating an artifact; there are others.

Page 52: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 47

60. Map the ApproveRecord output to the process context by mapping the BPMStatus to the DO_BPMStatus artifact.

61. Add an Exclusive Choice Gateway and connect the ApproveRecord step to this gateway.

62. Connect the gateway output to the UpdateRecord and End steps.

63. Rename the connections to the UpdateRecord step to Rejected and the connection to the End step to Approved.

64. For the Approved branch, select Condition and define the conditions for this gate as follows:

a. Drag and drop the DO_BPMStatus from the Context into the Condition editor.

Page 53: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 48

b. Apply the string function string-equal(DO_BPMStatus,"Record_Is_Approved")

where Record_Is_Approved is the status text when the Approved button is chosen. This condition means that if the DO_BPMStatus string value equals Record_Is_Approved, this branch is true and the process will continue down this path.

65. For the Rejected branch, select Condition and define the conditions for this gate as above.

Page 54: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 49

66. Check the property Make this gate the default to designate it as the default gate. (If the Approved condition fails, the Rejected branch is executed).

Start the BPM process

67. Log on to SAP NetWeaver Administrator.

68. Navigate to Configuration Management Processes and Tasks Process Repository.

69. Select the test~mdmbpm component.

Page 55: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 50

70. Choose Start Process to open a popup window.

Page 56: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 51

71. Choose Start Process again.

You should see a confirmation message below stating that the process started successfully.

Runtime

In this example, the first BPM task is automatic. Once the BPM process is started, you can already

see the newly created record in the MDM repository (created by the automated BPM step).

The second and third activities are human tasks. Portal users can see their BPM tasks in the UWL. In our example the user sees the UpdateRecord task and thereafter the ApproveRecord task.

Page 57: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 52

This is the process at runtime: ...

1. The UpdateRecord task appears in the UWL (as seen in the screen capture)

2. The user chooses the UpdateRecord link and a BPM popup window with the BPM task is

launched.

Page 58: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 53

3. The user updates the record fields and chooses Complete. The BPM process moves to the next

step which is ApproveRecord.

4. The ApproveRecord task appears in the user’s UWL inbox.

Page 59: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 54

5. The user selects the ApproveRecord task and a BPM popup window with the BPM task is

launched.

Note

The Reject and Approve buttons appear on the UI at the bottom.

6. The user chooses the Reject or the Approve button and moves the process to the next step.

Page 60: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 55

5. Passing MDM Semantic Data Between BPM

Process Steps Using a Wrapper Application

Background

This example shows how to use a BPM context to pass semantic data between steps in a BPM

process. The BPM context keeps the data that controls the execution of a workflow.

Recommendation

Due to BPM performance issues, we recommend that you keep the entered master data in the BPM context to a minimum (if at all), since you have to pass the complete master

data from step to step.

Process

The purpose of this example is to create a new Vendor master record in the MDM repository.

The overall process is as follows: ...

1. In the Item Details component from the wrapper application, a user enters values for Vendor

Name and Country.

2. This semantic data is then passed (using the BPM context), to a Web service Create Records

operation where the record is created in the MDM repository.

The procedure below shows you how this is achieved by covering two main aspects of BPM and Web

Dynpro integration:

In step 1 below, we show you how to create a Web Dynpro wrapper application consisting of an

MDM Web Dynpro Item Details component (CreateVendor). In this example, the MDM Web

Dynpro Item Details component includes semantic data in the Vendor Name and Country fields,

which has been entered by the user.

In step 2, we show you how to create a BPM process that consumes the above wrapper

application and passes the semantic data to the BPM context using the completeTask event.

Page 61: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 56

This is what we want to achieve:

Step 1: Create the Web Dynpro Wrapper Application that consumes an Item Details WD component

Important

Ensure that you have carried out all the prerequisite steps.

For more information, see Prerequisites on page 3. ...

Create a BPM development component (DC) project

Recommendation

We recommend that you refer to section Building a Stand-Alone Web Dynpro Component in the How-to Build Web Applications Using MDM Web Dynpro Components guide available on SAP Developer Network (SDN) at

http://www.sdn.sap.com/irj/sdn/howtoguides.

1. Name the Web Dynpro DC (wrapper application) semantic_mdm.

2. From the Development Infrastructure perspective, set the following dependencies for the new

semantic_mdm DC:

tc/mdm/wdcomps/itemdetails/wd

com.sap.mdm.tech.mdm4j (dependency to the MDM Java API)

Page 62: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 57

Create a new Web Dynpro component

3. In the context menu of the Components node of the semantic_mdm wrapper application,

create a new Web Dynpro component and call it SemanticMDM.

This is how it appears in the Web Dynpro Explorer:

4. Add a data link between the Component Controller and the Interface Controller of the Item

Details WD component.

Create and map the context nodes (Configuration and IOData)

5. Drag and drop the context from the Item Details component on the right to the Component

Controller context on the left.

Page 63: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 58

6. Map the context by dragging the elements from the left to the right (see screen capture below).

Add the semantic context nodes to store the new Vendor details

7. Add a context node NEW_VENDOR (with 1..1 cardinality).

a. Under NEW_VENDOR, add a COUNTRY context node (with 1..1 cardinality):

Add a COUNTRY_ID attribute (integer) to hold the internal ID of the selected

country.

Add a COUNTRY_NAME attribute (string) to hold the name of the selected country.

Page 64: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 59

b. Under NEW_VENDOR, add a VENDOR_NAME attribute (string), to hold the new vendor

name.

BPM Info

Since BPM is only aware of the Interface Controller context, we need to copy the context from the Component Controller to the Interface Controller.

8. Copy the context nodes in the Component Controller to the Interface Controller of the

SemanticMDM component as follows:

a. In the context menu of the following context nodes, choose Copy.

Configuration

IOData

NEW_VENDOR

Page 65: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 60

b. In the context menu of the Interface Controller, choose Paste.

Define a CompleteTask event for the wrapper application (for BPM)

At runtime, the user who has been assigned the task, enters the Vendor name, selects the Country,

and chooses the Complete button on the UI of the Item Details WD component. This activates the

CompleteTask event. You define the CompleteTask event as follows:

9. In the Component Controller of the SemanticMDM wrapper component, add a new

CompleteTask event.

Page 66: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 61

10. Copy and paste the CompleteTask event to the Interface Controller.

11. In the Component Controller, add a new Event handler that subscribes to the Item Details

CompleteTask event and call it completeTask.

12. Select the Item Details Interface Controller as the Event Source and the completeTaskEvent

as the Subscribed Event.

Page 67: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 62

13. Copy and paste the completeTask event to the Interface Controller.

14. Save and build the new DC.

Info

At this point, we want to link the values of the entered fields with the semantic context we added to the wrapper application. The BPM process can then pass these field values to

the next step in the process.

15. To do this, add the following code in the CompleteTask Event handler:

COMPANY_NAME – the Vendor Name field code in the MDM repository

COUNTRY – the Country field code

Page 68: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 63

16. In the SemanticMDMView view of the SemanticMDM component, add a

ViewContainerUIElement.

17. Open the SemanticMDMWindow, and add the Item Details interface view to the user interface

container.

18. Save the changes.

Page 69: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 64

Add a public part for the wrapper component to expose it in the BPM process

19. In the context menu of the SemanticMDM component, choose Add to Public Part.

20. Choose New, and enter a name for the public part. For example, SemanticMDM_PUBLIC.

Page 70: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 65

21. Choose Finish.

22. Uncheck ITEM_DETAILS and choose Finish.

23. Build the new semantic_mdm DC and deploy it.

Step 2: Create a BPM Process

In the following steps you create a BPM process that consists of the following:

A human task which involves the BPM process consuming the wrapper application (that you

have just created)

An automated task which includes an MDM Web service.

Recommendation

Reference the steps in the following procedure as a guideline: Consuming an MDM Web Dynpro Component in a BPM Process on page 5. We have highlighted some of the

changes that you will have to make.

Page 71: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 66

Create a DC for the BPM project

24. Name the DC of the BPM project, create_vendor.

25. Add a dependency to the SemanticMDM_PUBLIC public part of the semantic_mdm DC.

Add the new BPM process

26. In the Processes node in the Web Dynpro Explorer, create a process and call it

MDM_Create_Vendor.

Add the human task (CreateVendor)

27. From the Process Composer perspective, expand the new create_vendor process DC.

28. Using the context menu of the Task node, add a new human task to the process and name it

CreateVendor.

29. From the tab of the new CreateVendor task, choose the Overview tab.

Page 72: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 67

30. Define the User Interface by choosing the semantic_mdm DC and it’s Public Part,

SemanticMDM_PUBLIC.

Page 73: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 68

31. Choose Next to select the SemanticMDMInterfaceView of the semantic_mdm DC.

Page 74: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 69

32. Add the CreateVendor task to the MDM_Create_Vendor process by dragging and dropping it

on to the drawing palette.

Define input and output mapping

33. Add an artifact of type UIRequest to hold the new vendor data (this data will be passed

between the first human step, and the second automated step), by draging and dropping the

UIRequest on to the drawing palette.

Page 75: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 70

34. Rename it Vendor_Details.

Info

You now want the Item Details component to open as an empty form (with no values in the fields) so that you can populate the fields.

35. To configure this behavior, carry out the following procedure:

a. Ensure that in the MDM Web Dynpro Configuration Manager, the Item Details

component is configured to Start in Edit Mode.

b. Set a value of “–1“ (of type string) as the internalId for the Web Dynpro Item Details

component.

36. Reference the project and the component.

Page 76: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 71

37. Map the output of the CreateVendor human step to the Vendor_Details artifact.

38. Map the Vendor_Details artificact to the automated createMDM_Vendors Web service

step.

For more information on how to create an automated Web service step, see Consuming MDM Web Dynpro Components and MDM Web Services on page 14.

39. Double click on the fx icons above to open the following screens:

Page 77: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 72

a. Set the value NONE as input to the checkoutAsNew element in the

createMDM_Vendors automated Web service step (this is a mandatory parameter).

b. Use the following expression which applies to the mapping between the source

destination, which is COUNTRY_ID to the target destination, which is internalId.

40. Save your changes.

41. Build and deploy the DC.

Runtime

Page 78: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 73

6. BPM and UWL Mapping using

worklistVariable

Portal users access their BPM tasks via the Universal Worklist (UWL). However, the UWL by default,

only displays information related to a BPM task (for example, Modify Record Data), and does not give

any details regarding the actual record on which the task needs to be performed. Therefore the portal

user can see what task to perform but cannot easily identify which record he or she is working on.

In this example we explain how to map key identifying data (for example, customer name, part

number) for a record belonging to a BPM task to a worklistVariable. This data is then displayed

in the Subject column of the UWL enabing the user to easily identify the record on which to perform

the task. ...

1. From the Process Composer perspective, select any of the existing human tasks in the drawing

palette of the BPM (for example, Account Agent).

2. In the Properties tab, choose Input Mapping.

3. Map key identifying data (for example, COMPANY_NAME), from the context of the Task to the

worklistVariable of the artifact.

4. In the Web Dynpro Project Explorer tree, select the same human task (Account Agent).

5. Choose the User Texts tab.

6. Add a new variable.

7. Enter worklistVariable in the Expression field (in this example, the Expression Builder is

used to concatenate the worklistVariable with other constants).

8. Enter any name for the variable.

9. In the Type column, enter String.

Page 79: BPM MDM Integration

How to Integrate Master Data Management (MDM) and Business Process Management (BPM)

July 2010 74

10. In the Parameterized Texts area, enter the name of the variable in the Subject field.

Result

The result in the UWL shows the worklistVariable value which was mapped (COMPANY_NAME =

AB Company). The user can now see the record on which to perform the task.

Page 80: BPM MDM Integration

www.sdn.sap.com/irj/sdn/howtoguides