document centric process modeling using nw ce 7

18
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com © 2010 SAP AG 1 Document Centric Process Modeling using NW CE 7.20 Applies to: SAP Netweaver CE 7.2. For more information, visit the Business Process Modeling homepage . Source code (SCA) that belongs to this article can be found here: http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0601668-2dfe-2d10-a594-dbf92f6d93db Summary The article explains how a customer could enhance the BPM document handling using ECM public APIs and webdynpro. Author: Chembrakalathil Venugopal Company: SAP AG Created on: 11 October 2010 Author Bio Chembrakalathil Venugopal has been working in Netweaver SOA Infrastructure and has experience in various technologies in Netweaver Composition Environment.

Upload: others

Post on 14-May-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Document Centric Process Modeling using NW CE 7

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 1

Document Centric Process

Modeling using NW CE 7.20

Applies to:

SAP Netweaver CE 7.2. For more information, visit the Business Process Modeling homepage.

Source code (SCA) that belongs to this article can be found here: http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0601668-2dfe-2d10-a594-dbf92f6d93db

Summary

The article explains how a customer could enhance the BPM document handling using ECM public APIs and webdynpro.

Author: Chembrakalathil Venugopal

Company: SAP AG

Created on: 11 October 2010

Author Bio

Chembrakalathil Venugopal has been working in Netweaver SOA Infrastructure and has experience in various technologies in Netweaver Composition Environment.

Page 2: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 2

Table of Contents

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

1.1. Technical Scenario................................................................................................................................... 8

1.2 Value Proposition ...................................................................................................................................... 8

2. Steps to Model the scenario ........................................................................................................................... 9

2.1 Using BRM define the ECM Privileges and map the same to the J2EE users ......................................... 9

2.2 Using Webdynpro to create a Component which handles the ECM APIs .............................................. 11

2.3 Using Webdynpro to create Task UI component. Using DII to set a dependency to the public part defined in the 2.2 ........................................................................................................................................... 13

2.4 Create a Process with a Human activity and consume the webdynpro component created in step 2.3 14

2.5 Creating the Process instance .............................................................................................................. 15

2.6 Runtime configuration ............................................................................................................................. 15

Related Content ................................................................................................................................................ 17

Copyright........................................................................................................................................................... 18

Page 3: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 3

1. Business Scenario

Document centric business process is an important business process scenario. Documents can be part of a process instance from the beginning of the process. Business might require attaching a document while instantiating a process instance. A document which is part of a process could be accessed /modified by different task owners of this process. A document access needs to be restricted to different task owners in order to cater to the requirements of the business.

The Scenario describes a purchase order approval process. The requester of the purchase order needs to upload a document as a supporting document during the purchase order request creation. The purchase order request creation will trigger a BPM work flow where the uploaded document will be part of the process instance. The purchase order request will be approved / rejected / asked for rework by the approver where he is able to view the document. The requester could submit additional documents to get approval for the request.

Scenario Description

1. A user creates a purchase order request to get a laptop and attach a document to support his request.

2. The approver goes through the request and ask the user to provide additional supporting documents

3. The creator of the request attaches additional documents and submit the request again.

4. The approver approves the request.

Page 4: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 4

Step 1:

A user creates a purchase order request for a Laptop. The users upload a document along with the purchase order request. This will instantiate a BPM process instance.

Page 5: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 5

Step 2:

The approver of the request receives a task in his work list and he is able to only view the document attached to this process instance.

Page 6: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 6

Step 3:

The approver has requested for additional documentation and asked for rework. This will push the task instance back to the requester’s work list.

Now the requester is able to upload another document to support his request.

Step 4

The approver again gets the task with additional documents in his work list with the new attachments in a read only mode.

Page 7: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 7

Page 8: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 8

1.1. Technical Scenario

ECM is the content management framework provided with NW 7.20. ECM exposes APIs to create/store/delete documents in its repository and defines access controls. NW CE BPM 7.2 has integrated the ECM capabilities and provides an out of the box solution. But this might not be sufficient to define a complete document centric process with required access controls.

This document explains how a customer / partner could consume the ECM APIs and develop reusable webdynpro components. In NW 7.2 Webdynpro offers ECM template integration where a webdynpro component with ECM usage can be generated. The webdynpro components can be used in the Task UI as a reusable component and enable the complete power of ECM in BPM.

NW BRM 7.2 is used to define the privileges at a document/process/document folder level. This document describes how Business Rules Management can be used to define ACLs at document level and how this can consumed from a webdnypro component

Hiding the standard document handling features via configuration properties.

1.2 Value Proposition

o Possible to supply document while creating a process instance

o Flexibility in document handling in Task management using ECM apis

o Reusable document handling webdynpro component

o Support of ACLs at documents and folders

Page 9: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 9

2. Steps to Model the scenario

2.1 Using BRM define the ECM Privileges and map the same to the J2EE users

Create a new flow rule set in BRM and add a decision table to define the J2EE roles and ECM roles (please refer to the ecmRuleset in the ecmrulesDC). ECM supports three roles for users. Read, Write and All. Using a BRM decision table we can define the ECM roles to the J2EE users.

Create a new flow rule set in the same DC and add a new rule script to provide the users who have specific ECM privileges (please refer the ecmacls ruleset in the ecmrulesDC)

Page 10: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 10

