Saturday, August 23, 2014

Creating and Executing Test Cases for BPM Processes


(JDeveloper 12.1.3 / WLS 12.1.3 / SOA/BPM Suite 12.1.3)
  
In this post I will show how to create and execute Test Cases for BPM Processes.
I will be using the same project which I used to show how to define Business Rules in BPM.
http://sameerdarbha.blogspot.com/2013/07/implementing-business-rules-in-bpm.html
The above project was created in 11.1.1.7 version of BPM.

For this post, I will be using JDeveloper/BPM Suite/WLS 12.1.3.
I have migrated the application ‘EmployeeTravelExpenseSystem’ to 12.1.3.

And I modified the process a little bit to add another Start activity of type ‘Message’ so that we can start and test this process from EM console. It takes the input as the same object ‘TravelExpenseObject’ as shown below.


Right click on ‘SOA > testsuites’ to create a Test Suite as shown below and give a name to the Test Suite.



Right click on the Test Suite ‘ETEAPTestSuite’ and create a Test case ‘AutoApprovalTestCase’


Click ‘Generate Sample’ button to generate the input XML and enter the parameters satisfying the Auto approval case according to the Business rules. (Check the previous post to check the conditions).


A new file ‘AutoApprovalTestCase.xml’ file will be created as shown below which looks like the composite.xml


Create another test ‘RequiredApprovalTestCase’ with the input xml as follows satisfying the Required  Approval case according to the Business rules.


We can run the individual Test cases or even the complete Test Suite from within JDeveloper.
Right click the Test Suite name and select ‘Run Test Suite’.



JDeveloper will ask for the server name to which this application has to be deployed. Enter the name of the server.


 Enter the test case execution name and select the test cases you want to run.


 A new file will be opened showing the test results of the Test Case execution.


Also these test case execution results can be seen in the EM console.
This application is deployed to a 'Compact Domain' in the WLS.


Optionally the test cases also can be run on the EM console, since the test cases are deployed along with the application.



When the Test Suite is run, 1 instance of the process for each test case is created.
The instances created by the Automated Test Cases like this will be shown with a yellow 'dot'.
The Test case for Auto approval process flow is as follows.


The test case for Approval required process flow is as follows.


Sunday, November 17, 2013

Inter Process Communication with Send and Receive Tasks using Correlations


(JDeveloper 11.1.1.6, WLS 10.3.6, SOA/BPM 11.1.1.6)

Following is a simple approach to use inter process communication in BPM using Send and Receive tasks using Correlations.

I created two simple BPM processes, first process as shown below will start and wait at the Wait (Receive Task).
When the process instance is created, the correlation also gets instantiated.
In this case, the correlation key is the input parameter to the Start task of the process.
It takes the input and sets the correlation key for that process instance.

First we need to Initiate the correlation keys at Start.
Also, we have to set the data mappings.



Then we need to use the Correlation keys on the Wait (Receive Task)



The second process is the process which will call the first process with a Send activity by passing the value of the data for specifying which process instance to pick up using the correlation key.
We use the Send message activity to call the First process by passing the value of the correlation key to get the correct process instance.



Testing

I instantiated 3 instances of the first process with data values 101, 102, 103 (these are set as correlation keys)


I called the second process by passing the value 102.


The second process completes and which calls the instance 102 of the first process at the receive task and because of which the 102 instance is also completed.




   

Monday, July 15, 2013

Implementing Business Rules in BPM Processes

Implementing Business Rules in BPM Processes
(JDeveloper 11.1.1.7, WLS 10.3.6, SOA/BPM 11.1.1.7)


In this post I would like to show how to implement Business Rules in Oracle BPM Processes.


Let us assume a scenario where an employee wants to travel on business and it needs manager’s approval on certain scenarios as the following table. All other cases it is automatically approved.


Destination Type
Duration (Days)
Business Class
Amount ($)
International



Domestic
> 30


Domestic

Y

Domestic


> 1000


  1. Create a BPM Application with a manual process



  1. Define a business object with the following attributes



  1. Modify the process as follows and create Human tasks and Business rule

  1. Create Business Rules as follows



  1. Open the Business Rules editor and select Rulesets and change the Ruleset name to “Manual Approval Ruleset” and create a Decision table for the View property and name it as “Approval Decision Table”.



  1. Build Decision table as follows according to the above table



  1. You can create LOVs dynamically as follows which will create the Bucketsets


  1. Similarly you can create ranges for duration and expense amounts also


  1. You can select the values from the LOVs as shown below from all the bucketsets for destination types, duration and amounts



  1. Fill the Actions section for all the Rules for the manualApprovalRequired, reviewOutcome attributes selecting ‘modify’ as the action


  1. Validate the Business Rules as shown below and make sure there are no warnings or errors



  1. Set the condition for the conditional flow for ‘Is Auto Approved’ exclusive gate as follows




  1. Assign the output data mapping for Review Travel Expense task as follows



  1. Build the project and build the ADF UI project for the Human Tasks UI. For more detailed steps follow my previous blog here.


  1. Assign users to the roles in Organization file.


  1. Deploy the application and test


  1. Login as the employee and request the travel expense approval, with auto approval condition



  1. The travel request is auto approved.



  1. Request another travel expense with any of the approval required conditions



  1. The request will go for managers approval



Thursday, July 4, 2013

Importing BPM Projects to Composer using MDS Connection from JDeveloper

(JDeveloper 11.1.1.7, WLS 10.3.6, SOA/BPM 11.1.1.7)


The following is a simple procedure to import the BPM Projects from JDeveloper to SOA MDS Repository and open the Processes in Oracle BPM Composer.


  1. Open the BPM Application in JDeveloper





  1. Open the BPM MDS Navigator and Configure an MDS connection





  1. Create a BPM MDS Connection, SOA MDS Connection, and Database Connection to DEV_MDS database as follows. The DEV_MDS database connection is the one you have created while installing the RCU in the SOA installation process.

  1. Look at the WLS Console Data Source for DEV_MDS for details





  1. Make sure all the connections are tested successfully.





  1. Open the BPM Project Navigator in JDeveloper and Save to BPM MDS





  1. Click Ok for the following dialog





  1. After the project is saved, login to the BPM Composer as weblogic administrator login and you can see the project imported already





  1. Click on the project and it will take you to the project home.
  2. Also, if we create a project/process in the BPM Composer, it will be visible in the MDS Navigator in the JDeveloper.