3 Implementation: C:/bpm/solutions/03-Implementation - Zip
3 Implementation: C:/bpm/solutions/03-Implementation - Zip
3 Implementation: C:/bpm/solutions/03-Implementation - Zip
3 Implementation
3 Implementation ...........................................................................................................................................1
3.1 Introduction .........................................................................................................................................1
3.2 Launch BPM Studio............................................................................................................................2
3.3 Business Catalog .................................................................................................................................2
3.4 Creating a Business Object ................................................................................................................3
3.5 Data Inputs and Data Outputs..........................................................................................................5
3.6 Creating Data Objects ........................................................................................................................6
3.7 Implementing Enter Quote Details ..................................................................................................8
3.7.1 Defining the Task Service ...........................................................................................8
3.7.2 Generate Form for the Task ...................................................................................... 11
3.7.3 Task data mapping .................................................................................................... 13
3.7.4 Mapping swim lane Roles to LDAP Roles ............................................................. 14
3.8 Configuration of the Service Task .................................................................................................. 16
3.9 Data Association configuration for conditional flows ................................................................. 20
3.10 Configuration of Script Tasks ......................................................................................................... 24
3.11 Deploying the process ...................................................................................................................... 27
3.1 Introduction
Note: The solution for this chapter can be found in c:\bpm\solutions\03-
implementation.zip
In the first exercise, you built a basic process with roles, activities, and transitions. In
this lesson, you will further enhance the process by creating data types, variables, Task
Services, Rule Services, and Adapter Services and binding them to the process
activities.
Objectives
After completing this lesson, you will know how to:
Implement Process Activities and create Task, Rule and Adapter Services
Define the different kinds of Data Objects (variables)
Define Data Inputs and Data Outputs (arguments)
Map arguments to instance variables
4. Click OK
5. Select the Based on External Schema option and click the Schema Browser icon. This
brings up the Type Chooser dialog. Click on the Import Schema Files icon on the top
right corner to import an XSD file into your BPM Project.
6. Select the Copy to Project option in the Import Schema File dialog and select the
Browse Resources… icon
7. This brings up the SOA Resource Browser window. Locate and select the Quote.xsd
file in the lab materials xsd folder.
8. Click OK to close the SOA Resource Browser and click OK again on the Localize Files
dialog.
9. Expand the Project Schema Files folder in the Type Chooser and expand Quote.xsd
and select the QuoteRequest element. Click OK and click OK again.
10. The Quote Business Object opens. You can add description and documentation
details here as desired. When finished, close the Quote window.
This completes the creation of the Quote Business Object.
Note: As you will see in later section, the input and output arguments of the process
step is the same as the inputs and outputs of the Service (Task, Rules, or System) that it
is bound to.
approveDealOutcome String
approveTermsOutcome String
businessPracticesOutcome String
businessPracticesReviewRequired Boolean
1. In the BPM Project Navigator, highlight your RequestQuoteLab process to view the
Structure pane in the lower left of the screen. If the Structure pane is not visible, select
View Structure and be sure you have your process selected in the BPM Project
Navigator.
2. Right click on the Process Data Objects folder and select New to launch the Create
Data Object window.
3. Enter a value for the Name field and select the appropriate scalar type.
4. Create the four scalar type data objects listed in the table above.
6. To set the quote to the type Quote Business Object, select the “…” option. This brings
up the Type Chooser window.
7. Select Component from the list of types and then choose the Quote from the list of
Business Objects
8. Right click on the Enter Quote Details user activity and select Properties
9. In the Properties dialog, click the Implementation tab
10. Click the green + next to Human Task
11. In the Create Human Task dialog Enter the name, EnterQuoteDetails
Select Initiator for Pattern. This automatically sets the outcome to SUBMIT.
12. Type in Enter Quote for the title.
13. Click on the green + next to Parameters to launch the Data Object dialog
14. Drag quote from the Data Object Navigator window to the Parameters section.
19. Now edit the Task Service. Double-click the .task file to open the Task Editor with the
Task Service definition.
20. Set the Title of the task in a dynamic fashion based on incoming payload using the
Text and XPath option and then click the Expression Builder icon on the far right.
21. This opens up the Expression Builder. Create the following XPath expression:
25. The user interface for the Task Service is generated automatically. A number of
dialogs open to give you an opportunity to do some customization. For this exercise,
simply click OK to all the dialogs. You will know when the form is finished when you
see the taskdetails.jspx file open and displaying the form. Save the everything and
close all open task windows.
Complete the Task Service configuration of the remaining four Interactive Tasks – namely
Approve Deal, Approve Terms, Finalize Contract and Business Practices Review in the
same manner, following the steps below
26. Right click Business Practices Review and select the Properties window and the
Implementation tab.
27. Click the “+” symbol to create the Task Service.
30. Enter the title as Business Practices Review, and add the parameter, quote with the
Editable checkbox checked.
31. The Business Practices Review properties dialog looks like the picture below.
The configuration of Approve Deal and Approve Terms activities are the same as the
configuration of Business Practices Review activity (they have same outcomes –
APPROVE and REJECT).
The configuration of Finalize Contracts activity is the same except that it has single
outcome – OK instead of APPROVE and REJECT.
33. Now create the Task Forms as described for EnterQuoteUILab. Remember to include
the suffix “UILab” for all the auto-generated task forms.
Note that for Enter Quote Details, the output association is set while the input association
is empty. You manually set the input for Enter Quote Details towards the end of this lab.
For the other tasks, you set the appropriate output association for outcome at the end as
well. It’s best to do data associations in the last part of implementation after all of the
different elements have been built.
Note: The BPM engine (Oracle Weblogic Server) has to be running to map the Process
Roles to the LDAP roles. Be sure your server is running before continuing.
34. In BPM Studio, navigate to BPM Process Navigator
36. In the Organization editor, select the SalesRep role from the list of Roles
38. Choose the Application Server connection for your server. If there is not one already
created, select the green + icon to create it.
Note the following if you need to create a connection. The training configurations
usually use user weblogic and password welcome1. The port is “7001” if you are
using a single server configuration and “8001” if you are using an Admin server
with a SOA managed server configuration. The domain name is “domain1” on
most training machine installations. When you test the connection, you only need
to have the HTTP protocol test successfully. The 8001 port connection will fail for
most of the other protocols but don’t worry; you don’t need them for LDAP!
39. Check the Realm selection and change it if necessary for your installation.
In a similar manner, perform role mapping as shown in the table below for the remaining
Process Roles:
Approvers cdickens
You will need to remember which user is assigned to which role later when you run the
process. Write them down or keep this table handy.
43. Drag-and-drop the File Adapter from the Component Palette to the right hand
External References pane in the composite editor.
Note that with the composite editor, you must drag the File Adapter and drop it on
the External References pane. You do not use the click-and-drop method that you can
use in the BPM process editor.
44. Walk through steps in the File Adapter wizard and create a service called SaveQuote
to write to a file. The following screens show you the steps: choose the write
operation, specify the destination file name and directory – it must be a directory
accessible to your server such as c:\temp. Do not select the Native Format
Translation Required option, and for the schema choose the QuoteRequest schema
from the Quote.xsd file you used earlier.
46. Go to Business Catalog/Services/Externals folder and expand it. Verify that the
SaveQuote service is present.
48. Right click on Save Quote Service Activity, select Properties and click
Implementation tab
49. Select Service in the drop down menu within Service Task
50. Click on the magnifying glass next to Name to search for available services and select
the service SaveQuote. Click OK to select the service but don’t click OK on the
Properties dialog yet!
52. Drag-and-drop the quote data object from the right hand panel to the Inputs area
53. Now click OK and click OK again. The Save Quote Service Task is complete.
Warning: There is an intermittent issue with the setting of the Service activity data. To
verify it is set properly, select the SaveQuote service in the Business Catalog. The
structure pane shows the service signature. The parameter name must be
quoteRequest. If it shows as quote, save everything, exit JDeveloper and start it again.
When you see quoteRequest in the service signature, you can continue.
businessPracticesOutcome data object into the field next to the outcome output
argument. Click OK and click OK again.
55. Map the outcome of the Approve Deal step as shown in the figure below:
56. Map the outcome of the Approve Terms step as shown in the figure below:
57. Now, specify the data object based conditional expression for the Business Practices
Reject and Deal or Terms Rejected paths as shown in the figures below.
58. Add the condition for the Yes path for Is Business Practices Review Required?
Gateway.
Finally, you need to add a Script Task to set the payload (the input data) for the Enter
Quote Details task and to determine whether the Business Practices Review activity is
required or not. The script goes right before Enter Quote Details. Using a script to set the
input data makes testing this process easier but when running such a process for real, the
user who initiates the task would enter the input data.
59. Click and drop a Script Task from the BPMN Component Palette and place it
between the Start and Enter Quote Details steps. Name it Initialize Quote.
61. Select the XPath option and click the pencil icon to edit.
62. Drag the quote Data Object into the Custom Assignments area
The XPath expression for the left hand side is shown below. The XML is also available in
the c:\bpm\input\testData.xml file.
oraext:parseXML('<ns1:QuoteRequest
xmlns:ns1="http://www.mycompany.com/ns/salesquote">
<ns1:Summary>
<ns1:OpportunityID>zzzz2</ns1:OpportunityID>
<ns1:AccountName>Acme New</ns1:AccountName>
<ns1:Address>
<ns1:Street>Demo Way</ns1:Street>
<ns1:City>Redwood Shores</ns1:City>
<ns1:State>CA</ns1:State>
<ns1:Zip>94065</ns1:Zip>
<ns1:Country>USA</ns1:Country>
</ns1:Address>
<ns1:SalesRepId>jcooper</ns1:SalesRepId>
<ns1:SalesRepName>James Cooper</ns1:SalesRepName>
<ns1:ValidUntil>2010-05-30</ns1:ValidUntil>
<ns1:EffectiveDiscount>0.0</ns1:EffectiveDiscount>
</ns1:Summary>
<ns1:QuoteRequestStatus/>
</ns1:QuoteRequest>')
63. Click the Expression Builder icon to open the Expression Builder and enter the XML
string. Be sure to use the oraext:parseXML function and enter single quotes around
the XML string inside the ( ).
66. Go back to Enter Quote Details and set the input mapping to the quote Data Object as
shown in the figure below. There is no need to set the outcome output data because
this task has only a SUBMIT outcome.
Note: You will need to configure a connection to the BPM run-time engine along the
way. Earlier, you set up a connection for LDAP access. If you have a managed server
configuration, the LDAP connection used the 8001 port and will not work for
deployment. The training configurations usually use user weblogic and password
welcome1. For deployment, most training configurations use 7001 for the port and
domain1 for the domain. When you test the connection, all protocols should test
successfully.
This completes deployment of the process. You are now ready to run the process. Go
to the next chapter for instructions on running and testing the process.