Posts

Calendar- Date Time in PCS - Header

Dealing with Dates and Times in Oracle Process Cloud Service

Introduction

Oracle Process Cloud Service (PCS) is great! You can build process-based applications in two shakes of a lamb’s tail, much quicker than most Low Code platforms in the market. Of course, you can’t, or at least shouldn’t, develop any “normal” master-detail CRUD application with Oracle Process Cloud Service. If you need this kind of applications perhaps Oracle Application Builder Cloud Service will suit you better, but for process-centric applications, it’s a hard to beat tool.

As you may know, Oracle also has an on-premise product, called Oracle BPM, which features a similar codebase, but it features a more advanced and complex UI and it takes a bit more time to produce a similar application.

Oracle PCS really shines for its simplicity and ease of use, because the UI was streamlined and is much more focused. However, all this optimization and streamlining led to decisions to simplify the UI and some features present in Oracle BPM are not present in Oracle PCS. Most of them we won’t really need except for 1% of all our application needs, but a few are a more common necessity. The capacity to use functions to manage and operate dates and times fit this last set.

Oracle BPM allows you to manipulate dates using several options, with Data Associations and Script tasks perhaps being the most common. In Oracle PCS, the Data Associations don’t allow you manipulate dates nor retrieve the current Date / Time, and script tasks plain and simply are not available.

It’s possible to create services that do whatever we need to do with dates and then call them in Oracle PCS, but sometimes we want a more direct approach.

The Use Case

Let’s consider the following case:

We have a simple approval process with 3 steps. Every time there’s a response to a task, we want to record which response was and at which date and time it was made. We also want to show this information to the user, in the task web form, and we want that the whole process takes a calculated amount of time as the most, with it automatically finishing up after that amount.

Something a bit like this:

The Use Case process

The Use Case process

And the web form:

The Use Case web form

The Use Case web form

 

Notice that Oracle PCS automatically creates a data object in the process, of the same type as the start form.

Automatically created data object corresponding to our web form

Automatically created data object corresponding to our web form

Also, all task data associations are done automatically, without the need to do this manually, when you set the task form.

Choose the web form for the task to use

Choose the web form for the task to use

Automatic Data Associations - Cool Stuff!

Automatic Data Associations – Cool Stuff!

Remember that we want to fill each of the decision fields with both the Outcome of the last response and the date and time of that response.

If we try to so it through the web form functions, you’ll notice that you can only set a field to the current date/time. This would change the value of the field “When?” every time the user was shown the form. This is not what we want.

Trying to automatically fill this field

Trying to automatically fill this field

... and you can. But that's not what you want.

… and you can. But that’s not what you want.

Also, you can’t do calculations between fields which are of type date/time. Let’s say you also want a new field which tells you the number of days between the date of the first decision and the last one. How can you calculate this in the form?

Common sense would lead us to try to subtract the value of the field that holds the date/time of the first decision, from the value of the field that holds the date/time of the last decision. Unfortunately, this doesn’t work, as you can see below (31 May – 18 May = 0)

Our form doesn't calculate the Nr of days correctly

Our form doesn’t calculate the Nr of days correctly

The Nr of days calculation function

The Nr of days calculation function

We can also try the data association route, but, as we can see from the image below, there are no functions to deal with dates in this part.

Data Associations Expression Builder - Data Objects

Data Associations Expression Builder – Data Objects

Data Associations Expression Builder - Operators

Data Associations Expression Builder – Operators

Finally, as there are no Script Tasks, as you have in Oracle BPM, you can’t actually program this in your process.

So, how can we do this?

We cheat!

Let’s try to use a Business Rule for this. By placing a Business Rule after each task, we guarantee an immediate execution right after the decision is taken and we record the rule execution date/time as the decision date.

Business Rules Calendar objects

Business rules get an input, do some magic, and produce an output… pretty much as any other task in our process. What makes them special is the amount of magic one can do inside them.

