0% found this document useful (0 votes)
33 views26 pages

How To Integrate Unified Worklist To XI BPM Via Workflow

How to Integrate Unified Worklist to XI BPM via Workflow

Uploaded by

seraphim6kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views26 pages

How To Integrate Unified Worklist To XI BPM Via Workflow

How to Integrate Unified Worklist to XI BPM via Workflow

Uploaded by

seraphim6kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

How-to Guide

SAP NetWeaver ‘04

How To…
Integrate EP
Unified
Worklist to XI
cross-
component
Business
Process
Management
via Business
Workflow
Version 1.00 – December 2004

Applicable Releases:
SAP NetWeaver ’04
(EP6.0, XI3.0, WAS6.40)
© Copyright 2004 SAP AG. All rights reserved. contained in this document serves informational
purposes only. National product specifications may vary.
No part of this publication may be reproduced or
transmitted in any form or for any purpose without the These materials are subject to change without notice.
express permission of SAP AG. The information These materials are provided by SAP AG and its affiliated
contained herein may be changed without prior notice. companies ("SAP Group") for informational purposes
only, without representation or warranty of any
Some software products marketed by SAP AG and its kind, and SAP Group shall not be liable for errors or
distributors contain proprietary software components of omissions with respect to the materials. The only
other software vendors. warranties for SAP Group products and services are those
that are set forth in the express warranty statements
Microsoft, Windows, Outlook, and PowerPoint are accompanying such products and services, if any.
registered trademarks of Microsoft Corporation. Nothing herein should be construed as constituting an
additional warranty.
IBM, DB2, DB2 Universal Database, OS/2, Parallel
Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, These materials are provided “as is” without a warranty
iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent of any kind, either express or implied, including but not
Miner, WebSphere, Netfinity, Tivoli, and Informix are limited to, the implied warranties of merchantability,
trademarks or registered trademarks of IBM Corporation fitness for a particular purpose, or non-infringement.
in the United States and/or other countries. SAP shall not be liable for damages of any kind including
without limitation direct, special, indirect, or
Oracle is a registered trademark of Oracle Corporation. consequential damages that may result from the use of
these materials.
UNIX, X/Open, OSF/1, and Motif are registered SAP does not warrant the accuracy or completeness of
trademarks of the Open Group. the information, text, graphics, links or other items
contained within these materials. SAP has no control
Citrix, ICA, Program Neighborhood, MetaFrame, over the information that you may access through the
WinFrame, VideoFrame, and MultiWin are trademarks use of hot links contained in these materials and does not
or registered trademarks of Citrix Systems, Inc. endorse your use of third party web pages nor provide
any warranty whatsoever relating to third party web
HTML, XML, XHTML and W3C are trademarks or pages.
®
registered trademarks of W3C , World Wide Web SAP NetWeaver “How-to” Guides are intended to
Consortium, Massachusetts Institute of Technology. simplify the product implementation. While specific
product features and procedures typically are explained
Java is a registered trademark of Sun Microsystems, Inc. in a practical business context, it is not implied that those
features and procedures are the only approach in solving
JavaScript is a registered trademark of Sun Microsystems, a specific business problem using SAP NetWeaver. Should
Inc., used under license for technology invented and you wish to receive additional information, clarification
implemented by Netscape. or support, please refer to SAP Consulting.
Any software coding and/or code lines / strings (“Code”)
MaxDB is a trademark of MySQL AB, Sweden. included in this documentation are only examples and
are not intended to be used in a productive system
SAP, R/3, mySAP, [Link], xApps, xApp, SAP environment. The Code is only intended better explain
NetWeaver, and other SAP products and services and visualize the syntax and phrasing rules of certain
mentioned herein as well as their respective logos are coding. SAP does not warrant the correctness and
trademarks or registered trademarks of SAP AG in completeness of the Code given herein, and SAP shall
Germany and in several other countries all over the not be liable for errors or damages caused by the usage of
world. All other product and service names mentioned the Code, except if such damages were caused by SAP
are the trademarks of their respective companies. Data intentionally or grossly negligent.
1 Business Scenario
Cross-component BPM (ccBPM) drives and controls complex business processes across
applications and the enterprise boundaries. As such, it is imperative for BPM to integrate
with a variety of products and components – including the components of SAP
NetWeaver. The present paper deals with integration to the Universal Work List (UWL)
of EP/KMC. SAP UWL gives users a unified and centralized way to access their work
and the relevant information. It aggregates all work items and notifications from multiple
and different systems in one universal list. In general, ccBPM requests an approval that is
routed via Business Workflow (BWF) to the UWL. The user takes action. Based on the
user decision, the process is aborted or being continued.

