building your first process with oracle bpm 11g.pdf

85
Purpose This tutorial shows you how to build a simple Hello World application using Oracle BPM Suite 11g R1. It also shows you how to deploy the process to the BPM server and test it in the BPM Workspace. Time to Complete Approximately 2 hours Introduction In this tutorial, you use Studio, the JDeveloper based IDE, to create a simple Hello World process. This process demonstrates the use of a file service (implemented by a file adapter), user tasks (implemented by the Human Workflow engine), and conditional branching. The conditions for the branching are determined through the use of a business object and a business rule (which is implemented by the business rules engine). You also use a script task to initialize a variable. After building the process, you deploy it to the BPM engine and test it in the runtime environment. Scenario There are two roles involved in the Hello World process, the sender of the message (in the Requester role), and a reviewer (in the Reviewer role). The requester is prompted, through the Request Hello user task, to enter a Hello message, greeting, and a date for the message. After the form is submitted, a business rule is applied to the message content to determine whether the message requires a review, based on the length of the greeting and message fields. If the message does not require review, the process flows to a script task, which initializes a variable needed by the next task, then the message is sent to the Write Message user task to be written to the file system. If the message requires review, the reviewer is prompted to review the message and either accept or reject it. If the message is rejected, it returns to the Request Hello user task so that the requester can correct the message. If it is accepted, it goes directly to the Write Message user task for file processing. Overview Building Your First Process with Oracle BPM

Upload: abarrero

Post on 18-Dec-2015

37 views

Category:

Documents


2 download