When we create a decision, we can use a lot of Java functions, including a few related to treating dates and times.

So we create a Business Rule, setup the input and output as objects of the type of the web form (this makes it easier to do the data associations) and, once we enter the decision screen we just create a new General Rule.

Creating your General Rule

Creating your General Rule

Then we create a true condition in the “If” part of the rule, as we want it to always execute, and in the “Then” part, we specify that we want to modify the object that we specify in the Drop Down List (in the example below the object is called “Other”).

Our Rule Configuration

Our Rule Configuration

We click on the pencil icon and choose the field in which we want to do the date processing (click on the magnifying glass). We are taken into the Condition Browser, where we can access the Expression Builder

Condition Browser

Condition Browser

Business Rules Expression Builder

Business Rules Expression Builder

As you can see, this expression builder is much more advanced than the one available in the Data Associations dialog, with a few more tabs, including the Functions.

In here we can do calculations with our dates, set them as we want.

So we’ll grab the CurrentDate.date.time calendar and apply the JavaDate.to datetime string to it, like so:

Our Date expression

Our Date expression

And that’s it. This will calculate the current date and time, put it in the output object, which is our web form.

Now we only need to repeat for all tasks. A bit like this:

Our Use Case process with Business Rules

Our Use Case process with Business Rules

I hope that this article can help you do more complex calculations and extend the normal use of Oracle PCS, to cope with more business scenarios.

If you have any questions please place them in the comments box below.

José Rodrigues

P.S: All of this could also be done with the help of ICS, JCS or ACCS. I’ll write about it in a couple of weeks.

Post header image by Sebastien Wiertz

Travel Request in PCS - Wrapping it up!

Video – How to build a Process Cloud Service Application (Business Travel Requests) in 40 minutes – Final Part – Wrapping it Up!

Hi,

Welcome to Red Maverick’s sixth video, the third of the Business Travel Request Management Series.

In this series we’ll guide you on how to build a complete, working BPM application using  Oracle’s Process Cloud Service.

For this part, the focus is on doing the final configurations and connecting all the dots, making the application fully functional.

This scenario and video was first prepared by me for Link Consulting‘s Process Cloud event, that was held in July 2015.

Enjoy!

Cheers

José Rodrigues, a.k.a Maverick

Post image by alobos Life

TravelRequest Business Rules

Video – How to build a Process Cloud Service Application (Business Travel Requests) in 40 minutes – Part III – Business Rules Setup

Hi,

Welcome to Red Maverick’s fifth video, the third of the Business Travel Request Management Series.

In this series we’ll guide you on how to build a complete, working BPM application using  Oracle’s Process Cloud Service.

For this part, the focus is on setting Business Rules using Oracle’s PCS, to fine tune the process flow path, depending on process data.

This scenario and video was first prepared by me for Link Consulting‘s Process Cloud event, that was held in July 2015.

Enjoy!

Cheers

José Rodrigues, a.k.a Maverick

Post image by N i c o l a

Manage your Travel Requests

Video – How to build a Process Cloud Service Application (Business Travel Requests) in 40 minutes – Part II – Process Form

Hi,

Welcome to Red Maverick’s fourth video, the second of the Business Travel Request Management Series.

In this series we’ll guide you on how to build a complete, working BPM application using  Oracle’s Process Cloud Service.

This second part is about designing the form that is the data foundation for your process.

In the next parts, you’ll see how to build advanced rules, conduct escalations and going up management chains.

This scenario and video was first prepared by me for Link Consulting‘s Process Cloud event, that was held in July 2015.

Enjoy!

Cheers

José Rodrigues, a.k.a Maverick

Post image by Mac Qin

Travel Request Application Demo

Video – How to build a Process Cloud Service Application (Business Travel Expense) in 40 minutes – Part I – Designing your process

Hi,

Welcome to Red Maverick’s third video.

In this one, we’ll guide you on how to build a complete, working BPM application using  Oracle’s Process Cloud Service.