Manager 1 EP / UWL Manager 2

WAS Bus. Workflow

Travel Booking System XI / ccBPM

2 Introduction
This document describes how to trigger a BWF within ccBPM of XI, and to display the
corresponding work item in the UWL of EP. The solution is based on EP 6.0, XI 3.0, and
WAS 6.40 that are part of SAP NetWeaver ’04.
To exemplify the technical aspects of integration, a simple business process is considered.
A multiple line item XML message is sent to XI containing a list of different users.
Within ccBPM, the message is split according to the number of users. For each user, a
workflow is started by sending a single message to the application system that hosts the
BWF. Hence, for each user a separate approval is required. The workflow is based on
BOR object User. In general, it consists of a decision step: lock, or unlock specified user.
All work items are displayed within the UWL, waiting for user interaction. Dependent on
the decision of the responsible manager, the appropriate method is applied, and a message
with the user’s status is sent back to XI (see swim-lane).

-1-
XI 3.0 provides a variety of technical adapters in order to connect different application
systems, e.g. File/FTP, JDBC, JMS, RFC, SOAP etc. R/3 systems as of 3.1h can be
connected using either RFC or IDOC. However, for SAP systems as of WAS 6.20, the
standard communication is done using ABAP Proxy. It is the natural approach connecting
SAP systems since no adapters are required. Furthermore, proxies support full Quality of
Service “Exactly Once In Order”. Hence, the connection between the integration server
and the application is done using ABAP Proxy.
The authors assume that the reader is familiar with the tools that are deployed. Hence, the
paper is not describing each single step to implement the overall solution, but focuses
rather on integrative aspects.

-2-
3 The Step By Step Solution

3.1 Prerequisites

1. In the Integration Repository Message Interfaces (mode: asynchronous):


(Design) of the XI Integration
Builder (transaction code Interface Category Message Fault Message
SXMB_IFR), the following
User_Abs Abstract User
Repository Objects are already
maintained: User_IB Inbound User
Users_Abs Abstract Users
Users_OB Outbound Users
UserStatus_Abs Abstract UserStatus
UserStatus_IB Inbound UserStatus WorkflowFailed
UserStatus_OB Outbound UserStatus

Interface Mapping:
Name: UsersToUser
Source Interface: Users_Abs (occurrence: 1)
Target Interface: User_Abs (occurrence: unbound)

2. In the Integration Directory


(Configuration) of the XI Integration
Builder (transaction code
SXMB_IFR), a scenario is created
(here: XI30LighthouseScenario9),
and the appropriate business
systems are assigned to the scenario
(here: SendUser, ReceiveUser,
U6X_105).

-3-
3. In the Workflow Builder (transaction
code SWDD), a workflow is created
consisting of following steps (here:
workflow ID WS45600003):
ƒ Container Operation in order to
assign input parameter of type
string to Workflow Container of
BOR type “USER”.
ƒ Decision Step.

Container Elements:
4. For the workflow, following
Workflow Container Elements are
available: Name Type Settings
namestring SY-UNAME import/export
forename string import
surname string import
baduser BOR USER
return BAPIRET2 multiline

5. For the Universal Worklist, you


