Browse Category by JavaScript

PCS: Form rules in human tasks

In Oracle BPM it is possible to use Oracle ADF to implement Human Tasks, but in Oracle Process Cloud Service you can only create a form using web forms. Creating a form is an easy task and it offers us to define rules that it gives us a lot of flexibility to achieve complex requirements.

Having this simple form. We can navigate to rules clicking on the marked button.

For each of the elements we have a number of properties or events that we can manage,
For example we can manage form load event, or get if a field value is valid…

To build the rules we have to use JavaScript and we can get code snippets if we click on the button next to each of the properties.

Let’s build a couple of rules so you can see how easy it is.
Having this combo with this value.

We can build a rules that populates that combo and also add some kind of value change listener so if its value is “Spain” we can set the country code in Telephone field.

If we have any syntax errors, will be displayed in the bottom of the editor.

Once the error is fixed we can test the form clicking on the marked button.
We can see that the combo is now populated and if we select Spain, the country code is set.

Oracle JavaScript Extension Toolkit (Oracle JET)

Last Friday was a day with lots of Oracle products releases (Check Oracle ADF 12.2.1 release notes) and Oracle also released one of the most expected products Oracle JavaScript Extension Toolkit, also known as Oracle JET, the new JavaScript Framework.

Oracle JET is targeted at intermediate to advanced JavaScript developers working on client-side applications. It’s a collection of open source JavaScript libraries along with a set of Oracle contributed JavaScript libraries that make it as simple and efficient as possible to build applications that consume and interact with Oracle products and services, especially Oracle Cloud services.

Oracle JET is a framework to develop applications based on some Open Source libraries:

  • JQuery

JQuery is a JavaScript library that help us to simplify the way to interact with HTML files, manipulate DOM tree and handle events.

  • JQuery UI

JQuery UI is a components library build on top of JQuery that offer us different widgets and allow us to interact easily with them (resize, drag and drop, etc). We can also add those components transitions and effects.

  • Knockout

Knockout is a library that allow us to create responsive interfaces with a clean underlying data model having a Model-View-ViewModel (MVVM) architecture design pattern.

  • RequireJS

RequireJS is more than a library to resolve dependencies  It also provides an asynchronous file and module loader.

  • Hammer
Hammer is an open-source library that can recognize gestures made by touch, mouse and pointer events.

Oracle JET supports MVVM arquitecture pattern (Model-View-ViewModel). In this architecture the Model represents the application data, the View is the presentation of the data and the ViewModel exposes the data from the model to the View.

 

Oracle JET Common Model and Collection API implements Model layer. This API has the following JavaScripts objtects:

  • oj.Model: Represents one single record from a data service such as a RESTful service.
  • oj.Collection: It is a list of oj.Model objects.
  • oj.Events: Provides methods to handle events.
  • oj.KnockoutUtils: Provides methods for mapping the attributes from oj.Model and oj.Collection object to Knockout observable objects for use with components view models
Oracle JET provides a collection of components wrapped as JQuery UI Widgets to implement View layer. These components range from a basic button or input to advanced visualization components like charts.  

The last layer, ViewModel is implemented by Knockout.js, and offers us two-way data binding between View and Model layers.

Oracle JET also has a lot of more features like these:

  • A validation framework that offers components level validation and data conversion
  • A cache at the Model layer for performance optimization of the pagination.
  • Connection to data sources through web services such as REST services or WebSockets.
  • Integrated authorization through OAuth 2.0 for data models retrieved from REST services.

Oracle has also provided us some resources so we can start building an application and learning Oracle JET.

  • Oracle JET application demo

  • Cookbook

In the cookbook we can see all Oracle JET components and also the HTML and JavaScript code needed to make it work,

 
You can also edit HTML and JavaScript code in the cookbook and see the changes at the moment.

If you are interested in the framework and want to learn more you should visit these links:

Oracle JET Website
Oracle JET Developers Guide
Oracle JET Youtube channel