Wednesday, July 16, 2014

Oracle BPM 12c - Process Asset Manager (PAM)

An entirely new feature has been introduced in Oracle BPM 12c called “Process Asset Manager” (PAM) which makes it really simple and reliable to share projects between BPM Studio and BPM Process Composer, providing a unified lifecycle management of BPM projects across BPM Process Composer and BPM Studio tools and offering seamless collaboration across the various personas in a BPM project.

PAM comes with an integrated subversion source control system for version management of BPM assets and can be integrated with OPSS for security and can reference the MDS for run-time artifacts.

So let’s see the lifecycle of PAM from the two different interfaces, starting with the Process Composer.

For the needs of this tutorial I have created a sample Hello BPM project with a synchronous process.

BPM 12c provides us with a a collaborative workspace built on top of Oracle WebCenter Portal that enables more productive BPM by increasing collaboration between the various personas.

The new workspace has been enhanced with the introduction of roles and priviledges assigned at the space level. The 12c version supports three personas, the Owner which maps to the Process Architect, the Viewer which maps to the Process Business Analyst and the Editor which maps to the Process Business Developer.

Furthermore, for each space, you can create multiple projects (BA and BPM projects) which helps in organizing all the processes in business relevant projects.

Start the integrated JDeveloper Weblogic Server instance and if this is the first time you are starting the integrated Weblogic Server you will be asked to provide the admin credentials and listening address for your integrated Weblogic Server.

To share and make a BPM project available in Composer, right click your BPM project and from the context menu select “Save to PAM”.  This will bring up the “Select Connection” window. If this is the first time you are publishing to PAM you will have to create a new PAM connection by clicking on the green “Add” icon (and going through the wizard).
Once you have created (or selected an existing) PAM connection, create a new space to host your BPM project.

Click “OK” and in the “Save Project to PAM” window you can optionally define some comments and click “OK” to publish to PAM.

Go to BPM Process Composer (http://<hostname:<port>/bpm/componser) and login as weblogic to see your published BPM project.

The Composer has been enhanced with some really nice new features, especially around the area of Business Architecture that I will elaborate further in a subsequent post.

When you edit a BPM project in BPM Composer, PAM will lock the BPM project, meaning that other Composer users will not be able to work it but just view the project.

When you do a save in BPM Composer (“Save” button) the changes are saved locally which makes it really fast to work with the Composer.

To publish you changes to PAM and the SCC (Source Code Control) you need to click on the “Publish” button (second button in the screenshot above).

When you click on the “Publish” button you will be prompted with the “Publish Project” window where you have to provide a comment to explain what your changes are about and optionally release the lock and make a snapshot which is nothing more than an SVN tag on your BPM project.

The PAM lifecycle from BPM Studio is a bit different. To work on a project from BPM Studio that has been published to PAM you need to first create an application and then checkout your BPM project into your application.

To do so, open the “Process Asset Manager Navigator”, expand your connection name (in my case it is l”ocal-PAM”), space name (in my case it is “Hello World Space”) and right click on the project name (in my case it is “HelloWorldBPM”) and from the context menu select “Check Out”.

This will open the “Check Out project from PAM” window where you can change the destination for your checked-out project.

Click “OK” to check out the BPM project.

Oracle BPM 12c supports concurrent editing of BPM projects inside BPM Studio. When you do a save, changes are again saved locally. To publish your changes back to the repository you need to right click your project and from the context menu select “Save to PAM”.

To get the latest changes from PAM you can do an “Update” using the project’s context menu.

In case of conflicts there is a visual “Diff-Merge” editor to resolve the conflicts.

Wednesday, July 2, 2014

Using ADF BC Declarative Built-in Rules (Part 4 of 10): Key Exists Validator

The “Key Exists” Validator is validator that can be defined at either the entity level or the attribute level but pertains to an entity object attribute to check whether a key exists based on a primary key, foreign key or an alternate key. The “Key Exists” validator will check first the cache querying rows not committed yet to the database and if the key is not found in the cache will run a check in the database.

So let’s start by creating a new ADF Fusion Web Application and create the basic business components that we will be using in this demo, two entity objects based on the Countries and Regions HR tables, their associated view objects and a default application module.

Next let’s define a “Key Exists” validator on the Countries entity object. So on “Business Rules” tab of the Countries entity object, click on the green plus icon “Create new validator”.  This will open the “Add Validation Rule” editor for defining the validation specifics.

In the “Type” combo select “Key Exists” and you will see that in the “Validation Target Type“ there are three options; to target the validation at the “Entity Object” level meaning that this validation will be used for all view objects that use this entity attribute, “View Object” or “View Accessor”. In my demo I will be targeting my “Key Exists” validator at the entity object.

In the “Association Name“ combo you will get displayed with all the associations pertaining the entity object. In my case I have only one association, the “CountryRegFkAssoc”.

In the "Failure Handling" tab define a failure message and click "OK". In my example I have used two message token expressions to construct a dynamic error message, passing to the failure message the country’s name and country’s region id.

Before testing our validator please ensure that your application module has the Countries view and Regions View selected under the “Data Model”.

To test our newly defined "Key Exists Validator" run the Application module and and try to create a country with an invalid region id. You should get your custom dynamic error message displayed.

Now create a new region, do not commit the new region and try to create a new country based on the new region’s id. The “Key Exists” validator will check the cache and will identify that the region id exists (even though it’s not committed in the database).

 Download sample application: Key Exists Validator