need:
• Release 3.1H or higher
• Workplace Plug-In 6.0 installed
for Release 620 and below
• PI_Basis installed for Release 640
• Connection to the SAP Internet
Transaction Server (ITS)

Each user must be:


• Known to all connected SAP R/3
Systems (UID exists)
• Authorized for RFC access to
function group SWK1 and
transaction SWK1

-4-
6. For SAP Enterprise Portal, you need
to have a working connection to
your backend workflow system.
You can verify this by accessing ITS
transaction via the support menu
without explicitly logon to the
backend system.

-5-
3.2 XI Integration Repository: Define cross-component Business Process

7. Choose “New” in the context menu


of “Business Processes” to create a
new cross-component Business
Process.

Enter name, and description.

Press “Create”.

8. Create new Container Elements of


category “Abstract Interface” to
store message data.

Enter name, and interface.

The Container Element “CO_Users”


is used to receive a message
containing the user information.

The multi-line Container Element


“CO_UserList” is an array of
messages. It is used to store the
splitted messages.
9. Create new Receiver Step by Drag &
Drop the receive symbol from the
toolbar.

Enter name, and select Container


Element “CO_Users” where
incoming messages are stored.

The Receiver Step starts the Business


Process instance.

-6-
10. Create a new Transformation Step in
order to split the received message
into multiple messages.

Choose 1:n Interface Mapping


“UsersToUser”, the Source Message
“CO_Users”, and the Target
Message “CO_UserList”.

11. Create new Block “ParallelBlock”.

12. Create new local Container Elements


of category “Abstract Interface”.
They are only used within the Block.

Enter name, and interface.

The Container Element


“CO_UserSingle” is used to send a
message to start the workflow.

The Container Element


“CO_UserStatus” is used to receive,
and to send the message containing
the status of a user.

-7-
13. Create a new Correlation
“CorrelationUser” in order to assign
incoming messages to the
appropriate Business Process
instances.

Define a Correlation Container. It


should be a unique key in order to
ensure unique correlation at
runtime.

Specify the Involved Messages. Add


the interface “UserStatus_Abs” since
it is used in a receiver step that uses
the correlation.

For the interface “UserStatus_Abs”,


define which fields of the incoming
messages have to be compared to
the Correlation Container Elements
at runtime. Here:
“UserStatus/Uname”.
14. For the Block “ParallelBlock”,
choose the mode “ParForEach”, the
Multiline Element “CO_UserList”,
and the Current Line
“CO_UserSingle”. For each line of
the multi-line Container Element
“CO_UserList”, all steps within the
Block are executed in parallel. The
Container Element “CO_UserSingle”
is used to store the values of a single
line of “CO_UserList”.

Specify the Correlation


“CorrelationUser” as local to ensure
unique correlation for each Block
instance.

-8-
15. Create new Send Step “SendUser” in
order to start workflow.

Choose asynchronous mode.

Select Container Element


“CO_UserSingle”.

Activate Correlation
“CorrelationUser” as to make it
available for subsequent receiver
steps.

Define which fields of the Container


Element have to be assigned to the
Correlation Container Elements.
Here: “User/Uname”.
16. Create new Receiver Step
“ReceiveStatus” to receive the status
of the user sent by the workflow.

Use Correlation “CorrelationUser”


in order to determine appropriate
Business Process instance, and Block
instance, respectively.

17. Create new Send Step “SendStatus”


in order to send user status back to
source application.

Choose asynchronous mode.

Select Container Element


“CO_UserStatus”.

-9-
18. Save the Business Process, and
activate the Change List on tab
“Changelist”.

- 10 -
3.3 Proxy Framework: Outbound Proxy

19. Create Outbound Proxy in the


Application System.

Run transaction code SPROXY.

Click on the Message Interface


“UserStatus_OB”, and choose
“Create Proxy” in the context menu.

Choose a package, and a prefix.

Activate the Proxy.

- 11 -
3.4 Business Workflow

20. Create subtype “ZUSER”.

Run transaction code SWO1