TRANSCRIPT

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 1/85

    Purpose

    This tutorial shows you how to build a simple Hello World application using Oracle BPM Suite 11g R1. It also showsyou how to deploy the process to the BPM server and test it in the BPM Workspace.

    Time to Complete

    Approximately 2 hours

    Introduction

    In this tutorial, you use Studio, the JDeveloper based IDE, to create a simple Hello World process. This processdemonstrates the use of a file service (implemented by a file adapter), user tasks (implemented by the HumanWorkflow engine), and conditional branching. The conditions for the branching are determined through the use of abusiness object and a business rule (which is implemented by the business rules engine). You also use a script taskto initialize a variable. After building the process, you deploy it to the BPM engine and test it in the runtime environment.

    Scenario

    There are two roles involved in the Hello World process, the sender of the message (in the Requester role), and areviewer (in the Reviewer role). The requester is prompted, through the Request Hello user task, to enter a Hellomessage, greeting, and a date for the message. After the form is submitted, a business rule is applied to themessage content to determine whether the message requires a review, based on the length of the greeting andmessage fields.

    If the message does not require review, the process flows to a script task, which initializes a variable needed by thenext task, then the message is sent to the Write Message user task to be written to the file system. If the messagerequires review, the reviewer is prompted to review the message and either accept or reject it. If the message isrejected, it returns to the Request Hello user task so that the requester can correct the message. If it is accepted, itgoes directly to the Write Message user task for file processing.

    Overview

    Building Your First Process with Oracle BPM

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 2/85

    Hardware and Software Requirements

    The following is a list of hardware and software requirements:

    Install Oracle BPM Suite 11g Release 1 (11.1.1.7)Install Oracle JDeveloper Studio Edition 11g release 1 (11.1.1.7). You should have also installed the SOA SuiteExtension for JDeveloper.

    Prerequisites

    Before starting this tutorial, you should:

    Have added the Demo Community users to the WebLogic server's internal LDAP database. You will map theseusers to the Hello World application roles. If you have not done this, Download and extract the SeedDemoCommunity.zip file containing the ANT files thatwill perform this task. You will need to modify some parameters in the ANT build file to match your particularinstallation. Use this ReadMe file to assist you.

    In this section you create the basic starting point for the Hello World process using the JDeveloper Studio. This simpleprocess contains just four flow objects: a start event, a user task ("Request Hello"), a service activity ("Write Message"),and an end event. The end user will be able to enter a Hello message, using the BPM Workspace. The message willbe captured in a business object and passed to a file service, which, in turn will write the message to a disk file. Later,you expand upon this to add more complexity to the process.

    You create several process elements throughout this section of the tutorial. The following naming convention will beused throughout this section:

    Name Description

    HelloWorld_OBE Application name

    HelloWorldProject Main project name

    HelloWorld_UIProject containing usertask web form(s)

    HelloWorldProcess Process name

    Creating the Process Model

    1. Open JDeveloper Studio 11.1.1.7 from the Windows Start menu. If prompted to select a role, choose theDefault Role. Click OK

    Creating the Basic Hello World Application

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 3/85

    Close the Daily tips window if it appears.

    2. Create a new application. Click the New Application bar in the left panel.

    The BPM Application wizard opens. Name the application "HelloWorld_OBE" and accept the defaultdirectory for storing application files (D:\JDeveloper\mywork). Select BPM Application in theApplication Template panel.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 4/85

    Click Next.

    3. In Step 2 of the Create BPM Application wizard, you create a project for the application. Enter"HelloWorldProject" as the Project Name. Notice that BPM and SOA are automatically selected for you asProject Technologies. Click Finish

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 5/85

    In the upper left corner of the Studio window, you see the Navigator panel. This contains two tabs thatwill be important to you as you perform this tutorial: The Application Navigator tab and the BPM ProjectNavigator tab. Currently the Application Navigator tab is selected by default. You can see theHelloWorld_OBE application appearing in the drop-down list just above the panel, and theHelloWorldProject appearing as the parent node within the panel. The fact that it appears in italicsindicates that there are unsaved changes.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 6/85

    Click Save All in the main toolbar.

    4. To create a new process in this project, first click the BPM Project Navigator tab. Then right-click onProcesses and select New > Process.

    In the BPMN Process wizard, enter "HelloWorldProcess" as the process name. Select Manual Process.Click Finish.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 7/85

    The process model appears in the design editor panel in the middle of the Studio window. The tab

    name will be the same as the name of your new process.

    Click Save All.

    You may wish to close the other tabs as you will not be using these. Click the X at the corner of the tab toclose the tabbed pane. All of these can be easily reopened later from either the menu or one of thenavigator panels.

    5. Notice that the model already contains three default flow objects. The process begins and ends withtwo circular icons. The circle on the left is a Start event and the circle on the right is an End event.Connecting the two circles is a line that represents the flow of activities through the process. This iscalled the sequence flow and sometimes is referred to as the "transition line". Between the Start andEnd events is a User Task type activity.

    Change the name of the user task in the process model. Right click on it and select Properties.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 8/85

    When the properties dialog box appears, on the Basic tab, change the name of the user task to"Request Hello". Click OK.

    Do not worry about the warning icon indicating that no implementation has been defined. You will definethis later. Click Save All.

    6. Add a service activity to the process. First you will need to make room for another flow object on thesequence flow. Click on the End event and drag it to the right, dropping it on the right side of the designpanel, allowing enough room for the service activity to fit between the Request Hello user task and theEnd event.

    From the flow objects drop-down menu, expand the Activity palette.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 9/85

    Click the Service activity icon in the palette and drop it on the sequence flow between Request Hello andEnd. Drop it there. Notice that the transition line turns blue when the drop target area approaches theline.

    Important: The transition line must be b lue when you drop the object in order for the transition line to beconnected to the flow object.

    When you drop it, the Properties dialog box for the activity opens. On the Basic tab, change the activityname to "Write Message". Click OK.

    7. Click Save All. Your process should now look similar to this.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 10/85

    Creating the Business Object

    While it is possible to create a simple business object without using a schema file, it is less common. Thereforeyou will create the business object from a provided xsd schema file. After creating the business object, you declarea process data object (like a variable) of that type.

    1. Download the helloObject.xsd file and save it to a folder on your local machine.

    2. Create a business object based on the helloObject.xsd schema. This businessobject will be capable of storing multiple pieces of data related to the messagethat the user enters in the Request Hello user task. This object will bepopulated when the user enters the message. It will then be passed to the WriteMessage activity so that the message can be written to a file.

    Business objects are stored in modules within the Business Catalog. In the BPM

    Project Navigator, expand the HelloWorldProject node. Right-click on Business

    Catalog and select New > Module.

    When prompted to name the new module, enter "HelloTypes" and click OK.

    The HelloTypes module now appears beneath the Business Catalog node.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 11/85

    3. Right-click the HelloTypes module and select New > Business Object.

    Enter "HelloObject" as the Name and accept HelloTypes as the Destination Module. Select the Based on External Schema checkbox and click the Browse button to choose the externalschema.

    In the Type Chooser window, click the Browse button in the upper right corner to import a new xsd file. The Import Schema File window opens. Select the Copy to Project checkbox and then browse to select the HelloObject.xsd file you justsaved to your local file system.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 12/85

    Click OK in the Import Schema File window. Also click OK in the next window to confirm your choice.

    In the Type Chooser window, you can now see the structure of the HelloObject schema file. SelectHelloObject and click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 13/85

    4. The HelloObject now appears in the Business Object editor in the main panel of the Studio window.Notice the three attributes of this object type: date (Time), greeting (String), and message (String). Close the HelloObject editor by clicking the X on the tab.

    You should also see the HelloObject appearing in the Business Catalog under HelloTypes, and in theStructure Panel (assuming HelloObject is selected).

    Click Save All.

    5. Now create a process data ob ject of type HelloObject so that you can use it in your process. If theHelloWorldProcess is still open in the design editor, click anywhere in the design editor to set thecontext of the Structure panel, causing it to show the HelloWorldProcess structure. (If it is not open,select it in the BPM project navigator.)

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 14/85

    select it in the BPM project navigator.) A detailed outline of the process structure now appears in the Structure panel.

    Right-click on Process Data Objects and select New.

    In the Create Data Object popup window, enter hello as the Name. In the Type field, select. Then click the Browse button to select the component type.

    In the Browse Types window, select HelloObject and click OK.

    Back in the Create Data Object window, click OK again. The hello data object now appears in the Structure panel.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 15/85

    Click Save All.

    Implementing the User Task

    Every user task must be bound to a human task service that provides its implementation. In this section, you createa human task for the Request Hello user task. Then you create a web form for the user to enter the hello messageand greeting.

    1. Create the human task that implements the Request Hello user task.

    Right-click the Request Hello user task and select Properties.

    Click the Implementation tab. Next to the Human Task field, click the plus sign button to create a newhuman task.

    Structure Panel

    In the Create Human Task dialog box, enter or select the following values for fields in the top portion ofthe dialog.

    Field Value

    Name SayHello

    Title Please Enter a Hello Message

    Outcomes Submit

    Pattern Initiator

    Add a parameter by clicking the plus icon above and to the right of the Parameters panel as shownbelow.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 16/85

    This opens the Data Object window, displaying available data objects that you can drag into theParameters panel. Click the hello data object and drag it into the parameters panel. Select the Editablecheckbox for the new parameter.

    Click OK. This closes both windows and you are returned to the Properties window for the RequestHello user task.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 17/85

    Hello user task. Notice that the parameter has been named HelloObject. The scope of this parameter is the humantask. Its value does not persist beyond the completion of the human task. We want the data that the user enters in the hello message to be accessible from the Write Message

    activity. Studio mapped the HelloObject parameter to the hello process data object (whose scope is the entireprocess) when you added this parameter.

    Click the Data Associations link in the Properties window to view this automatic mapping. Select the Output tab. You can see that the helloObject from the Request Hello human task on theleft has been mapped to the hello data object in the HelloWorldProcess on the right.

    Click OK to close the Data Associations window. Also click OK to close the Properties window. Click Save All.

    2. Now you provide a web form for the user to enter the Hello message, ensuring that the form is linked tothe hello data object. Right-click the Request Hello user task and select Open Human Task.When the human task editor opens, click the Create Form drop-down list in the editor toolbar and selectAuto-Generate Task Form.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 18/85

    The Create Project window opens. It is necessary to create a separate project to contain UI elements(web forms). Enter HelloWorld_UI as the Project Name and accept the default directory. Click OK whenfinished.

    It will take several seconds (even up to a minute, depending on resources) to create the form and openthe ADF page editor. Eventually, you will see the editor shown below (partial view). The highlightedsection is the portion that will be visible to the end user. Notice the Date, Greeting, and Message fields.

    Select the Message field as shown above. When you do so, the properties for this field appear in apanel in the lower right corner of the Studio window.Expand the Appearance accordion panel within this panel and change the value of the property to 5.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 19/85

    Tab out of the field so that the change will take effect in the form.

    Click Save All. Close all of the tabbed panels except for the HelloWorldProcess tab.

    Implementing the File Service

    Here you create the implementation for the Write Message service activity using the SOA Composite editor.

    1. Click the Goto Composite Editor button on the design editor toolbar as shown below.

    Open Composite Editor

    The SOA Composite editor opens. The HelloWorldProcess BPMN component and the SayHello humantask component are shown in the composite editor. Notice that the SayHello human task is "wired into" the process. This is because the SayHello component is associated with a user task on theprocess flow. It implements the user task.

    Composite diagram

    2. Create a File Adapter service. If you do not see the Component Palette tab on the right side of the Studiowindow, open it from the View menu. Find the File Adapter service adapter in the Component Palette.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 20/85

    window, open it from the View menu. Find the File Adapter service adapter in the Component Palette.

    Drag it to the External Reference column of the Composite Editor and drop it there.

    The Adapter wizard opens when you drop it.

    3. Click Next on the Welcome page of the Adapter Configuration Wizard

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 21/85

    3. Click Next on the Welcome page of the Adapter Configuration WizardOn the Service Name page of the wizard, name the service MessageWriter. Click Next.

    File Adapter configuration wizard - 2

    On the Adapter Interface page, select Define from operation and schema (specified later). Click Next.

    On the Operation page, select Write File. The Operation Name will be pre-populated with the nameWrite. Accept this value and click Next.

    File Adapter configuration wizard - 4

    On the File Configuration page, select Physical Path as the Directory specified. Enter a dot ('.') for the"Directory for Outgoing Files (physical path)" field. Also enter a File Naming Convention of: Hello_%SEQ%.xml

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 22/85

    Click Next.

    In the Messages page, you determine what should be written to the file. Click the magnifying glass iconnext to the URL field to open the Type Chooser popup.

    Expand Project Schema Files > HelloObject.xsd to find and select HelloObject as shown below. ClickOK to accept the selection and return to the Messages page of the wizard.

    Click Next in the Messages window.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 23/85

    Click Finish in the final page of the wizard and then click Save All.

    The service is created and appears in the SOA Composite editor. At this point, it does not appear,however, in the Business Catalog.

    Close and reopen the HelloWorld_OBE application to allow Studio to incorporate the newMessageWriter service into the Business Catalog. From the Application Navigator drop-down menu, select Close Application. When the application hasclose, click Open Application and browse to \JDeveloper\mywork\HelloWorld_OBE. Double-click the helloworld_obe.jws file. The application reopens.

    4. In this step, you wire the MessageWriter service to the Write Message activity in the process. Open theHelloWorldProcess in the design editor by double-clicking the item in the BPM Project Navigator.

    Right-click the Write Message activity and select Properties. Click the Implementation tab.

    In the Message Exchange section, select Service Call as the Type. The window changes to include aService Call section.

    Click the Browse button (magnifying glass icon) next to the Service field to browse for a service. TheService popup window appears, displaying the MessageWriter service you just created. Select it andclick OK in the Service popup.

    Back in the Properties window, notice that the Operation field has been automatically set to write.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 24/85

    Click the Data Associations link to map data into the MessageWriter service.

    In the Data Associations window, select the Input tab. Click the hello data object from theHelloWorldProcess panel and drag a line to the right, to connect it to the helloObject argument in theWrite Message panel. Beneath the two panels, you can see that the value from hello will be copied tothe helloObject argument.

    Click OK in the Data Associations window to save the mapping and return to the Properties window.

    Click OK in the Properties window. Click Save All.

    In this section, you enhance the basic process you just built by adding a review capability for the message entered bythe user. You add another business object to hold review-related data and use this business object in conjunction with

    Enhancing the Basic Hello World Process

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 25/85

    the user. You add another business object to hold review-related data and use this business object in conjunction witha business rule that tests the length of the greeting and message. You also add another human interaction that allowsthe user with the Reviewer role to review the entered message and accept or reject the message.

    After adding the new flow object, you change the process flow so that it conditionally branches to the Review Messageactivity and potentially back to the Request Hello activity if the message was rejected. A script task will also be neededin order to initialize a variable used in the conditional branching logic.

    You begin the enhancement by changing the name of the role assigned to the user who executes the Request Helloactivity to something more meaningful. Then you add a new role for the user who reviews the message.

    Adding the ReviewObject Business Object

    1. Currently all the activities of process are assigned to a default role called "Role". You now create a newrole called "Requester" and assign that role to the swim lane containing the entire process flow.

    In the process design editor, right-click on Role at the left edge of the swim lane and select Properties.

    In the "Role properties" window, click New. In the Role popup window, enter Requester in the Name

    field and click OK.

    With the "Role properties" window still open (and now displaying the Requester role as the selectedrole), create another new role called Reviewer. Click OK in the Role popup window.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 26/85

    In the "Role properties window", change the selected role back to Requester. Notice that there are now

    several roles appearing in the drop-down list of roles. Click OK to close the "Role properties" window.

    Click OK to close the "Role properties" window. Notice that the Requester role now appears in the swimlane. Add another swim lane beneath the Requester swim lane. Right-click the bottom portion of the swimlane and select Add Role.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 27/85

    When the "Role properties" window opens again, select the Reviewer role from the drop-down list andthen click OK.

    2. Click Save All.

    3. Add a new business object in the same manner that you did in the Creating the Business Objectsection above.

    Download the ReviewObject.xsd file and save it to a folder on your local machine.

    Follow Step 3 of that section, placing the new business object in the HelloTypes module.

    Name the object ReviewObject and, in the Import Schema window, select ReviewObject.xsd from the

    file system, making sure to copy it to the project.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 28/85

    When you have finished creating the object, the Business Object editor will open, displayingReviewObject as shown below.

    Click Save All and close the Business Object Editor. The ReviewObject should now appear in theBusiness Catalog in the HelloTypes module.

    4. Declare a process data object of type ReviewObject in the same manner that you did in the Creatingthe Business Object section above. Follow the instructions in Step 5, substituting review as the data

    object name.

    Add one more process data object of type String, called reviewOutcome. Follow the same procedure

    as the previous step, except choose String as the type.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 29/85

    You should now see three process data objects in the Structure panel as shown below.

    Adding a Business Rule

    1. Add a business rule to the process model.

    Begin by making more room on the sequence flow between Request Hello and Write Message.

    From the flow objects drop-down menu, expand the Activity palette. Click the Business rule activity icon in the palette and drop it on the sequence flow between RequestHello and Write Message. Be sure that the transition line is blue when you drop business rule.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 30/85

    The Properties dialog for the business rule appears when you drop the object. Enter Review Needed in

    the Name field. Click OK.

    Name the busines rule.

    Click OK.

    2. Open the Composite editor by clicking the Goto Composite Editor button on the Design editor toolbar.

    3. Add a Business Rule component to the Composite Editor. From the Component Palette panel on theright, click and drag a Business Rule from the Service Components section of the palette and drop it inthe Components column of the Composite Editor.

    When you drop the component, the Properties dialog appears. Enter HelloRules in the Name field.

    Then click the green plus button above the Inputs/Outputs section and select Input...

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 31/85

    The Type Chooser popup window appears. Expand the second HelloObject.xsd entry, and then selectthe HelloObject beneath it. Click OK.

    In the Create Business Rules dialog, click the green plus button once more and this time selectOutput... When the Type Chooser popup window appears, expand the second ReviewObject.xsd entryand select ReviewObject. Click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 32/85

    Back in the Create Business Rules dialog, click OK.

    Click Save All.

    4. Now wire the implementation that you just created (the HelloRules business rule) to the ReviewNeededbusiness rule activity in the BPM process. Click the HelloWorldProcess tab to bring the focus back to theBPM Design Editor. Right click ReviewNeeded to open its properties window. Click the Implementation tab.Click the browse button to the right of the Business Rule field. In the Browse Business Rules popupwindow, select HelloRules and click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 33/85

    5. Click the Data Associations link to open the Data Associations editor. In this window, you map processdata objects (hello and review) to the Inputs and Outputs that you defined for the HelloRules businessrule implementation.

    Click the Input tab. In the left column, click the hello process data object and drag it to thehelloObject argument of the Review Needed business rule in the right column.

    Now click the Output tab. Click and drag the reviewObject argument from the left column to thereview process data object in the right column.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 34/85

    Click OK in the Data Association editor. Then click OK in the Properties window. Click Save All.

    Defining a Decision Table for the Business Rule

    In this section, you define a set of rules that will be applied when the user enters a hello message and greeting. The following table illustrates what those rules are and how they will be applied.

    The lengths of the HelloObject.greeting and HelloObject.message strings will be evaluated. You will definefour rules that determine the combination of greeting and message lengths and then set the appropriate values tothe ReviewObject properties: reason and review.

    For example, if the greeting length is medium and message length is short, reviewObject.reason would be setto "Length is too short" and reviewObject.reason would be set to "true". Consequently, the process would flowto a Review Needed activity and could be accepted or rejected by the reviewer.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 35/85

    to a Review Needed activity and could be accepted or rejected by the reviewer.

    A decision table can be designed in many different ways. In our scenario, the decision table consists of fourelements as described below.

    A set of Conditions: In this case, each condition is the length of either the greeting or the message stringvariable.A Range of Values, called a bucketset : For example, a variable might be range > action. Each of the last four columns in the tableabove represents a rule.

    A decision table is created in five high-level steps:

    1. Define the conditions (Step 2 below)2. Define a bucketset (Step 3)3. Assign the bucketset to each condition (Step 4)4. Define the action (Step 5)5. Define the rules (Steps 6-9)

    1. Open the Rules Editor.

    In the BPM Navigator, expand Business Catalog > Rules > Helloworldproject. Double click onHelloRules.rules.

    The Rules Editor opens and you can begin defining the various elements of this "Ruleset"(ruleRuleset_1).Create a decision table. Click the down arrow next to the green plus sign button on the toolbar andselect Create Decision Table from the drop-down menu.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 36/85

    The Rules Editor changes to a table view. You may wish to double click the HelloRules.rules tab tomake the editor panel fill the whole Studio window. This will give you more room to work on the decisiontable. You can always bring the editor tabbed page back to its previous size by double clicking it again.

    Change the default name of the decision table from DecisionTable_1 to ReviewDecisionTable.

    Click on the field containing the default name. A text field appears below it. Enter the new name and clickEnter to accept the value.

    2. Define two conditions for the decision table to analyze:The length of helloObject.greetingThe length of helloObject.message

    Add the first condition by clicking on the field in the table as shown below. This willautomatically add the C1 condition.

    Double-click the C1 condition default value in the Conditions column. This opens a drop-down menudisplaying available functions and data object types. Expand HelloObjectType > greeting and click the length function.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 37/85

    The C1 condition expression now appears in the Condition column.

    Add a second condition by clicking the green plus sign above and to the right of the Conditions column.Select Condition from the drop-down menu.

    Double click the C2 condition to edit it as you did previously. Notice that, this time, the condition has adefault value of HelloObjectType.

    When the drop-down menu appears, expand HelloObjectType > message and click the length function.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 38/85

    Both conditions are now defined. Click Save All.

    3. The rule will compare each condition against a range of values called a "bucketset". Click theBucketsets node in the left panel of the Rules Editor to create the bucketset.

    Click the green plus sign button and select List of Ranges from the drop-down menu.

    A new bucketset row is inserted. With this row selected, click the pencil icon to edit the list of ranges.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 39/85

    In the Edit Bucketset window that appears, change the value of the Name field to Lengths. Leave the

    Data Type field set to int.

    The Range Bucket Values table has an initial default row in which the Endpoint is set to -Infinity.Click the green plus sign button twice more to add two more rows.

    Change the 0 (zero) Endpoint value to 5 by clicking on the value and typing the new value. Notice that this

    changes the Range for this row to [5..50] and also changes the Range of the row whose endpoint is -Infinity to

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 40/85

    Click OK to close the Edit Bucketset window. Click Save.

    4. Assign the Lengths bucketset to each condition in your conditions table. Click the Ruleset_1 node in the

    Ruleset editor to bring back the decision table editor.

    Click the C1 condition to select it and then click the Local List of Ranges drop-down list above theConditions table and select Lengths.

    Do the same thing for the C2 condition.

    5. You are almost ready to start defining the rules to be applied to each combination of range of values andcondition. First you must define an Action to be performed when a rule is implemented.

    Create a new Action. In the Actions panel, click the field and select Assert New.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 41/85

    Once the assert new line appears, right-click it and select Edit.

    The Action Editor window opens. Select ReviewObjectType from the Facts panel. The properties of thisobject type now appear in the Properties panel in the lower portion of the window. Select theParameterized and Constant checkboxes for both the reason and the review properties.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 42/85

    Notice that an assert new( ) statement has now been constructed in the Value field. It instantiates aReviewObject with values for the reason property (a String), and the review property (a String). Youcan see this assert statement in the screenshot above. Each rule that you define in the next step willprovide specific values for these parameters.

    Click OK, then Save.

    6. Define the first rule (R1). Click on the C1 row beneath the R1 column. A drop-down list appearsrepresenting the bucketset you assigned to this condition. Select Short and click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 43/85

    Click the R1 column for the C2 row. This is the length for the message property. In this case, it doesn'tmatter what the length is, so select the Specify value as Don't Care checkbox. Notice that a dash (-) isplaced in the C2 row for this condition.

    Click OK.

    In the Actions panel, click the checkbox in the column to the right of the assert new statement,indicating that you do want the ReviewObject asserted for this rule. Then click the row beneath thecheckbox, next to the reason property. When the text field appears, type: "Greeting is too short".

    Hit Enter when finished.

    Click the column next to the review property and enter the value "true". Hit Enter when finished.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 44/85

    You have just defined Rule 1, indicating that if the greeting is "Short" (

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 45/85

    8. Define the last rule that appears in the table as shown at the beginning of this section. Define it in thesame way you defined the rule in the preceding step. The table below provides the values you will use.

    Section of Decision Table Property Value to Set

    Condition HelloObject.greeting.length( ) Long

    Condition HelloObject.message.length( ) -

    Action ReviewObject.reason null

    Action ReviewObject.review "false"

    Note that you must select the null from the drop-down list, rather than type it into the text field.

    9. Run the Gap Analysis tool to automatically create the final rule. It will determine which conditions havenot been accommodated by the existing rules. Click the Gap Analysis button on the Decision Table

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 46/85

    not been accommodated by the existing rules. Click the Gap Analysis button on the Decision Table

    editor toolbar.

    The Gap Analysis window opens showing the rule that it determined was missing. Click the checkbox in

    the column header to allow the rule to be included in the decision table. Click OK.

    The rule now appears in the decision table as Rule 3 and the rule that you defined in the last step

    moves to the Rule 4 position.

    Assert the action for Rule 3 (Column R3) and add the following action values:

    reason = null

    review = "false"

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 47/85

    Click Save and close the HelloRules.Rules tab.

    Adding the Review Message User Task

    1. Add a new user task activity to the HelloWorldProcess.

    From the design editor toolbar, expand the Interactive drop-down palette and click the User icon.

    Drop the user task into the Reviewer swim lane, just below the Review Needed business rule task.

    When the Properties window opens, name the activity Review Message.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 48/85

    2. Click the Implementation tab to define the a human task implementation for the activity. Click the green

    plus sign icon to create a new human task.

    In the Create Human Task window, enter values into the Name and Title field as shown below. Accept

    the other default values.Name: ReviewMessage

    Title: Review the Message

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 49/85

    Click the green plus sign icon next to the Properties panel as shown above to add parameters (thisdefines the payload for the human task.)

    The Data Object popup window appears next to the Create HumanTask window. Drag the hello andreview process data objects into the Parameters panel. Select the Editable checkbox for the hello

    object only. Also drag the reviewOutcome data object into the Outcome target field.

    Note: When a parameter is marked "editable", you are able to map the parameter as output from thehuman task. Since the reviewer will not edit the review object, it does not need to be mapped out of the

    human task. Recall that the review object contains the outcome of the business rule. The outcome ofthe task (in this case, either "APPROVE" or "REJECT") is now mapped to the reviewOutcome data

    object.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 50/85

    Click OK in the Create Human Task window. Click OK in the Properties window. Click Save All.

    3. Create a task form for the ReviewMessage human task. Right-click the Review Message user task inthe HelloWorldProcess process model. Select Open Human Task from the context menu.

    In the Human Task Editor, select Auto-Generate Task Form from the Create Form drop-down menu.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 51/85

    When the Create Project popup window appears, enter ReviewMessage_UI as the project name. ClickOK.

    After a lengthy delay (up to minute), during which time several interim screens will appear, thetaskDetails1.jspx form will appear in the page editor.

    The payload can be seen in the Contents panel of the web page. Notice that both the hello and review

    objects are included.

    Select the Message Input Text field as shown above. The Property Inspector panel now displays the

    properties of this field. In the Appearance section, change the Rows property to 5 and hit Enter.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 52/85

    Click Save All and then close all of the tabbed pages except the HelloWorldProcess tab.

    Adding Conditional Branching

    1. Add an Exclusive Gateway to the process model.

    Begin by moving the End event and the Write Message activity to the right to make room for the exclusive

    gateway.

    From the Gateway drop-down menu, click Exclusive.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 53/85

    Drop it on the sequence flow between Review Needed and Write Message.

    Remember that the line must be blue when you drop the object.

    When you drop it, the Properties window opens. Change the name of the gateway to g1 and click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 54/85

    2. Add a second exclusive gateway to the sequence flow between g1 and Write Message. Follow the

    same procedure you did in the last step. Name this gateway g2.

    3. Add a conditional sequence flow from g1 to Review Message. Right click on g1 and select Addconditional sequence flow.

    Connect the conditional sequence flow to Review Message. Reshape the sequence flow as shown

    below by clicking the flow and dragging it into position.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 55/85

    4. Add a default sequence flow from Review Message to g2. Right-click on Review Message and selectAdd default sequence flow.

    Connect the other end of the sequence flow by clicking on g2. Reshape the transition line as shownbelow, as you did in the previous step.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 56/85

    5. Add a conditional sequence flow from g1 to Request Hello. Reshape the transition line as you have theother two transition lines. (It will be obscured by the existing main sequence flow) It should look like this

    when you've finished.

    6. Define the condition for the sequence flow from g1 to Review Message. Double-click the transition linebetween the two objects. The Transition properties window opens.

    On the Description tab, name the transition Review Needed.

    Click the Properties tab. On this tab, you define an expression whose outcome determines whether the

    process flows down this transition to the Review Message activity. In other words, you define thecondition for the conditional sequence flow. Click the Expression Builder button on the right side of the

    window.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 57/85

    The Expression Builder opens. Build the expression in 3 steps:

    1. In the Variables panel, expand review and select the review attribute.2. Click the Insert Into Expression button. This puts review.review into the Expression panel at

    the top.3. In the Expression panel, add:

    = "true"

    to the existing variable reference.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 58/85

    Click OK when finished to close the Expression Builder.

    Click OK to close the transition properties window.

    7. Define the condition for the sequence flow from g2 to Request Hello. Double click on the transition line

    between the two objects. The transition properties window opens.

    On the Description tab, name the transition Message Rejected.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 59/85

    Click the Properties tab. Open the Expression Builder and define the following expression, using thesame procedure as you did in the last step:

    reviewOutcome = "REJECT"

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 60/85

    Click OK when finished to close the Expression Builder.

    Click OK to close the transition properties window.

    Click Save All.

    8. Your process should now look like this:

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 61/85

    Adding a Script Task

    When the process flow reaches the second gateway (g2), it checks the value of the reviewOutcome data object.There must be a value in the reviewOutcome data object in order for the process to move on to the Write Message

    activity. If the value is REJECT, the process returns to Request Hello.

    When a message is flagged for review, the reviewer clicks either REJECT or APPROVE, thereby populating thereviewOutcome data object.

    If the process skips the review branch and moves from the g1 gateway directly to the g2 gateway, thereviewOutcome data object has no value.

    In this section, you add a script task to initialize reviewOutcome between g1 and g2.

    1. From the Activities drop-down menu on the design editor toolbar, click Script and drop it on the transitionline between g1 and g2.

    When the Properties window opens, name the activity InitApproval on the Basic tab and click OK.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 62/85

    When the Properties window opens, name the activity InitApproval on the Basic tab and click OK.

    2. Define the implementation for the InitApproval task. Right-click InitApproval and select Properties.

    When the Properties window opens, click the Implementations tab, then click the Data Associations

    link.

    In the Data Associations window, click the function button (fx) from the toolbar and drop it into the centerpanel as shown below. This opens the Expression Builder window where you can define

    an expression to be copied to the reviewOutcome data object.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 63/85

    In the Expression Builder, expand the Data Objects folder in the Variables panel and select

    reviewOutcome. Click Insert Into Expression, adding it to the expression panel. Then add: ="APPROVE" to complete the expression.

    Click OK to close the Expression Builder.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 64/85

    In the Data Associations window, drag a line from the fx icon (which represents the expression you justdefined) to the reviewOutcome data object in the right panel.

    Click OK to close the Data Associations window.

    Click OK to close the InitApproval task properties window.

    Click Save All. The Hello World process is now complete!

    In this section, you deploy the Hello World application to the BPM engine running in the WebLogic server that is part ofyour SOA installation. This tutorial assumes that your server is running on your local machine (localhost). If it is running

    on a remote machine, you need to know the server hostname and port.

    In either case, you also need to know:

    The WebLogic domain in which SOA is running

    The username and password for the WebLogic administrative userThe name of the WebLogic server instance to which you will deploy. This tutorial assumes a single server

    configuration (i.e. not managed instances), and will deploy to the Admin Server

    Before deploying the application, you connect to the internal LDAP realm within the WebLogic server and map the

    Reviewer and Requester roles to a user in the LDAP directory. When you seeded the DemoDB as a prerequisite to thistutorial, you populated the LDAP realm. We will map one of those users to the roles.

    After deployment, you run the Oracle BPM Workspace to test the Hello World application.

    Mapping Application Roles to an LDAP User

    1. In the BPM Project Navigator, expand the HelloWorldProject and right click on the Organization node,selecting Open.

    Deploying and Testing the Application

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 65/85

    2. Add user members to the Requester application role. In the Organization editor, the Roles tab is

    selected by default and all application roles are displayed. Select the Requester role by clicking itscheckbox.

    Click the Browse button (magnifying glass icon) to the right of the Members panel.

    The Identity Lookup window opens. Studio is not yet aware of your SOA/BPM server, so the only

    application server that appears is the Integrated WebLogic Server that was installed with JDeveloper.

    Create a new profile for your SOA / BPM server. Click the green plus sign icon next to the Application

    Server field to launch the Create Application Server Connection wizard.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 66/85

    3. In the Name and Type page of the wizard, enter BPMServer. Make sure that the Connection Type is

    WebLogic 10.3. Click Next.

    In the Authentication page of the wizard, enter weblogic as the Username and welcome1 as the

    Password (or substitute your weblogic password). Click Next.

    In the Configuration page of the wizard, enter your WebLogic Hostname (localhost used here). Accept

    the default values for Port and SSL Port, and enter domain1 in the WebLogic Domain field. Click Next.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 67/85

    In the Test page of the wizard, click the Test Connection button. You should see results similar to those

    shown below. If not, click the Back button, correct any errors and test again.

    Click Finish.

    You are now returned to the Identity Lookup window.

    4. Select BPMServer from the Application Server list. After a few seconds, Studio will connect to the LDAP

    server in the BPM server and you see jazn.* appearing in the Realm field.

    Click the browse icon next to the User Name field to bring up a list of all users in the Demo Community

    from the LDAP server. Select jcooper from the list and click the Select button.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 68/85

    jcooper will appear in the Selected Users panel of this window. Click OK to return to the Organizationeditor.

    jcooper appears now as a user member of the Requester role.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 69/85

    5. Follow the same procedure as in the previous step to add jcooper to the Reviewer role as well.

    Click Save All and close the Organization editor.

    Deploying the Process

    When you deploy a BPM application, there are actually two pieces that get deployed: a SOA composite application,

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 70/85

    and a web application containing the user interface (UI) modules.

    While it is possible to deploy both of these with a single deployment, a redeployment would fail. Therefore, you will

    deploy the composite application first, then create a custom deployment profile to deploy the UI modules.

    1. Deploy the composite application.

    In the Application Navigator, right click the HelloWorldProject and select Deploy > HelloWorldProject.

    The Deploy HelloWorldProject wizard opens.

    2. In the "Deployment Action" page of the wizard, select Deploy to Application Server and click Next.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 71/85

    In the "Deploy Configuration" page, click the Overwrite any existing composites with the same revisionID checkbox, but deselect the Keep running instances on after deployment checkbox.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 72/85

    In the "Task flow deployment" page, do not select any of the checkboxes. We do not want to deploy anytask flows here. Click Next.

    In the "Select Server" page, select BPMServer. Click Finish.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 73/85

    Check the Deployment tab in the Log panel in the lower central portion of the Studio window to watch the

    progress and determine when deployment has finished. The SOA composite is deployed as a JAR file,called sca_HelloWorldProject_rev1.0.jar.

    3. Deploy the UI modules.

    Select Application > Application Properties from the main menu.

    The Application Properties dialog opens. Select the Deployment node in the left column. In the rightcolumn, you see the existing deployment profiles - one for each of the task flows you created. You create

    a custom deployment profile now that will deploy both task flows together in one web application.

    Click the New button to create a new deployment profile.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 74/85

    The "Create Deployment Profile" window opens. Name the profile HelloWorldOBE_UI. Click OK.

    The "Edit EAR Deployment Profile Properties" window opens. Select Application Assembly in the left

    panel. In the Application Assembly panel, select the HelloWorld_UI and the ReviewMessage_UIcheckboxes.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 75/85

    checkboxes.

    Click OK.

    Click OK again in the Application Properties window.

    4. Deploy the UI modules using the custom deployment profile. From the Application menu, select Deploy> HelloWorldOBE_UI.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 76/85

    The Deployment wizard opens. On the Deployment Action page, select Deploy to Application Server.Click Next.

    On the Select Server page, select BPMServer. Click Next.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 77/85

    On the Weblogic Options page, click the Deploy to selected instances in the domain radio button. Thenselect the Admin Server from the list of standalone servers and clusters.

    Note: Your list of servers may be different than what is shown in the screenshot.

    Click Next.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 78/85

    Review the Summary page information and then click Finish.

    Review the Deployment tab of the Log panel as you did earlier to determine when the deployment has

    finished. Notice that the task flows (UI modules) were deployed as a web application in the form of anEAR file.

    Testing the Process in BPM Workspace

    1. Open a browser and enter the following URL:

    http://:7001/bpm/workspace

    When the Welcome page of the Workspace appears, enter jcooper in the Username field and

    welcome1 in the Password field. Click Log In.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 79/85

    The main workspace window opens.

    2. Instantiate the process. Select Applications in the left panel. Then click the HelloWorldProcess link.

    This action executes the first task of the process, Request Hello.

    3. For the first test, enter a message that will not require review. In the Please Enter a Hello Message

    browser window that appears, enter a value in the Date field by clicking the calendar icon and selectinga date. Also enter values in the Greeting and Message fields.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 80/85

    Both the Greeting and the Message field values should have a length greater than 5 characters in order

    to avoid review.

    Click Submit to save the values and close the window.

    After submitting the message, the process goes to the ReviewNeeded business rule. Since both the

    Greeting and the Message are considered "Medium" in length, the message does not require a review.Hence the process goes through the g1 gateway, the reviewOutcome data object is initialized in the

    script task, and the process flows on through the g2 gateway to the Write Message task.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 81/85

    Write Message is a service task, rather than an interactive task, therefore there will be no indication of its

    action in the Workspace.

    4. Open the file that was created by the Write Message implementation. Recall that you configured the fileadapter to write the file to the relative path "." (dot). This is relative to the domain1 directory within the

    WebLogic file structure.

    Locate and open the file:

    /user_projects/domains/domain1/Hello_1.xml

    Open it in a text editor or browser to view the outcome from your process.

    It should look something like this:

    5. Create another instance of the Hello World process by once more clicking the HelloWorldProcess link.

    (You may need to log in again if your session has timed out.)

    This time, enter a message that will be routed to the Review Message user task.

    When the "Please Enter a Hello Message" window appears, enter a date and a greeting that haslength < 5. Leave the Message field blank. Click Submit.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 82/85

    6. The process now flows, as before, to the business rule where the greeting is found to be "Short". As

    you'll recall, when the greeting is "short", the message requires review, regardless of what is in theMessage field. Consequently, the process now flows to the Review Message task, which is assigned to

    the Reviewer role.

    Remember that jcooper has both the Requester and the Reviewer roles. In order to see the Review

    Message task that has been routed to him, click the Views tab in the left column, and then click the My

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 83/85

    Message task that has been routed to him, click the Views tab in the left column, and then click the MyTasks (0) link. As soon as you click it, the (0) is replaced by (1), reflecting the number of tasks currently

    awaiting jcooper's attention.

    The Review the Message human task can now be seen in the Inbox. Click it to see the details in thelower panel of the Inbox.

    In the details panel, you can see the taskflow form that you created for this activity, containing formelements for both the HelloObject and the ReviewObject. Notice that the ReviewObject attributes

    have been assigned by the Business Rules engine after executing the business rule for this message.

    Click Reject when you have finished examining the details.

    7. The process now flows to the g2 gateway where the value of the reviewOutcome data object isexamined. It has been set to REJECT by the reviewer, so the process now flows back to Request Hello.

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 84/85

    The Please Enter a Hello Message link appears in the Inbox. This is the title string for the humantaskflow associated with the Request Hello task. Previously, this task did not appear in the Inbox

    because it was opened in a separate browser window immediately upon instantiation of the process.This time it appears in the Inbox.

    Click the link to view the input form and enter a more appropriate message that does not require review

    as you did in Step 3. Click Submit when finished.

    The process now flows through the two gateways to the Write Message activity and to the End activity.

    The Inbox is now empty. The process has completed.

    8. Log out of the Workspace. The tutorial is finished!

    In this tutorial, you have learned how to create a simple process that illustrates some of the basic features of Oracle

    BPM's modeling and implementation capability. This is just a start. However, it has given you hands on exposure tosome of the key benefits of the product such as:

    Modeling complex business logic with the Studio IDE

    Creating business rules with complex decision tablesCreating auto-generated forms for human interaction

    Moving and persisting data throughout a business processIntegrating a business process with external systems

    Testing a process using the BPM Workspace

    Resources

    Mastering BPM 11g Webinar Series

    Oracle BPM 11g: Implement the Process Model Ed 3: This is a 5 day course available through Oracle

    Summary

  • 7/4/2015 Building Your First Process with Oracle BPM 11g

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/buildFirstProcess/11gr1bpm.html 85/85

    Oracle BPM 11g: Implement the Process Model Ed 3: This is a 5 day course available through OracleUniversity. It is available as an Instructor Led course, or Live Virtual Classroom format.

    Many samples, demos, and viewlets are available at https://java.net/projects/oraclebpmsuite11g/pages/Home

    To learn more about Oracle BPM 11g refer to additional OBEs and demos in the Oracle Learning Library

    Credits

    Lead Curriculum Developer: Jill MoritzOther Contributors: Heidi Buelow