Upload
nguyennhu
View
235
Download
1
Embed Size (px)
Citation preview
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
EXERCISE 3:
SERVICE SIMPLIFICATION
Exercises / Solutions
SAP NETWEAVER PRODUCT MANAGEMENT SOA
PROCESS ORCHESTRATION
EXPERIENCE WORKSHOP 7.3
1
EXERCISE 3: SERVICE SIMPLIFICATION
In this exercise, you will learn how to simplify a SAP Enterprise Service with the Service Composer and how to integrate the service
into SAP NetWeaver Business Process Management.
You simplify a SAP Enterprise Service to create a purchase order.
You enhance the composite application that you have created in exercise 1 and extended in exercise 2.
Design Time
1. Open SAP NetWeaver
Developer Studio and select
perspective Composite
Designer.
2. In the Composite Explorer
view, open the Composite
Designer for product
POExpWS7_3_EXC.
Confirm your selection in the
upcoming dialog box.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
2
3. Drag the Simplified Service
symbol into the Business
Logic layer of your
architecture overview.
4. Import an external SAP
Enterprise Service to create a
Purchase Order.
Import it from the local file
system.
Click Next.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
3
5. A WSDL file describing the
SAP Enterprise Service
Create Purchase Order is
available in folder
C:\NWDS\PO_ExpWS_7.3\W
SDL-Files
It is called
ECC_PURCHASEORDERCR
TRC.wsdl.
Click on Next.
6. Simplify the complex service
interface structure of this
service by deleting all
parameters except the three
parameters that you see on the
screenshot.
You delete fields by either
selecting them in the tree and
clicking on the Delete
Attribute button ( ) or
choosing Delete from the
context menu. You can delete
several fields by holding
down the CTRL-key while
you are selecting the fields.
If a dialog pops up telling you
that you are deleting
mandatory fields, simply
confirm the dialog by clicking
on OK. We will set the
mandatory fields later.
Rename the service
interface and the service
operation by adding EXC at
the end.
Click Next.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
4
7. Click Next.
8. Click Finish.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
5
9. Your architecture overview
should now look like this.
You now have a simplified
service in the Business Logic
layer with a connection to the
original external SAP
Enterprise Service in the
External Services layer.
Double-click the development
object for the simplified
service to open the Service
Composer perspective.
You can use the Service
Composer perspective to
simplify existing back-end
services. Many of these
service interfaces are large,
complicated and provide too
much information. You may
actually need only pieces of
the information provided by
the service interface. Using
the Service Composer
perspective you can reduce
the complexity of existing
service interfaces
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
6
10. In the diagram editor open the
mappings for the simplified
service.
11. You can see the current
mapping between the original
service interface (right side)
and the simplified service
interface (left side).
However, the original service
requires the setting of some
mandatory fields. We have to
populate those fields
manually.
12. In the original service
interface, one child node of
the PurchaseOrder node is
named ProcessingTypeCode.
Double-click it to open the
script editor.
Attention: there is another
node named
ProcessingTypeCode beneath
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
7
the Item node. Make sure to
pick the right one (beneath the
PurchaseOrder node)!
13. Enter “NB” (don’t forget the
quotation marks) as a fixed
value for parameter
ProcessingTypeCode.
Click OK.
14. In the original service
interface, directly under node
PurchaseOrder, double-click
on parameter
PurchasingOrganisationParty
InternalID text().
15. Enter “3000” as a fixed value.
Click OK.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
8
16. In the original service
interface, directly under node
PurchaseOrder, double-click
on parameter
PurchasingGroupPartyInte
rnalID text().
17. Enter “000” as a fixed value.
Click OK.
18. In the original service
interface, directly under node
PurchaseOrder, double-click
on parameter
SellerPartyInternalID
text().
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
9
19. Enter “0000003021” as a
fixed value.
Click OK.
20. In the original service
interface, under node Item,
double-click on parameter ID.
21. Enter “10” as a fixed value.
Click OK.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
10
22. In the original service
interface, under node Item,
double-click on parameter
ProcessingTypeCode.
23. Enter “0” as a fixed value.
Click OK.
24. In the original service
interface, under node Item,
double-click on parameter
PlantIDtext().
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
11
25. Enter “3800” as a fixed value.
Click OK.
Finally, save all your changes
( ).
26. Since there is no backend
system available, create a
mock service to simulate the
service call of the original
service.
Right-click on the service
symbol and select Replace
with Mock Service.
Creating and using a mock
service allows you to replace
a back-end service needed by
a composed service with a
simulation. This allows you to
test the behaviour of the
composed service as if it is
using the back-end service.
The mock service can be
directly deployed and
consumed by your composite
application. This allows you
to continue development even
if you do not have a back-end
service in place.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
12
27. Select EJB Module DC
poexpws7_3_exc/bl/ejb.
The Enterprise Application
DC poexpws7_3_exc/bl/ear is
automatically chosen for you.
Rename the mock service’s
name by appending EXC.
Click Next.
28. Check Open in Editor and
click Finish. An XML file
will be opened containing the
interface of the enterprise
service. It allows you to set
appropriate values for the
response structure of the
enterprise service.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
13
29. Open the response structure
and enter 4700001234 as a
fixed value for
PurchaseOrder ID. Save
your changes in the XML file
( ) and close the associated
tab.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
14
Integrate the simplified service into SAP NetWeaver BPM
1. Your architecture overview
should look like this. Notice:
so far, there is no connection
between process IAP_EXC
and simplified service.
Double-click development
object IAP_EXC to open the
Process Composer.
2. Select activity Create
Purchase Order and open its
properties.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
15
3. On the Properties tab click on
Interface and set the Service
Interface field to None by
choosing None from the
associated dropdown list.
Save your changes ( ).
4. Jump back to the Composite
Designer perspective and
create a relation between
development object IAP_EXC
and the simplified service.
5. Click Next.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
16
6. Accept the proposed
automated activity.
Click Next.
7. Accept the proposed operation
and click on Next.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
17
8. Select the existing service
group localhost_poexpws_7_3_EXC
and click on Finish.
9. Now that the activity has been
assigned to a new service, we
have to update the mapping.
Jump back to the Process
Composer showing the
process model. Select activity
Create Purchase Order and
open its properties.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
18
10. In the properties, select Input
Mapping and map the context
attributes as shown in the
screenshot.
11. Open Output Mapping and
map the context attributes as
shown in the screenshot. Save
your changes ( ).
12. Build and deploy your project.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
19
Administration
1. Before starting the new
process we have to configure
service groups using the SAP
NetWeaver Administrator.
Open SAP NetWeaver
Administrator.
Login to the Java engine with
the credentials
demo/welcome123.
2. Go to SOA Management
Application and Scenario
Communication
Application Communication.
3. Search for your software
component by entering expws
in the Search field and
clicking on Go. Select
software component poexpws7_3_ex_0~pr~pm.
This is the software component
that contains your process with
all the consumed and provided
web services.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
20
4. Check the configuration of
Consumed Services. You see
the simplified service in the
list.
5. Select software component
poexpws7_3_ex_0~bl~scomp.
This is the software component
that contains the provided
simplified service and the
consumed mock service.
6. Check the consumed services.
Is the service group
MockServiceGroup…
configured (green symbol)?
7. Check the provided services.
Switch to Edit mode and press
Assign Profile.
8. Assign default profile. Click
OK.
Save the profile assignment.
9. Press Refresh. Is the service
group properly configured
(green symbol)?
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
21
Execute enhanced process
1. Start a process instance of
Investment Approval Process
using the Web Dynpro
application
StartIAProcessExc.
You can find a link in the
browser’s favorites.
2. Enter the values shown in the
screenshot. Select product
HT-1002.
3. Fill in the order form as
shown in the screenshot.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
22
4. Confirm.
5. Open the Universal Worklist.
You can find a link in the
browser’s favorites.
You are still logged in with
user Demo Dee.
6. Task Confirm PO Creation
Task appears in Demo Dee’s
inbox . Obviously an approval
was not necessary.
Open Confirm PO Creation
Task in Demo Dee’s inbox.
7. On the Confirm PO Creation
Task, you see that the
simplified service returns the
fixed value 4700001234 as the
order ID. Click on Approve to
finish the task.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
23
8. Update one more time Demo
Dee’s inbox. No further task
appears.
PROCESS ORCHESTRATION EXPERIENCE WORKSHOP 7.3
24
Copyright 2012 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, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries,
pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP,
Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, 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.
The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or
transmitted in any form or for any purpose without the express prior written permission of SAP AG.
This document is a preliminary version and not subject to your license agreement or any other agreement with SAP.
This document contains only intended strategies, developments, and functionalities of the SAP® product and is not
intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note
that this document is subject to change and may be changed by SAP at any time without notice.
SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or
scompleteness of the information, text, graphics, links, or other items contained within this material. This document is
provided 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 have no liability for damages of any kind including without limitation direct, special, indirect, or
consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent
or gross negligence.
The statutory liability for personal injury and defective products is not affected. 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 assumes no responsibility for errors or omissions in these materials