(Business Object Builder).

Choose object “USER”, and create


subtype “ZUSER”.

21. Enhance methods of “ZUSER”.

Run transaction code SWO1.

Choose “ZUSER”, and enter change


mode.

Redefine method “lock” and


“unlock”, respectively (F6 or
appropriate button).

Enhance methods according to


sample code in appendix:
• Create instance of class
ZLHCO_USER_STATUS_OB.
• Add call of method
EXECUTE_ASYNCHRONOUS
of class
ZLHCO_USER_STATUS_OB in
order to send status message via
outbound proxy.

Save, and generate.

- 12 -
22. Enhance Workflow.

Run transaction code SWDD, and


choose workflow above (here:
Workflow WS45600003).

Choose change mode.

Insert new Activity step “Lock User”


by Drag & Drop from step area.

23. Create new Task.

Enter name, and abbreviation.

Choose Object Type “ZUSER”, and


Method “lock”.

Save task.

24. Define Container Elements and


Binding.

Confirm proposed bindings.

- 13 -
25. Same proceeding for the second
branch of the Decision Step.

Create Activity “Unlock User”.

Create new Task, and choose


method “unlock”.

Save workflow.

- 14 -
3.5 Proxy Framework: Inbound Proxy

26. Create Inbound Proxy in the


Application System.

Run transaction code SPROXY.

Click on the Message Interface


“User_IB”, and choose “Create
Proxy” in the context menu.

Choose a package, and a prefix.

Activate the Proxy.

27. Go to the implementing class


ZLHCL_USER_IB by double
clicking.

Put Cursor on method


EXECUTE_ASYNCHRONOUS, and
choose button “Code”.

Choose the change mode, and


implement the method according to
sample coding in the appendix:
• Fill internal table. Take into
account that names of elements
within internal table must
correspond to container
elements of workflow (input
parameters).
• Call function module
SAP_WAPI_START_WORKFLOW
in order to start workflow.

Save, and activate method, class,


and interface.

- 15 -
3.6 XI Integration Directory: Configuration

28. Choose “New” in the context menu


of “Business Process” to define the
business process from the
Integration Repository as a service
within the Integration Directory.

Select business process, and enter


name.

29. Create a communication channel for


the business system where the
workflow is running (here:
U6X_105). Communication is done
by ABAP proxy.

Maintain Adapter Type, Transport


Protocol, Message Protocol, and
Addressing Type according to figure
on the right. Here, for addressing
the business system, an SM59
destination is specified where all
required system data is defined.
Alternatively, by choosing the
addressing type “URL Address”,
host, port, path, and authentication
data have to be specified within the
communication channel.
30. Create Receiver Determination,
Interface Determination, and
Receiver Agreement according to
figure on the right.

Save, and activate the Change List


on tab “Changelist”.

- 16 -
3.7 Unified Worklist

31. With the system created in the


prerequisite, you need to register the
item types for the system with UWL.

Go to System
AdministratorÆSystem
ConfigurationÆUniversal Worklist
Administration. Click on “Register
Item Types for New Systems Only”.

All your systems should appear in


the registered list after that.

32. Create a role with a folder name


“Universal Worklist”. Make sure
that the Entry Point for the role is set
to “Yes”:

33. Assign the Universal Worklist page


(Portal ContentÆContent Provided
by SAPÆEnd User
ContentÆStandard Portal
UsersÆPagesÆUniversal Worklist)
to the role as Delta Link.

- 17 -
34. Now go to the User Administration,
and assign the role to the user:

35. Logon with the user. You should see


a new role for this user, and in this
user’s top level navigation, you will
see the Universal Worklist:

- 18 -
3.8 Runtime: Send User Data & Decide on Workflow Item

36. In order to verify the scenario, the


Plain HTTP Adapter of the
Integration Server is used. It is a
simple way to send an XML file to
XI.

Run transaction code SICF, and


activate the Plain HTTP adapter of
the integration server, if not already
done.

