Upload
pelayomuinos
View
162
Download
5
Tags:
Embed Size (px)
Citation preview
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 1
Create a Process-Driven
Composite Application with CE 7.2
- Part 1
Applies to:
SAP NetWeaver Composition Environment 7.2 Trial Version. For more information, visit the Composition homepage
Summary
This is part 1 of a 3-part tutorial to create a process-driven composite application. In Part 1, we will model the Purchase Approval Process. The tutorial is based on the BPM262 workshop (SAP NetWeaver BPM Integration with Visual Composer) session in TechEd 2009.
Authors: Eng Kit LUM, Venky Shankararaman
Company: Singapore Management University
Created on: 1 May 2010
Author Bio
Eng Kit LUM is working as Content Creator at Singapore Management University, School of Information Systems. He facilitates creating teaching and develops interactive learning exercises for the students in the Enterprise Business Solutions course, which teaches SAP Enterprise Resource Planning (ERP) business processes and Enterprise Services Architecture (ESA).
Venky Shankararaman is an Associate Professor of Information Systems Practice at the School of Information Systems, Singapore Management University. He teaches courses in the area of Business Process Management, Enterprise Integration, ERP and Enterprise Architecture.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
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
Model the Purchase Approval Process .......................................................................................................... 3
Start SAP NetWeaver Developer Studio (NWDS)....................................................................................... 4
Create a Process Composer Development Component ............................................................................. 5
Sketch the Purchase Approval Process ..................................................................................................... 9
Maintain the Technical Properties of the Pool .......................................................................................... 16
Create the Process Context ..................................................................................................................... 19
Add the Process Context to the Purchase Approval Process .................................................................... 26
Related Content .......................................................................................................................................... 29
Disclaimer and Liability Notice ..................................................................................................................... 30
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 3
Model the Purchase Approval Process
We will use Process Composer to model the process based on BPMN (Business Process Modeling Notation); the process participants (roles) and process steps (activities) are defined. We will also create the process context to store the process information.
The final process diagram is as shown.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 4
Start SAP NetWeaver Developer Studio (NWDS)
1. Start SAP NetWeaver Developer Studio (NWDS).
2. Specify a workspace folder (located on the same drive as the NWDS installation) to store your projects and click OK.
Note: A workspace.jdi folder will
also be created in the same
parent folder.
3. NWDS starts with the
Welcome page. Click on the Welcome tab to close it.
Alternatively, click .
Note: You can open this page again from the Help menu;
Welcome.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 5
4. The Workbench window is now visible. Initially, the Resource perspective is displayed.
Note: A perspective defines visible
action sets and is a group of views and editors in the
Workbench window.
Hint: The name of the active perspective is shown in the title of the window.
Create a Process Composer Development Component
5. Switch to the Process Development perspective; this is where you will perform your BPM modeling activities. From the Window menu, select Open Perspective Process Development.
Note: If Process Development is
not listed, select Other… and choose Process
Development.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 6
6. Create a new project. From the File menu, select New Project.
Alternatively, select Project from the drop-down menu of
the New button in the toolbar.
7. Select Process Composer Process Composer Development Component and click Next.
Note: In SAP’s Component Model, a development
component (DC) represents a Java project plus some metadata generated by the SAP plug-in (in this case,
Process Composer).
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 7
8. Select LocalDevelopment MyComponents [demo.sap.com] and click Next.
Note: We will develop our projects
using a local development configuration using the
default software component (SC) demo.sap.com.
A SC consolidates one or more DCs to form the final distributable software product or part of the
whole product.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 8
9. Name the DC xx/purchase/pr/pm and click Finish.
Note: SAP provides tips for
naming components.
Here, we use the naming convention <application name: purchase>/<application layer: process>/<element type: process model>.
Furthermore, if the SAP AS Java server (SAP NetWeaver CE 7.2) is shared among several developers, prefix the DC name with xx/ (where xx is a unique 2-digit number) so as
not to overwrite a DC with the same name deployed by another
developer.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 9
Sketch the Purchase Approval Process
10. In Project Explorer view, select xx/purchase/pr/pm Process Modeling Processes; right-click and select New Process.
Alternatively, click on in the toolbar.
Note: If Project Explorer view is not visible, from the Window menu, select Show View
Project Explorer.
11. Name the process Purchase Approval Process.
Select Create a pool with the following name and lanes; name the pool Purchase Approval and enter Requestor,Approver,Purchaser for Lanes.
Click Next.
Note: A pool acts as a container for the sequence flows between activities and is sub-partitioned into lanes, which
represent user roles.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 10
12. Accept the default trigger DefaultService_Empty and click Finish.
Note: A trigger defines what starts
the process. Here, we use the default trigger DefaultService, operation Empty; this means we do not
expose the process as a
Web Service.
Hint: The process can be exposed as a Web Service by assigning a service interface and operation to its start event. It is then possible to trigger the process using a Web Service call from an activity/event external to the process as opposed to manually starting the process (usually for testing purposes).
13. The process model opens in the editor area. Delete the connection between the Start and End events; right-click on the connection and select Delete.
Note: Process Composer adopts
the Business Process
Modeling Notation (BPMN)
for modeling business
processes.
Hint: Maximize the editor for a larger view. To make more space for the model, select the Purchase Approval pool and extend it to the bottom of the editor.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 11
14. Add the Create Purchase Request human activity. Hover over the Start event and click the Activity speed
button ; select Human.
15. Name the activity Create Purchase Request.
Hint: Click on the name to rename it.
16. Add the Approve Purchase Request human activity. Hover over the Create Purchase Request activity and drag the Activity speed
button into the Approver lane; select Human.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 12
17. Name the activity Approve Purchase Request.
18. Add a decision point. Hover over the Approve Purchase Request human activity and click the Gateway speed
button ; select Exclusive Choice.
19. Name the exclusive choice Approval Decision.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 13
20. Add the Create Purchase Order automated activity. Hover over the Approval Decision gateway and drag the Activity speed button
into the Purchaser lane;
Select Automated.
21. Name the automated activity Create Purchase Order and the label Approved.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 14
22. Add an Uncontrolled Merge gateway. Hover over the automated activity Create Purchase Order and drag the Gateway speed button
into the Requestor lane; select Uncontrolled Merge and name it Merge.
23. Add the Rejected connection to the Merge gateway. Hover over the Approval Decision gateway and drag the Connection
speed button to the Merge gateway. Name the label Rejected.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 15
24. Make the Rejected connection the default gate. Right-click on the connection and select Default Gate.
Note: The default gate indicator
appears on the connection.
25. Create the View Notification human activity. Hover over the Merge gateway and click on the Activity speed
button ; select Human and name it View Notification.
26. Finally, add a connection from the View Notification human activity to the End event.
Hint: Right-click on the pool (the header section containing the title) and select Format Pool to organize the layout, if required.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 16
Maintain the Technical Properties of the Pool
27. Assign an administrator to the pool. Right-click on the Purchase Approval pool (the header section containing the title) and select Properties.
Note: As a prerequisite, you have
to create the necessary users and assign the required roles.
Pool administrators can trigger administrative actions on the processes in the pool, such as canceling, suspending and resuming the process using the SAP NetWeaver
Administrator tool.
28. In Properties view, select the Administrators tab to open it. Then click the Choose button.
29. Select User for Principal Name, enter the Logon ID (for the user you want to define as the administrator of the process) and click Search.
Note: If you have not specified your
SAP AS Java server, you can do so by clicking the Configure Server Default…
link above the Search button.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 17
30. Select the user in Search Results and click the Add button to add it to Principals to Select.
Click OK.
31. Select the User Texts tab to open it. Change the Subject to Purchase Approval Process.
Note: This text is shown as the
subject in the user’s work
list.
Click Minimize to dismiss the Properties view.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 18
32. You have finished drawing the process diagram and it is as shown.
Save the process model.
Note: There are errors in the process model; ignore them
for now.
Hint: You can hover over the
error icon to see what the errors are.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 19
Create the Process Context
In our process, we need the information about the purchase request created in the first activity to be available to the rest of the activities. The process context therefore serves as a memory area to store this information while the process is executing.
Since the process context is represented by an XSD structure, it can be created within the XSD Editor; we will create the data structure as shown.
Note: In this data structure, there is a mixture of what SAP calls primary data (data that is required to drive the process) and secondary data (data that is passed between steps). In our process, Requestor, PRId, Approve and POId can
be considered primary data, while the rest are simply required for storing and passing data into the service
interface that we will assign later for the Create Purchase Order automated activity.
33. In Project Explorer, select xx/purchase/pr/pm Process Modeling Data Types XSD Files; right-click and select New XSD….
Hint: Alternatively, if you already have an XSD file containing the data structure to be used for the process context, you can import it.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 20
34. Accept the default parent folder and name the file Context.xsd. Click Finish.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 21
35. The XSD editor opens in the Design tab page.
Hint: You can also edit the XSD file in the Source tab page of the XSD editor.
36. In the schema Properties view below the editor, change the Target namespace to http://demo.sap.com/xx/purchase/pr/context . Click
Minimize to dismiss the Properties view.
Hint: If the Properties view is not visible, right-click on the schema (the header section containing the schema namespace) and select Show Properties.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 22
37. In the XSD editor, right-click in Elements and select Add element (defaults to type string) and name it Context.
Hint: You can rename the element in the Properties view.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 23
38. Right-click on the Context element and select Set Type New…
39. Select Complex Type and name it Context_DT. Click OK.
40. Context_DT appears in Types.
41. Right-click on the Context_DT type and select Add Element.
42. Name the element (defaults to type string) Requestor.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 24
43. Right-click on the Context_DT type and select Add Element. Name the element (type string) PRId.
44. Add the Item element to Context_DT and set the multiplicity to 1..* (One or more). Then select New… for type.
Hint: To set the multiplicity, right-click on the element and select Set multiplicity.
45. Select Complex Type and name it ItemType. Click OK.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 25
46. Add the following elements to ItemType:
Id (string)
ProductId (string)
Description (string)
Quantity (int)
DeliveryDate (date)
PlantId (string)
PurchasingGroupPartyId (string)
TotalAmount (decimal)
CurrencyCode (string)
47. Continue adding the following elements to Context_DT:
TotalValue (decimal)
CurrencyCode (string)
Approve (boolean)
POId (string)
Save your changes.
Hint: You can view the final XSD file in the Source tab page.
Close the editor.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 26
48. Context_DT and ItemType appear in Project Explorer – xx/purchase/pr/pm Process Modeling Data Types.
Hint: You can export the file if desired; select Data Types XSD Files Context.xsd, right-click, select Locate in Folder and then right-click the located file (in src/wsdl) and choose Export….
Add the Process Context to the Purchase Approval Process
49. Add the context (Context_DT) to the Purchase Approval process to create a data object. Open the Purchase Approval process model and drag Context_DT from Project Explorer into the Requestor lane.
Note: You can place the data
object in any lane.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 27
50. Add the Approved condition to the Approval Decision gateway. Right-click on the Approval Decision gateway and select Properties.
51. Click on the Conditional Evaluation tab to open it. Select the Approved condition and click Edit.
52. The Condition Expression Editor opens. Select Context DO_Context_DT Approve; double-click to add it to the expression. Click OK.
53. Dismiss the Properties view.
Note: Recall that you made the Rejected connection the default gate. Hence, if the value of DO_Context_DT/Approve does not evaluate to true, then the Rejected condition
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 28
will be applied.
54. Save your changes.
Note: The errors in the process
model should now be gone.
Continue to Part 2 of the tutorial.
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 29
Related Content
Composite Development Architecture Guidelines
Enterprise Services Workplace
Test Enterprise Service Online
How to Use SOA Configuration to Call RFCS and Web Services from within Sap NetWeaver BPM
help.sap.com
Create a Process-Driven Composite Application with CE 7.2 – Introduction
Create a Process-Driven Composite Application with CE 7.2 - Part 2
Create a Process-Driven Composite Application with CE 7.2 - Part 3
Create a Process-Driven Composite Application with CE 7.2 - Part 1
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2010 SAP AG 30
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.