Wednesday, May 27, 2015

Oracle BPM 12c Advanced Error Handling and Recovery - Part 2

The second part of my two series article on "Oracle BPM 12c Advanced Error Handling and Recovery - Part 2" has been published by OTN.

The second part explores the important error recovery changes and improvements that Oracle made from an operations and management perspective in Oracle BPM 12c.

Please do read it and give me your feedback.

Thursday, April 16, 2015

Creating the platform of the future with Oracle Fusion Middleware 12c

I'm thrilled to announce that my article, co-authored with Ronald van Luttikhuizen,  on "Creating the platform of the future with Oracle Fusion Middleware 12c" has been published by Oracle Scene.

This article shows how Oracle Fusion Middleware 12c offers one complete, modern, open and integrated stack that allows you to create a future-proof platform. Oracle Fusion Middleware provides mobile and web access from any device based on user and customer experience best practices. It enables applications to be responsive and to create valuable insights by incorporating big and fast data capabilities; and gives you control over both structured as well as unstructured knowledge-driven processes. It also has best-in-class integration capabilities, both between the products in the Fusion Middleware stack, as well as with other applications and data either running in the Cloud or on-premise.

Wednesday, April 15, 2015

Oracle BPM 12c Events (Part 2 of 3): End Events

End events define how a process should finish and just like with start events, processes can have more than one end event.

As you can see from the sample process below, we are provided with a plethora of end events that include a “None End” event,  a “Message Send” event, a “Signal” event and a “Terminate End” and “Error End” event.

The “None End” event is the default end event in a manual and reusable process and as it’s name implies, it is used when your process doesn’t need to perform any action upon completion. When all process instance tokens reach the “None End” event, the instance is completed.

The "Message End" event, as the name implies, will send a message before an instance completion and is especially useful when you want to trigger another process or instance. The "Message End" event has one unique particularity, it can only be used with either a message start event or a message catch event.

The "Signal Event" will publish a signal before completion.

The "Terminate End" is used to terminate, immediately, without any error handling, a process.

The "Error End" will throw an error before completion. This type of end event is used most commonly in subprocesses to trigger an exception to a main process.

Let's see how you can use these end events in practice.

Create the basic BPM application and BPM project (named both application and project "EndEventsDemo") and select "Composite with BPMN Process" in step 3.

 In the "BPMN 2.0 Process Wizard" specify a process name, for example DemoProcess and select "Asynchronous Service" as the service type and click "Next".

In the "Arguments" screen create an input argument to define the end event type as a user input to the process and click "Finish".

On the process canvas add a "None End", a "Signal End", a "Terminate End" and an "Error End" event. You should have a total of 5 end events for your demo process.

The new end events that you have added to your process are showing an error. This is because they don't have any incoming sequence flows. Therefore, place an exclusive gateway on the default sequence flow between the "Message Start" and "Message End" events and add conditional sequence flows from the exclusive gateway to a each of your other end event types.

Make sure that you define a condition expression for each of the non-default outgoing sequence flows. In my case, I've set the condition expression to the "Message End" type to bpmn:getDataObject('endType') = "message"

You should also notice a warning on the "Signal End" and "Error End" events. This is because these two end events don't have an implementation defined. So let's quickly implement these two end events.

For the purpose of this, I will create a new XML schema with a single element called "fraud" with a child string element called "transactionId".

Under the "Business Components" I have created a new "Business Exception" called "InvalidSSN" of error type string.