For an HTTP client sample program,


please refer to the How-To paper
“How to integrate BW to XI”.
37. Save the XML data on the right to a <?xml version="1.0" encoding="UTF-8" ?>
file on your PC, modify if necessary <nr1:Users
(e.g. namespace, user names), and xmlns:nr1="[Link]
send it to XI by using the HTTP <User>
client mentioned above. <Uname>BUNDSCHUHA</Uname>
<Forename>Alexander</Forename>
<Surname>Bundschuh</Surname>
</User>
<User>
<Uname>RICKAYZEN</Uname>
<Forename>Alan</Forename>
<Surname>Rickayzen</Surname>
</User>
</nr1:Users>

38. Now, navigate to UWL in EP. If you


cannot see the 2 workflow items,
click on the Refresh button:

- 19 -
39. Select “Alan” work item by clicking
on the subject description, select
“unlock”, and click “Submit”:

40. Select “Alex” work item by clicking


on the subject description, select
“lock”, and click “Submit”:

41. Both work items should now


disappear from the Tasks summary:

- 20 -
42. Click on the Completed Tasks tab,
and you should see both work items
in it:

43. As a result, you should receive the


status of each user in XML format.

- 21 -
4 Appendix (Sample ABAP Coding)

4.1 Inbound Proxy: Method EXECUTE_ASYNCHRONOUS

method ZLHII_USER_IB~EXECUTE_ASYNCHRONOUS.
constants: c_uname(10) type c value 'NAMESTRING',
c_forename(8) type c value 'FORENAME',
c_surname(7) type c value 'SURNAME'.
data: wf_user type SY-UNAME value 'BUNDSCHUHAL',
wf_task type SWW_TASK value 'WS45600003',
l_container type SWR_CONT,
t_container like table of l_container,
l_exchange_fault_data type ZLHEXCHANGE_FAULT_DATA.
* fill container
refresh t_container.
clear l_container.
l_container-ELEMENT = c_uname.
l_container-VALUE = input-user-uname.
append l_container to t_container.
l_container-ELEMENT = c_forename.
l_container-VALUE = input-user-forename.
append l_container to t_container.
l_container-ELEMENT = c_surname.
l_container-VALUE = input-user-surname.
append l_container to t_container.
* call function module to start workflow
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
TASK = wf_task
DO_COMMIT = 'X'
USER = wf_user
TABLES
INPUT_CONTAINER = t_container.
if sy-subrc <> 0.
l_exchange_fault_data-fault_text = 'start workflow failed'.
RAISE EXCEPTION TYPE ZLHCX_WORKFLOW_FAILED
EXPORTING
standard = l_exchange_fault_data.
endif.
endmethod.

4.2 BO User: Method Lock

BEGIN_METHOD LOCK CHANGING CONTAINER.


DATA: RETURN LIKE BAPIRET2 OCCURS 0.
* Enhancement: data declaration
data: l_status type ZLHUSER_STATUS,
l_status1 type ZLHUSER_STATUS1,
lo_status TYPE REF TO ZLHCO_USER_STATUS_OB.
*
SWC_GET_TABLE CONTAINER 'Return' RETURN.
CALL FUNCTION 'BAPI_USER_LOCK'
EXPORTING
USERNAME = OBJECT-KEY-USERNAME

- 22 -
TABLES
RETURN = RETURN
EXCEPTIONS
OTHERS = 01.
CASE SY-SUBRC.
WHEN 0. " OK
WHEN OTHERS. " to be implemented
ENDCASE.
SWC_SET_TABLE CONTAINER 'Return' RETURN.
* Enhancement: call XI Outbound Proxy
l_status-uname = object-key-username.
l_status-lock_status = 'locked'.
l_status1-user_status = l_status.
create object lo_status.
call method lo_status->execute_asynchronous
EXPORTING
output = l_status1.
*
END_METHOD.

- 23 -
[Link]/irj/sdn/howtoguides

You might also like