The first part is about designing your process from a functional/business point of view

In the next parts, you’ll see how to setup a process start form, build advanced rules, conduct escalations and going up management chains.

This scenario and video was first prepared by me for Link Consulting‘s Process Cloud event, that was held in July 2015.

Enjoy!

Cheers

José Rodrigues, a.k.a Maverick

Post image by Paul Nelhams

Data Objects and Form Header

Process Data Definition – Part II… and Web form introduction

Hi there,

So here’s our new article, completing the data definition series. We’ll build the remaining Business and Data Objects as well as build our first web form based on those objects.

Using your data inside the Request a Parking Space process

Last time, we saw how we defined the data that will be governed by our Business Process.

Now it’s time to make use of it during the process execution. It’s this data that will be input, manipulated and condition the actual process flow for every process instance.

If you remember from the last article, you had some homework 🙂

You had to build the Parking Space Business Object. Check what you did against our proposal. It should feature the same attributes, give or take a few…

Parking Space

  • Space Nr.
  • Reservation Start Date&Time
  • Reservation End Date&Time
  • Reserved for
  • AllSpacesOccupied?
  • Meeting with
  • Employee Nr

Important Note: Remember that processes govern data, they don’t keep it. Data is kept in the database. That’s how you have to think.

Again, the purpose of this series is to help business analysts and process owners model and automate processes without writing any code, so we’ll assume that the IT department did their work and expose some services that check if there’s a parking space available for the time slot that the requester wishes to reserve and, if so, returns the information defined in the Parking Space Business Object, and if not, returns an response that indicates all parking spaces are occupied.

Remaining Data Objects

Let’s create our remaining data objects: one for the parking space and one of our special data objects that help us govern the process flow, an instance of the ProcessStatusBO.

Inside the process BPMN diagram, click on the Data Objects option

Access the Data Object definition window

Access the Data Object definition window

and create a new process data object called v_parkingSpace, of the type object -> parkingSpaceBO, and another one called v_processStatus of the type object->ProcessStatusBO.

Add a new process Data Object

Add a new process Data Object

Adding the 2 new Data Objects

Adding the 2 new Data Objects

I use the prefix “v_” to indicate that it’s a variable, something that holds data, of my process.

From this moment on, your process has all the data placeholders that it needs.

All 3 Data Objects created

All 3 Data Objects created

Now there’s one more step…

Collecting the information

We’ll need to collect the data first, to get the process rolling. There are, in fact, several ways to start processes, but the vast majority will necessarily collect information at the start, either from a user (through a form, …) or from other systems, and places it in the process data objects. In our case, we’ll build a form to collect that information from the requester.

Designing web forms is a breeze since Oracle BPM 11.1.1.7. The frevvo platform was introduced to help business users design the interaction forms themselves, reducing the need for IT to build applications for that specific purpose that typically take a lot of time to be ready, increasing the overall agility and decreasing the time-to-market of a process.

So, to build our own forms, we’ll go into the web forms option in Oracle’s BPM Process Composer, click over the “+” sign and give it a name, for instance RequestInfoFRM.

Creating your first form

Creating your first form

We’re adopting what we call the “Form first method”, so we’ll design the form first, and let Oracle BPM generate the data structures for itself. Then, we’ll just need to connect these self-generated structures to our own data objects.

There’s also the “Data First method”, that allows you to specify the specific data objects for forms and allows widget auto generation, effectively generating the web form in a single click. You only have to adjust the looks, if you don’t like the way the widgets are placed.

For our form, we’ll collect the information that we defined in our RequestBO.

 As you can see, the web form designer has a drag-and-drop interface, which allows even complex forms to be designed in a very short timeframe.

And so, we completed our data object definition and built our first web form for it. On the next post, we’ll look into more detail about web form creation, namely focusing on both form creation methods and looking into the various form widgets. Until then…

Cheers,

Maverick

Post Header image by Garry Ing