and created a new "Event Definition" called "FraudCheckEventDefinition" with an event called "FraudCheckEvent" of type "fraud " (the element type that I've created in my "FraudCheck" XML schema.

Go to your process and select the "InvalidSSN" exception type for the "Error End" event and the "FraudCheckEvent" for the "Signal End" event. 

Deploy your process and instantiate a new instance of your process using the Enterprise Manager. In the endType input parameter enter one of the values that you have defined in your complex gateway outgoing sequence flow (for example, "message").

Go to the flow instances and inspect your instance; you should notice that your process ended using the "Message End" event.

Initiate a new instance but this time use "signal" as the endType input parameter (assuming that your outgoing sequence exclusive gateway condition to the "Signal End" event is "signal"). Your process should have ended using the "Signal End" event.

Download sample application: End Events

Friday, March 27, 2015

Custom SOA Administrator

The default SOA administrator in a SOA/BPM installation is "weblogic". The SOA administrator, amongst other tasks, is the BPM Workspace administrator, the out-of-the-box web-based interface where users can access and manage their tasks. This is just fine for development and testing purposes.

However, at some point during your process lifecycle you will be faced with the task of creating and assigning a custom SOA administrator other than "weblogic" to serve your processes' administrative tasks, for example, mapping application roles to users and/or enterprise groups.

The first thing that you need to do is of course create your new SOA admin user using the Weblogic Administrator Console.

Next you need to point out to the SOA Infrastructure that James Cooper, as in the example above, will be the new SOA Administrator.

There are a couple of ways to do so.

The first and most easiest way is by assigning the "Administrators" group to your new user as in the image below.

The easiest way though is not always the right way. Doing so you are automatically granting access administrative access to applications like the Weblogic Console where you new SOA admin user can fiddle with your Weblogic settings.

A much better approach would be to map your new user to the SOAAmin application role using the Enterprise Manager. To do so, right click the soa-infra node and from the context menu select "Security > Application Roles"

On the "Application Roles" page enter SOAAdmin in the search box field and click on the search button. You should see the SOAAdmin application role displayed in the search results page and selected.

With the SOAAdmin application role selected click the edit button and in the "Edit Application Role" page click the "Add" button. This will open the "Add Principal" window where you can search for an application role, user or a group. Search for your user and click OK.

On the "Edit Application Role" click OK to apply the change. You will be redirected to the "Application Roles" page with the SOAAdmin user selected and under the membership for SOAAdmin you should see your new user.

The ultimate approach, and what I highly recommend, is to create a custom group on Weblogic Console, for example "MyAdminGroup", assign this new group to your user and add this new group as a member of the SOAAdmin application role.

Thursday, March 12, 2015

2 Minute Tech Tip on Error Handling & Recovery in Oracle BPM 12c

Check out my 2 minute tech tip video on Error Handling & Recovery in Oracle BPM 12c (2MTT: Error Handling and Recovery in Oracle BPM12c).

I'm covering two new developer-centric and declarative features in Oracle BPM 12c, the "Force Commit on Activity Complete" and the "Skip and Back Error Recovery".

My tip is based on his OTN technical article, "Oracle BPM 12c Advanced Error Handling and Recovery - Part 1".

Tuesday, February 24, 2015

Oracle BPM 12c Advanced Error Handling and Recovery - Part 1

I'm so happy to announce that my first part of a two series article on "Oracle BPM 12c Advanced Error Handling and Recovery - Part 1" has been published under OTN.

This first part covers the differences in fault handling options between Oracle BPM 11g and 12c and explores the new error handling and recovery features introduced in Oracle BPM 12c from both a developer's angle (covered in part 1) and an administrator's perspective (covered in part 2).

Friday, February 20, 2015

Using ADF BC Declarative Built-in Rules (Part 9 of 10): Script Expression validator

The last set of validators consist of the "Script Expression" validator and the "Method" validator which can be defined either at the entity level or the attribute level to validate either the entire entity object or a specific entity attribute.

The "Script Expression" validator enables you to validate either the entire entity object or a specific entity attribute using a Groovy expression that returns either true, meaning that the validation is successful or false to define that the validation has failed.

The "Script Expression" validator has some very interesting characteristics which we will see in practice using an example by Frank Nimphius (

I will be using the HR schema and the employees table to define an attribute level validation using a "Script Expression" to define a departmental salary budget and to ensure that the cumulative salary of employees per department does not exceed their respective departmental salary budget.

I have created an ADF Fusion Web Application and created the basic business components that I will be using in this demo; two entity objects based on the Employees and Departments HR tables, default view objects based on the two entity objects and a default application module.
Next let’s define the validation on the "Salary" attribute of the Employees entity object to ensure that the cumulative salary of employees per department does not exceed their respective departmental salary budget. So on the  “Business Rules” tab of the Employees entity object, right-click on the "Salary" attribute and select "New Validator". This will open the “Add Validation Rule” editor for defining the validation specifics.

In the “Type” combo select “Script Expression” and in the "Expression" I will type in my Groovy expression to implement my business rule. The logic for implementing my departmental salary budget rule is as follows:

DepartmentSalaryBudget – (AllSalariesInDepartment + newEmployeeSalary) + currentEmployeeSalary < 0

To retrieve the current employee salary and the new employee salary we can use the oldValue and newValue Groovy script keywords respectively.

Another nice feature with the "Script Expression" validator is that you can use the ternary operator to implement functionality that is similar to SQL’s NVL() function. We will use this functionality to populate a department's salary budget, for example, "departmentSalaryBudget = (DepartmentId == 10 ? 50000 : 100000)". A better approach would be to create a new database column in the "Departments" table to hold the salary budget for each department.
The last part of the puzzle is to calculate all the salaries in a specific department. To do so we will have to use the default accessors that have been created by the default "EmpDeptFkAssoc" association.

So to calculate the total salary of all employees in a department we have to use the "Departments1" accessor to navigate to from a specific employee to his department and from the department use the "Employees1" accessor to retrieve all department employees and use the "sum" aggregate function on the "Salary" attribute, for example, "Departments1.Employees1.sum('Salary')".

One last point on the "Script Expression" validator is that your expression can either return true or false or use the "adf.error.raise" or "adf.error.warn" functions to display a message that is defined in your message bundle.

Putting it all together, the department salary budget business rule validation should look like the following:

I've decided not to use the build-in Groovy functions for displaying the error message but to use the "tradition" failure handling tab functionality. Therefore, in the "Failure Handling" tab define a failure message and click "OK". In my example I have used a message token expression to construct a dynamic error message, passing to the failure message the salary increase by using again the oldValue and newValue keywords to compute the salary increase.

If you inspect the Employee’s entity source code you will see that JDeveloper added an ExpressionValidatorBean tag to the entity's XML definition file.

Run the Application module to test the "Script Expression" validator and open the "EmployeesView1" view object. By default the first record displayed is "Steven King" that belongs to the "Executive" department (department id 90). Based on our business rule definition, the Executive department has a salary budget of $100,000.

The current Executive department salary total is $58,000 (do a "select sum(salary) from employees where department_id = 90"). If you increase Steven King's salary from $24,000 to $66,000 you should notice that there isn't any error raised (the department's total salary is exactly $100,000).

Do a rollback so that Steven King's salary get's back to $24,000 and try to update his salary to $66,001 (which should total the department's salary to $100,001). The validation should fail and you should see your custom error message.

Download sample application: Script Expression