Expose both the flow rule set as web service using the webservice->createWSDL artifact action available at the project tree.

Deploy the Rules DC and copy the wsdl from SOA Managment->Application and Scenario Communication->Single Service Administration.

Page 11: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 11

The WSDLs will be used in the webdynpro component.

You can modify the privileges using rules manager.

2.2 Using Webdynpro to create a Component which handles the ECM APIs

(Please go through the attached ecmwebdc in the SCA and see the code changes required)

Go to webdynpro Component Node and select the Apply Template action and generate a webdynpro component. The generated webdynpro component consumes the ECM APIs and generates the code to connect to the default ECM repository and a webdynpro view to manage documents.

Page 12: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 12

Enhance the generated code in order to incorporate the ACLs and make it available as a reusable component (please go through the attached DC (ecmwebdc)

Define a component interface and the above generated component should implement the same. Expose the component interface as a public part.

Page 13: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 13

Define a method at the interface controller to set the document folder name from the calling components.

The document folder name is required to retrieve he documents relevant for a process instance.

Import the WSDLs generated in BRM using the adaptive web service model importer.

Consume the webdynpro CMI model classes and invoke the rule models in order to get the ecm roles and apply the same at document/node level.

(Please refer the attached ecmwebdc)

2.3 Using Webdynpro to create Task UI component. Using DII to set a dependency to the public part defined in the 2.2

Define a component usage from the Task UI component to the webdynpro component generated in step 2.2.

Create the component instance of the used component in the Component controller of the taskUI component. For eg: wdThis.wdGetEcmComponentUsage().createComponent("com.sap.demo.ecmwebdc.wd.compec

mwebdynprocmp.EcmWebdynproCmp","demo.sap.com/ecmwebdc");

Add a ViewContainerelement in the task UI apart from the other task specific UI elements.

Embed the interface view usage in the Window of the task UI component. Define the inbound and outbound plug and provide the navigation link.

Page 14: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 14

Define a public method in the component controller of the task UI component and call the same from the view controller wdDoInit. This method will exchange the document folder id provided by the BPM process. //@@end

public void SetDocumentNodeName( ) {

//@@begin SetDocumentNodeName()

String docName =

wdContext.currentContextElement().getDocumentNodeName();

wdThis.wdGetEcmComponentUsage().getController(IExternalIECMI.class).setDocumentI

d(docName);

//@@end

2.4 Create a Process with a Human activity and consume the webdynpro component created in step 2.3

Define a DataObject “DocumentFolderID” of type String.

Create the service interface for the Process start event with a simple type “documentFolderID”.

Define an outmapping in the start event to map the documentFolderID to the DataObject “DocumentFolderID” in the process context.

Add a Human activity to the process model.

Create a Task for the human activity.

Define an input mapping for the documentFolderID to exchange the document folder name to the webdynpro UI component .

Page 15: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 15

2.5 Creating the Process instance

Once can create a process instance and attach a document to this process instance using the following way.

Create a Webdynpro DC and import the service interface of the Process as Adaptive webservice model.

Add a DC dependency to the public part exposed by the DC (created in step 2.2. ecmwebdc in the source provided)

Add a component usage to the Component which got created in Step 2.2(ecmwebdynpro in the source provided).

Embed the used component as described in Step 2.3

Generate a unique ID as the document folder ID. For eg: using the process name and the timestamp used in the attached sources (please refer iatbpmstartup->BPMStartupComp->WdDoInit() ) public void wdDoInit()

{

//@@begin wdDoInit()

// String fileName =

wdContext.currentContextElement().getDocumentName();

String processID = "InvestmentApproval";

processID =

processID.concat(String.valueOf(System.currentTimeMillis()));

wdThis.wdGetEcmComponentUsage().createComponent("com.sap.demo.ecmwebdc.wd.compec

mwebdynprocmp.EcmWebdynproCmp","demo.sap.com/ecmwebdc");//wdComponentAPI.getDepl

oyableObjectPart().getDeployableObjectName());

wdThis.wdGetEcmComponentUsage().getController(IExternalIECMI.class).setFileName(

processID);

wdContext.currentContextElement().setProcessId(processID);

//$$begin Service Controller(-219284595)

initRequest_StartProcess();

//$$end

//@@end

2.6 Runtime configuration

SAP BPM runtime offers document management feature which is part of the task execution UI. This can be disabled in order to adopt the solution described in this document.

Goto Netweaver Administrator->Configuration Management->Infrastructure->Application Modules.

Search for “taskinstances” in the Name column.

Page 16: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 16

Select "webdynpro/resources/sap.com/tc~bpem~wdui~taskinstance” and go to the Webdynpro properties in the Web Module details.

Select the property sheet

"Components/com.sap.tc.bpem.wdui.taskinstance.taskexecution.TaskExecution/settings"

Search for Properties Name “ui.displayAttachments” and set this property as false.

Please refer note (1456788) for how to disable attachments in the standard BPM task execution UI.

Page 17: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 17

Related Content

Source code (SCA) that belongs to this article

API documentation (JavaDoc) of the ECM infrastructure of SAP NetWeaver CE 7.2

How to Use Web Dynpro for Java Components and Component Interfaces

Business Rules Management home page in SDN

Page 18: Document Centric Process Modeling using NW CE 7

Document Centric Process Modeling using NW CE 7.20

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 18

Copyright

© 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, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

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.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, 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 other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

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.