Oracle Technologies Primer

November 8, 2012

Open a Workflow Task or Instance Trail from Oracle BAM 11g

An interesting requirement that I have recently seen a lot of clients demanding in their BAM dashboards is the ability to action or monitor process instances. Oracle BAM 11g typically provide means to create real time dashboard for process metrics to business process stakeholders. However a lot of organizations are beginning to prefer to also use it as a starting point to get more insight into instance details (such as in-flight status, flow trail, fault information, etc.). One of my reputing requirement in the past was so much as to provide a mechanism to open actionable task forms directly from BAM. And then sometime back I had the same question asked again as how to open a process instance trail directly from Oracle BAM 11g to view its fault details. This is a natural demand for process owners typically in the support role who are alerted of fault notifications from BAM and would not like to go through the trouble of going back and forth the BAM dashboard and the Enterprise Manager console to correlate instances together. This eventually led me to believe that, it is in fact a sought after requirement and hence this article will aim to provide a detailed and step by step guide to define and implement this use case.

In a nutshell, this article will demonstrate creation of actionable links in a BAM dashboard to view and instance trail of a composite instance and from there dig into its audit trail or flow trace. Another useful feature demonstrated will be the use of Action Buttons in Oracle BAM 11g dashboard to launch instances of human workflow tasks of a BPMN composites awaiting to be actioned from designated process users. When such an instance is clicked the user is taken to the BPM workspace UI and take an action on the selected task.

This allows business users to seamlessly monitor business applications and processes and be able to correlate them with instances appearing across different UI’s of the Oracle SOA Suite 11g product suite such as BPM Workspace and EM Fusion Middleware Control console. It is essentially useful for organizations that intend to use Oracle BAM as an operational dashboard for process users in addition to it being used as a real time business metrics monitoring and alerting dashboard.

Take a Sneak Peak at the Use Case

The following video will show a sneak peak of the use case intended to be demonstrated in the course of this article.

During the course of implementing the use case, the article will also describe the following activities in detail:

  • An Overview of creating and assigning values to a business indicator and publishing it to Oracle BAM data objects at runtime.

  • Configuration changes involved in sending the process metrics data from a BPM process to BAM data objects such as activating sampling points, enabling data targets, configuring the OracleBAMAdapter and altering BPMN engine MBeans .

  • Create Streaming Action Lists in an Oracle BAM reporting view to track in-flight instances of a composite that are assigned to process owners, waiting to be actioned. and a list of completed instances.

  • Create an action list of completed instances and define an action to launch their audit trail in the Enterprise Manager console. This concept is useful as this can be extended/customized to instead create a list of faulted instances for users to gain detailed insight into the fault details from the Enterprise Manager Fusion Middleware Console.

  • Configure External Data Objects and create lookup fields in BAM.

  • Create and configure action buttons in Oracle BAM to open an external URL and pass the value(s) of a column in an action list for a selected instance to the URL term.

To gather process metrics and activity instance data in BAM to be able to build the reports, an existing BPMN based composite will be used. The composite project can be downloaded from the example demonstrated in an earlier BPM post on event based gateways. The article also describes the use case the project tries to address in details.

http://beatechnologies.wordpress.com/2012/05/12/understanding-event-based-gateways-in-oracle-bpm-suite-11g/

The download link for the application workspace is provided in the aforementioned article. The soapui project to create sample instances and thus populate the BAM reports is provided at the end of this article.

Prerequisite(s)

The modelling workspace and the version of Oracle BPM and BAM Suite used in this demonstration is 11gR1PS5 i.e 11.1.1.6 although the concepts discussed are generic and applicable to all versions.

Creating the Business Indicator(s)

Import the application workbench consisting of the modelled process in JDeveloper. To begin with the article describes adding a business indicator to capture the credit card approval status as the instance progresses through multiple activities.

In the JDeveloper menu click on View > BPM Project Navigator and open the AccountOpeningProcess business process. You will notice a Structure pane visible in the bottom left hand side of the editor. If the structure pane is missing then click on View > Structure to be able to see it. Expand Business Indicators > Dimension and right click on it to be able to add a new dimension of type String. Name the dimension as cardApplicationStatus. For simplicity this article just has a single business indicator, though in real business processes you may end up having multiple KPI collecting indicators.

image

Once an indicator has been defined, it has to be assigned a certain value to depict a business friendly state of the process instance is currently in. Have a look at the red information rectangles for the AccountOpeningProcess as depicted in the screenshot below. They may well represent the various business friendly stages of the application status. For example, when a New Application request is received  by the process the business indicator may be set to “PPLICATION IN PROGRESS indicating that it is being currently processed upon. If the customer for any reasons wants to terminate his application midway while his initial request is in-flight, the application status may be transitioned to “REQUESTED CANCELLATION”. Similarly there may be other intermediate statuses that can be captured in a long running business processes and be presented to business stakeholders or process owners.

image

Populating a business indicator with a pre-determined value is straightforward. It is in a similar way as a value is assigned to any other process variable. Double click on the New Application start message event and then on the Data Associations link. Simply drag the Expression icon on the cardApplicationStatus metric variable under OnlineAccountOpenin>DataObjects on the right hand side of the Data Association wizard and assign it a static value of “APPLICATION IN PROGRESS”.

image

Similarly, double click the Cancel Application intermediate event and then assign REQUEST FOR CANCELLATION to the same business indicator from the Data Associations link. When the business processes receives an intermediate request for cancellation while the task is still in progress, the cancel application intermediate event is invoked and the latest status of the process instance (determined by the cardApplicationStatus business indicator) is replaced. Use the same technique to assign other possible approval states to the business indicator for other activities.

image

Configuring Sampling Points and Data Targets

Now that the business indicators are assigned appropriate values describing meaningful process states, the next thing is to publish these indicators to BAM. Readers familiar with Oracle SOA Suite will know that sensors can be defined for the BPEL engine to automatically publish their data to BAM data objects in real time as soon as their values in the business process changes. Unfortunately as of now, sensors cannot be defined in Oracle BPM Suite. Instead there is a concept of Sampling points.  The BPMN Service Engine uses the defined sampling point configuration to decide when and where to publish process analytics information. Process analytics sampling points can be created for all activities, just interactive activities or disabled altogether. The process metrics can be published internally to the in-built cube star tables in the SOAINFRA schema or externally to BAM data objects. The process sampling points can be configured by right clicking on the BPM process from the BPM Project Navigator view and then clicking Project Preferences . This article needs sampling points to be generated for all activities in the business process, hence Generate for All activities from the Project Sampling Points radio options is selected. Sampling points capture a host of other information in addition to capturing the values of defined business indicators such as performance and workload metrics. Also note that choosing Generate for All Activities will generate a lot of data to be published to BAM. More information about Process Analytics and Sampling points can be read at the official Oracle documentation site at

http://docs.oracle.com/cd/E28271_01/doc.1111/e15176/monitoring_proc_act_bpmpd.htm

By default the sampling point only publishes process metrics to the internal CUBE_* tables in the SOAINFRA schema. To publish these analytics data externally to BAM click on the Data Targets tab and check Enable BAM option. Also change the default Data Object Path to something like /Customer/AccountInitiation. This ensures that all data objects pertaining to a project are created in the folder hierarchy entered in the data object path field.  This external publishing of the BPMN engine data to BAM data objects in the active data cache is taken care by the OracleBAMAdapter. This adapter has two predefined connection factories. It allows either publishing the data to the BAM engine either through a RMI interface or through a web service interface.  The BAM Adapter JNDI name for these interfaces is either eis/bam/rmi or eis/bam/soap respectively. The eis/bam/rmi provides a better performance as this doesn’t employ the BAM web service interface and used preferably if the BAM and BPMN engine reside in the same JVM.

image

Configuring the OracleBAMAdapter

The integration glue that binds and permeates instance metrics information to pass from the BPMN engine to the BAM active data cache is the OracleBAMAdapter. The  BAM adapter needs to have the same JNDI (one that was selected in the previous step) configured that is pointing to the correct instance of the BAM active data server. Oracle Weblogic Server administration server console provides the mechanism to view and edit BAM adapter configuration properties. Login to the administration and navigate to Summary of deployments > OracleBamAdapter > Configuration > Outbound Connection Pools and click on the eis/bam/rmi connection pool to view its default configuration properties. These properties may have to be changed to point to the correct instance of the BAM active data cache server. It is also important to note that any change in these adapter properties are applicable only when they are saved and the adapter configuration is updated. This typically happens when the adapter is either redeployed with the changes in the plan file or updated with  the saved changes.  Proper configuration of all of the above settings is important for the BPMN engine to be able to plug with the BAM server.

image

On an Oracle BPM Suite 11g PS3 and above, with only these changes in place, simply deploying the BPM project will create the necessary data objects in the BAM active data cache. Open the Oracle BAM console and click on the BAM Architect view to be able to see the list of data objects existing in the BAM active data cache server. Notice the AccountInitiation subfolder created under DataObjects > Customer folder. Under this hierarchy will be the data objects containing the instance metrics data published from the BPMN engine. Later parts of this article will show how these data objects will be used to create interactive reporting view in BAM.

image

BPMN Engine MBean configuration Alteration to Allow the engine to post data to BAM

As discussed earlier, the above set of configuration changes are sufficient to create the data objects when the business process composite is deployed to the application server. Now when an instance is created and executed it is expected that these data objects will have process metrics value populated at near real time. However the contents of the data objects are not be populated unless a certain disable action to supress process measurements to be sent to the BAM engine is turned off. Login to Oracle Enterprise Manager Fusion Middleware console and navigate to soa-infra > SOA Administration > BPMN Properties > More BPMN Configuration Properties to view the configurable BPMN engine MBean properties. Scroll down the list to see the DisableActions property. The default value for this property is BAMCommand, which supresses measurement actions to be sent to BAM. Clear this field (leaving it blank) and save the settings. If another instance of the BPMN process is now executed, the BAM data objects will being to be populated with measurements obtained for the  various process activities.

image

Creating the Reporting Dashboard in BAM

With the data objects being able to receive measurement data from the business processes, the next thing to do would be to create the BAM reporting dashboard. The dashboard to be developed in this article will have two horizontal regions each displaying a streaming action list of its own. The idea is to have one of the horizontal view displaying recently completed instances and have a hyperlink defined to launch its detailed audit trail in a pop-up while displaying the list of in-flight instances in another. The view showing the in-flight instances will also provide an action button to launch the approval task form for the the selected instance.  As a desirable feature a similar  streaming list of displaying the faulted instances can also be created that leads process users enlisted as support stakeholders to the flow trail to know the exact point and reason of failure.

Login to the Oracle BAM 11g console and from the landing page click on Active Studio (this is where reports and alerts are create in BAM). Click on the Create a New Report link to open the tiled report template selection screen. Select the template titled Two equal horizontal tiles with thin separator. From the list of various report types in each of the horizontal tiles select Action List and  title the report as Credit Card Approval Scoreboard. Each of the report views will prompt for a data object to be selected from which the view will sources its data content.

The upper horizontal tile is used to display a list of completed instances. For this view select BI_default_OnlineAccountOpening_AccountOpeningProcess as the data object and then click on the Fields tab. This lists all the fields in the data object. From a reporting standpoint, it may not necessarily make sense to display all the fields in the data objects but only a few important ones.  For the report in this article, the selected fields are COMPOSITE_INSTANCE_ID,  BI_NAME, COMPONENT_START_TIME, COMPONENT_END_TIME, COMPONENT_INSTNANCE_STATUS, COMPOSITE_NAME, COMPOSITE_REVISION, DOMAIN_NAME and METRIC_cardApplicationStatus. These fields however will appear in the report in their alphabetical order. To change this check the select-boxes corresponding to these fields and use the Arrange icon to rearrange them to be displayed in a custom order. Optionally the report can also be pre-sorted based on values a particular field by moving the field under the Sorted Fields panel in the Sort tab.

image

Another important thing worth mentioning here that if the view configuration is left just as it, a whole lot of duplicate instances will appear in the list. They are not necessarily duplicate as the process measurement data is published for every activity. Therefore the same composite instance will have as many rows in the data object as the number of activities in the original business process. There will however be only one row with the latest snapshot of the process. In order to show only the unique and non duplicated list of composite instances in the streaming list the Filter tab can be used to and add a filter expression to discard the non-latest snapshot of an instance. Add a new filter entry and for the filter expression select the field as LATEST from the data object fields, the comparison type as is equal to and equate it to a value of Y. For the report in this article, yet another filter is added to display only the approved instances by adding a filter expression to equate the METRIC_cardApplicationStatus field to a value of APPROVED. The list can be narrowed further by adding more filters to the list.

image

The Properties tab allows to change the view name, fonts and other visual aspect of the streaming list.The final streaming list view should resemble something as shown in the below screenshot.

image

Hyperlinking a Column in the Report with an Action

Well, the teaser video above showed that the composite instances in the view were hyperlinked which when clicked pops up the audit trail (as seen from the composite dashboard of Enterprise Manager Fusion Middleware Console) for the selected instance. Now for the creamy part of this article, it will be described to create and implement action buttons in Oracle BAM and how they can be used in a report. Select the Completed Instances streaming list report tile and then click on the Change Report Properties link under the report Actions menu. This opens the Report Properties popup dialog. Click the Actions tab and then the New button to create and configure a new action for the report. Provide a name and optional description for the action name and hit Next.

image

The Action Type lists various action that can be performed on data in a report such as executing a read/write action on data input, selections from that action list or form, open an external URL etc. From the options in the select the Open a URL radio box and then click on Next to open the Action Editor. The action editor provide a very convenient feature to construct a URL by creating a combination of terms term which can be concatenated in the end to form the final URL. These terms can be configured to either have constant values or represent dynamic columnar values from any selected view in a report.

image

Before being able to configure the URL term, it is required to know how to open the link to the audit trail of an instance. The audit trail of any composite instance can be directly viewed in the browser by using the link below.

http://<hostname>:<portName>/em/faces/ai/soa/messageFlow?target=/Farm_<domain_name>/<domain_name>/soa_server1/<partition>/<composite_name>%20[<version>]&type=oracle_soa_composite&soaContext=<partition>/<composite_name>!<version>/<instance_id>

The link, however is made up of a lot of instance specific information such as the host, port and partition of the soa server where the composite is deployed to, its version and the instance id. Interestingly all but the host name, port name and the domain name (Weblogic server domain name) can be figured out from the default data object itself. They can either be hard coded for each instance of the BAM server to have the corresponding value of the SOA server or the other ingenious way is to create a table in the database and read the values from it. The instance specific information can be directly derived as values of the selected row from the view list. There are other ingenious ways to do it if you dont want to hard code these values. Entering constant values for a URL term is pretty simple. Simply choose the Mapping Type as Constant Value to be able to enter the hard coded part of the URL.

image

The dynamic part of the URL value can be added in a two step process. First select the choose Value from a List View radio buttonin the Mapping Type and then select the view from the report skeleton containing the streaming list to populate a drop down of the data object columns used in the list. Select the appropriate column value that is needed in the URL. For instance, the COMPOSITE_NAME, COMPOSITE_REVISION, DOMAIN_NAME (this is the partition contrary to the Weblogic domain name) and COMPOSITE_INSTANCE_ID may be required as dynamic values in the URL. There is no restriction on the number of terms that can be created as a combination of constant and lookup values to form the complete URL.

image

The final Open a URL configuration screen will contain multiple entries that are a combination of constant hard coded values and dynamic values from the list. These are concatenated together to form the actual URL for the hyperlink to be launched when the composite instance column is clicked in the list view. The wizard also allows editing the features of the popup. Click on the Click here to edit Windows features link and choose Full screen for both the width and height of the popup window to display it in full screen mode.

image

Now that the action is defined the last remaining bit is to configure the action button itself. Click on Next to be presented to the Button Formatting screen. Select the Display the button in a view radio button and from the visual empty report  skeleton select the streaming list view to which the URL action needs to be added. As a hyperlink is desired on the composite instance id column for the view check the Display as a column of formatted links in the selected view option and from the Column to format dropdown choose COMPOSITE_INSTANCE_ID. Click OK on all the screens to save the changed report properties.  With this the configuration changes required for the Completed Instances view of the reporting dashboard is complete. The article will shortly demonstrate how the final view looks like and what does the configured action list do.

image

Adding the SOAINFRA Schema as an External Data Source

In the following part of the article, another interesting aspect of the use case that is to view the task form of an instance that is awaiting an action from a process user will be demonstrated. But before going ahead with creating the report view there is something else that has to be taken care of. In order to open a task form corresponding to a particular instance id, its taskId is required. Unfortunately the default business indicator metrics data object does not contain the task id. The easiest way to lookup taskId for a composite instance is to query the WFTASK table in the SOAINFRA schema.

select taskid,state from wftask where compositeinstanceid=?;

However the problem is that composite instance id and taskId share a one to many relationship. The query to retrieve taskdId from compositeInstanceId my return more than one row and not all of them can be used to open the task form. Another important thing to know would be that only the taskId row that has the value of the state column as ASSIGNED indicates the current task(s) that are pending actioning from process users. This is achieved by simply appending a filter on the state column.

select taskid,instanceid,ecid from wftask where compositeinstanceid=? and state=’ASSIGNED’;

It is therefore required that there is some sort of mechanism available in BAM to lookup these required field from the database table. This is facilitated in Oracle BAM using external data sources. To begin with open the BAM Architect view from the landing page and click on External Data Sources. Click Create to configure an external data source, provide a suitable name, say SOA_INFRA and connect to the [PREFIX]_SOAINFRA schema. Check out the screenshot below to see as how to provide the schema name, password and the connection string. Verify that the connection to the schema is established by clicking the Test button at the bottom.

image

Creating an External Data Object with the WFTASK table

The external data source can now be used to create an external data object. Browse to the AccountInititation subfolder and click on the Create Data Object link to create a new data object. Name it as TaskDetails. Check the option box beside External Data Object  indicating that this data object sources its content from a database table instead. Select the external data source that was created in the previous step and then select WFTASK from the dropdown under External Table Name. The columns of this database table are now available to be added as fields for the data object by clicking on the Add a field link. The fields that are added from database table are COMPOSITEINSTANCEID,TASKID,PROCESSDUEDATE,ACCQUIREDBY,ASSIGNEES,ASSIGNEEUSERS,CREATOR,STATE,INSTANCEID,ECID. Note that only a few of these fields will be needed to configure the report view. After the fields are added click on Save Changes to save the data object. View the Contents tab of this data object to see the selected columns for all the rows in the database.

image

Adding Lookup Fields in the Business Indicator Data Object from the External Data Object

As discussed earlier the streaming action list view to display the in-flight composite instances with human tasks will need to source its reporting data from the BI_default_OnlineAccountOpening_AccountOpeningProcess data object. But somehow this data object would need the additionally  required fields too such as the TASKID, STATE. These fields can be looked up from the TaskDetails data object. This is straight forward as Oracle BAM data objects allows creating look up fields that can be created to look up data from different data objects. Open the BI_default_OnlineAccountOpening_AccountOpeningProcess data object and click on Layout > Edit Layout to be able to add lookup fields to it. Once in the edit mode, click on the Add one or more lookup fields link at the bottom to open the lookup field definition popup. Select the TaskDetails data object and from the list of Lookup Fields click on the TASKID field. This lookup however will be based on some common fields in both these data objects. Select COMPOSITEINSTANCEID from the list under Fields to match from Lookup Data Object  and COMPOSITE_INSTANCE_ID from the list under Fields to match from this Data Object. Click Add to define the lookup criterion. More than one such lookup criterions can be added if needed be. Similarly add another lookup field i.e the STATE from the TaskDetails data object. Keep the lookup criterions based on the COMPOSITE_INSTANCE_ID and COMPONENT_INSTANCE_ID. Now the  BI_default_OnlineAccountOpening_AccountOpeningProcess will also have the values for TASKID and STATE for a given composite instance.

image

Configuring the Streaming Action List for Inflight Instances

Make sure everything is saved for the moment. Edit the  original report template and for the next horizontal tile too select the view type as Action List. The streaming list view will have to be now configured to show the relevant in-flight live instances. Open the report in the Edit mode. For the data object field select the same data object as used in the previous view i.e BI_default_OnlineAccountOpening_AccountOpeningProcess. Go to the Fields tab to select and arrange the following fields in their order: COMPOSITE_INSTANCE_ID, BI_NAME, COMPONENT_NAME, METRIC_cardApplicationStatus, STATE, TASKID. From the Sort tab add BI_NAME and METRIC_cardApplicationStatus under the Sorted Fields.

image

As stated earlier if no filters are applied to this data object list, it will end up displaying all the instances against all executed activities in the business process. In order to view non-duplicated composite instances only the ones that are latest are to be filtered out. and just those that are assigned to process users. Having such filters is easy. Click on the Filter tab and click on Add Entry. This opens the Filter Expression wizard. Add a filter for the STATE field having a value of ASSIGNED. Similarly add another filter for the LATEST field to have a value of Y. This would do the work.

image

The display settings of a report are configured from the menu tabs under for the Properties button. Click on the Properties button and under the General tab enter Live Instances for the View Title. By default the streaming action list shows checkboxes against all the rows in the report. Change these to radio buttons so that only an instance is selected at a time. Go to the Actions tab and select Single Select (radio buttons) options.

image

Once these settings are applied and saved the streaming list will show the in-flight instances along with their task identifier and the pending action. Optionally, the task creators, assignees, task expiration time, priorities etc. can also be shown in this list to have a better visibility as to which tasks are assigned to which process and which tasks needs urgent attention. Also note that the column titles displayed in the screenshot below is different from the data objects fields. This can be done by overriding their default names from the Text and Align tab under the Properties button.

image

Define an Action Button for the selected instances of the List

The final piece in the hook is to define an action button for a selected row in the report view. What is desired here is that when a row is selected the action button should take the users to the approval form for the selected instance. This would effectively mean launching the business process workspace view of the task form allowing it to be actioned if needed be. Opening the task approval form is easy. The URL to be used to launch the task form simply needs the HOST and PORT on which the business process workspace is running and the task id of the composite instance (which is obtained already and displayed in the list).

http://HOST:PORT/integration/worklistapp/faces/home.jspx?taskId=TASKID

The same set of steps that were discussed earlier to create an action button can be executed once again to create another action button. Open the report once again in the Edit mode, select the view and click on Change Report Properties.  Click on the Actions tab and then the New button to open a new action editor wizard. Name this action button as View Approval Page. In the next screen define the type of action as Open a URL. The URL for the action button can be configured by adding constant or dynamic strings (here referred to as Terms) which when concatenated will give the complete URL string.

image

Create a New Term with constant value by passing the entire URL string except the TASKID in it. Be sure to replace the value of the HOST and PORT with that of the server instance running the business process workspace user interface. Add another New Term but this time choose Value from a List View from the mapping type action list. The next screen displays the report skeleton from where select the live instances view in the report. This will show all the selected data object fields configured for the list as dropdowns under Select a column from this view column. Select TASKID and then click OK.

image

In the following Button Formatting screen simply select the Display the button in a view radio button under the Button Location panel. This will add the action button in the same view. For rest of the screens simply click on OK to save the report property changes.

image

Appreciating the End Result

Well, that’s it! After all these changes your BAM users will be able to see two streaming lists of completed/historical instances and in-flight instances. The users will also be able to view the instance audit trail by clicking on an instance in the list and if they happen to be process users then also action in-flight instances by selecting it and clicking the View Approval Page action button. This also allows you to create a seamlessly correlated view of instances across the multiple dashboards that Oracle SOA Suite 11g has to offer. It is important to note that not everyone in the organization will be able to view the task-form for the instance. Only users who are assigned to the process roles to action the task will be able to do so. This ensures that the security aspects of this implementation methodology is also covered

image

Downloadable Resources for the Project

You can import these data objects and reports into your BAM server by running the ICommand utility. The easiest way is to copy all the dataobjects and reports in the DataObjects.zip file to the <MIDDLEAWARE_HOME>\Oracle_SOA1\bam\bin directory and then run  icommand –cmdfile import.xml in the command line. Before running the Icommand utility make sure that the BAMIcommandConfig.xml file under the <MIDDLEAWARE_HOME>\Oracle_SOA1\bam\config directory is configured to point to the correct instance of the BAM server. A detailed explanation of working with the ICommand utility can be read here at http://docs.oracle.com/cd/E14571_01/integration.1111/e10224/bam_app_icommand.htm

Feel free to post comments and suggestions, and possible improvements and I will be glad to incorporate them here. If you have a similar requirement and are struggling to re-create a reporting dashboard similar to what is proposed, send me a message.

Hope this article helps!

.

September 6, 2012

Oracle SOA Suite 11g: Advanced Administration Topics

A few days ago, i had the pleasure to announce the release of my upcoming handbook on Oracle SOA Suite 11g Administration Handbook. It is my privilege once again to let everyone know that Chapter 10 of our book, that deals with some advanced administration topic is available as a free download from the publisher’s website. Here is the link for the chapter.

http://www.packtpub.com/sites/default/files/downloads/6082EN_Chapter10_Advanced_Administration_Topics.pdf?utm_source=packtpub&utm_medium=free&utm_campaign=pdf

In addition to this chapter, the sample code for the book, containing a handful of administration scripts, can also be downloaded from

http://www.packtpub.com/support/10082

The entire table of content of the book can be see here

http://www.packtpub.com/oracle-soa-suite-11g-administrators-handbook/book

I am thrilled by the number of emails and accolades I have received so far with respect to the contents of the book. I am sure this would be useful to both Oracle SOA Suite 11g Administrators and Developers alike.

August 28, 2012

Oracle SOA Suite 11g Administrator’s Handbook

Your blogger, for the past few months has been involved in what I am sure many will agree is a nightmarish activity.  As a result the blog posts have dried up a little as blogging involves both time and novelty and I have been a little short on the first lately. What has consumed me all the while? Well it was co-authoring a book on Oracle SOA Suite 11g Administration and ensuring that it met our vision to provide readers with a definitive administration reference handbook. The book was announced a month ago and is finally out and available.

6082EN_mockupcover_normal

My fellow co-author Ahmed Aboulnaga, has been quick enough to mention this on this widely popular blog and you can read about the book here at: http://blog.ipnweb.com/2012/08/oracle-soa-suite-11g-administrators.html

Ahmed, in his blog post, has already listed down, in details, as what is this book about, who is it for, and the contents of the book. I will thereby refrain myself from repeating the same things again here. However, I would though like to share a few insights that went into making the books and why do we think this book would be useful for the readers.

Oracle SOA Suite 11g is the backbone of messaging and application integration in a service oriented/event driven architecture. Due to its sheer size, understanding the underlying components, services, configuration and their relations, can be a daunting task. But it doesn’t have to be! Faced with the many challenges and common pitfalls involved in real-world Oracle SOA Suite implementations, we realized an opportunity to provide a comprehensive yet practical solutions guide to both re-actively and pro-actively manage the infrastructure.  We have ensured a lot of our real-world
experiences of working with Oracle SOA Suite 11g infrastructure are captured in the book and that we deliver a comprehensive guide filled with grounded solutions, best practice(s), and pragmatic instructions.

We begin by providing an introduction of SOA and quickly move on to provide as much concise and useful information related to management of SOA composite applications. We feel it is important to know how to manage composite applications, their deployments and lifecycles to be successful in administering them.

First and foremost, this book is an attempt to equip the reader with everything they need to know about all the core administrative and management activities around Oracle SOA Suite 11g. Our attempt throughout this book has been to give readers administration tips straight from the trench, i.e from our real time experiences. Among the many things covered in this book are automation techniques to manage the infrastructure, troubleshoot root causes of error, devising strategies of reuse with respect to code, configuration and customizations, engage in performance tuning of each components individually or the infrastructure as a whole apart from routine administration activities. The book has a wealth of information that can be applied to real world scenarios or help you understand the best ways to tackle core administration tasks in Oracle SOA Suite 11g. It has been structured to allow readers to open up any chapter of interest, with earlier chapters beginning with more basic administrative concepts while moving to more advanced topics towards the latter half.  Right from Chapter 1, we have made the best effort to ensure that the reader is taken through a step-by-step, tutorial based approach offering a unique insight into the what, why and how of all administrative related activities involved with Oracle SOA Suite 11g. Our aim throughout was to put forward a definitive guide to real world administration of Oracle SOA Suite 11g, that provides a monitoring, troubleshooting and tuning methodology, explains what and how to backup and restore your environment, configure the infrastructure to implement a policy based security framework, offer resuable scripts for common administration tasks such as deployments,tuning and migration, and delves into advanced topics such as silent installs, cloning, backup and recovery and provisioning highly available infrastructure.

Instructions and guidelines provided in the book offer a lot of handy tips and best practices, all based on real-world problems and solutions that Oracle SOA Suite 11g Administrators can benefit with and significantly increase their productivity. We certainly feel that you will feel armed with all the “to-do’s” and “know-how’s” of basic and advanced administration with this book. The skills and insights learnt from each of the chapters in this book can inadvertently be  applied to real world administration.

Part of our writing style in this book draws heavily on the philosophy of reuse and as such we provide an ample of executable SQL queries and WLST scripts that administrators can reuse and extend to perform most of the administration tasks such as monitoring instances, processing times, instance states and perform automatic deployments, tuning, migration, and installation. These scripts are spread over each of the chapters in the book and can also be downloaded from http://www.packtpub.com/oracle-soa-suite-11g-administrators-handbook/book

I would finally try to make a brave and best attempt to summarize in brief the key learning’s from the book:

  • Overview of the Consoles and Key Administration Areas.
  • Monitoring Instances, Messages, and Composites
  • Configuring Audit Levels and means of end-to-end monitoring through the use of extended logging
  • Administering and configuring components within Oracle SOA Suite 11g such as the BPEL, Mediator, BAM, EDN engines, Services and References.
  • Monitor and Performance Tuning service engines, WebLogic server, threads and timeouts, files systems, and composite applications.
  • Interacting with and configuring the infrastructure MBeans using both Oracle Enterprise Manager Fusion Middleware Control and WLST based scripts.
  • Troubleshooting approaches as how to identify faults and exception through extended logging and thread dumps and find solutions to common start-up problems and deployment issues.
  • Secure the components deployed to the infrastructure by leveraging Oracle Web Services Manager along with the supporting infrastructure configurations.
  • Later chapters deal with managing the Metadata Services Repository, dehydration store, backup and recovery.
  • Use case depicting entire steps involved in upgrading from one patchset to another and migrating from SOA Suite 10g to 11g.
  • Advanced topics such as silent installations, cloning, and high availability installations.

Finally, I would reiterate the statement made by my co-author once again that this book is not a re-hash of Oracle’s documentation on Oracle SOA Suite 11g. It offers insights into SOA Suite administration that you will not find elsewhere. If you are an Oracle SOA Suite Administrator or aspiring to be one, then this book is your bible. It gives you everything you need to about all your tasks and lets you apply what you learn in your everyday life right from chapter.

The book is available at the following websites:

Paperback and eBook versions:
http://www.packtpub.com/oracle-soa-suite-11g-administrators-handbook/book

Kindle version:
http://www.amazon.com/Oracle-Suite-Administrators-Handbook-ebook/dp/B0092JYZXI/ref=tmm_kin_title_0?qid=1346074747

Any feedback, comments and inquiries are most welcome!

Arun Pareek

 

March 9, 2012

Automating Business Rules Testing in Oracle SOA Suite 11g

I have already written two blogs earlier on different ways to test business rules in Oracle SOA Suite 11g. They can be accessed at the below links.

http://beatechnologies.wordpress.com/2011/04/19/using-and-testing-complex-business-rules-in-oracle-soasuite-11g/

http://beatechnologies.wordpress.com/2011/07/07/testing-oracle-business-rules-using-java/

The above posts describe strategies that can be employed to test business rules at both runtime and design time with a real world use case. The only hitch was in scenarios where developers would want to create a testing suite and use it along with a test framework like JUnit for a better and automated test coverage and analysis. The workaround was tedious and involved using the Business Rules API. This was also tedious as it involved a heavy bit of code to marshall xml request to JAXB objects.

However I felt compelled to write another post as the new SOA suite release has some better functionalities available out of the box as far as unit testing business rules is concerned. Starting from Oracle SOA Suite 11g PS4FP or PS5, we now have a much better support to test rules at design time, create test suite and write test cases in plain xml to cover all possible business scenarios.

Prerequisites

Downloading the BusinessRulesProject

This post builds up from the example and use case covered in the previous posts mentioned above. You can start by downloading the BusinessRulesApplication and open the .jws file in JDeveloper to open the project.

Working on the Test Suite

After you have opened the project in JDeveloper double click on the GradeAllocationRules component from the composite design view. This would open the rule dictionary in the rules editor.

Click on the Decision Functions tab on the left to see the web service function that wraps the rule sets within.  An icon image to create the test suite schemas is available that generates the XSD’s containing input and output types for a Test Suite.

image

You would not see anything happening in the wizard but you need not worry. The schemas are generated in the testsuites\xsd folder. A test suite is comprised of a number of test cases and each test case takes in an xml test input and an xml expected output.

image

You can then click on the the Test –> Test with Test Suite to now generate a Test Suite skeleton file.

image

If you create the Test Suite, you would wonder what happened. Since if you run the test suite from the Run Test button, it alerts that there is no input in your test case. Well if you go and see your project navigator, there will be a folder with the same name that is specified for the test case and a corresponding xml file within it. This xml file can contain as many unit test cases that you may want to run for the selected decision function. Each test case has an input and a corresponding expected output (an favorable output  that you need to assert with the response of decision function execution).

image

The immediate question is how to create a valid test case in the test suite xml file. The testCase element needs two elements viz testInput and expectedOutput in a format specified by the testCaseType. You can use any tool that can generate a sample XML from an XSD type in case you cannot figure it out yourself. Below is the way to do this using Altova. All that you would have to do is copy the child elements inside the testCase parent and replace their value with something that you can test your business rule with. Also note that you can have as many test cases created in this file as you may like.

image

Save the changes to the Test Suite xml file and repoen the Decision function test suite wizard. Click on the Run Test button to execute the business rule function against the input specified in the test case and assert it with a predefined response. This will show you the overall test suite execution status with outcome of all the individual test cases in a tabular format under the Test Results field box. The report tabulates all the test cases that are run, their execution status, execution trace and comments.

image  Now this is pretty good. There is no need to write any custom code to invoke the Rule API to create unit test cases. Developers can create more than one test suite and each test suite can contain any number of test cases.

Well all is good till now. But there are a couple of things that are missing here. First of all there is no option to save/export/archive the Test Results in the way it is displayed in the test wizard so as to refer them later. Secondly developers will still require a way to automatically run all the test suits rather than doing it manually. Proponents of automation will be will definitely find it important to apply a wider functionality such as automated builds, integration of test execution with continuous builds, etc.

Having said that, we can do a little bit of Java to invoke the run the test suite like the wizard does and save the output to a file. It is obvious that we will need to yet again use the Rules API but in a less messier way than before. All that we need to do is define the test suite with as many test cases with as many inputs and expected outputs and then have a test runner method to execute them.

Here in this following example I use a couple of methods from the DFTestSuiteRunner class to execute the test suite and DFTestSuiteResult class to obtain the execution summary.

These classes are available in the rulestest.jar located in <JDEV_HOME>\jdeveloper\soa\modules\ oracle.rules_11.1.1 directory. Create a java project and a java class in JDeveloper and add this jar into its classpath. I called my class as RuleTestSuiteRunner and here is its code:

package com.soatechnologies.sample.rules.testclient;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

import oracle.rules.sdk2.datamodel.DecisionFunction;
import oracle.rules.sdk2.decisionpoint.DecisionPointDictionaryFinder;
import oracle.rules.sdk2.dictionary.RuleDictionary;
import oracle.rules.sdk2.exception.SDKWarning;
import oracle.rules.testfmwk.common.exception.InvalidTestSuiteException;
import oracle.rules.testfmwk.impl.DFTestSuiteResult;
import oracle.rules.testfmwk.impl.DFTestSuiteRunner;
import oracle.rules.testfmwk.model.TestCaseType;
import oracle.rules.testfmwk.model.TestSuite;
import oracle.rules.testfmwk.util.TestUtil;

public class RuleTestSuiteRunner  {
public RuleTestSuiteRunner() {
}
/**
* This method  allows invoking the TestRunner utility to test an Oracle Business Rule Test Suite.
* The method also saves the result of the test into a HTML file that displays a JUNIT type static
* report.
*
* @param  dictionaryName  Absoulte path of the .Rules file
* @param  decisionFunction Name of the Decision Function to be tested
* @param  testSuiteName  Name of the of the Test Suire that is created in the rule test wizard
* @param  testSuiteFile  Absoulte path of the Rules test XML file. This is generated in the testsuites folder
* @param  reportDirectory File System directory where output of the test is to be archived
*/
public void testRulesTestSuite(String dictionaryName, String decisionFunction, String testSuiteName, String testSuiteFile, String reportDirectory) throws Exception {
File tsFile =null;
RuleDictionary rd=null;
DecisionFunction df=null;
String reportSummary= null;
try {
tsFile = new File(testSuiteFile);
}
catch(Exception fe) {
System.err.println("Exception in Reading Source Test Suite File: " + fe.getMessage());
}
if (dictionaryName != null && decisionFunction!=null)
{
rd=loadRuleDictionary(dictionaryName);
df = rd.getDataModel().getDecisionFunctionTable().getByName(decisionFunction);
}
//    System.out.println("DF Name : " + df.getName());
//    System.out.println("Dictionary Name : " + rd.getDataModel().getDecisionFunctionTable().getByName(decisionFunction));
DFTestSuiteResult dfTestSuiteResult = new DFTestSuiteResult(df.getName(),testSuiteName);
DFTestSuiteRunner testRunner= new DFTestSuiteRunner(tsFile,df,rd,dfTestSuiteResult);
List<String> listString = getTestCasesFromTestSuite(tsFile);
String[] testCaseArray = listString.toArray(new String[listString.size()]);
testRunner.runTests(testCaseArray);
reportSummary= dfTestSuiteResult.getResultSummary();
System.out.println("Test Case Output : "+ reportSummary);
saveTestReport(reportDirectory,reportSummary);
}
/**
* This method  returns an instance of the RuleDictionary object from the dictionary path
*
* @param  dictionaryPath  Absoulte path of the .Rules file
* @return  ruledictionary Object of the RuleDictionary Class
* @see         RuleDictionary
*/
private static  RuleDictionary loadRuleDictionary(String dictionaryPath) throws Exception {
RuleDictionary ruledictionary = null;
Reader reader = null;
Writer writer = null;
try {
reader = new FileReader(new File(dictionaryPath));
ruledictionary = RuleDictionary.readDictionary(reader, new DecisionPointDictionaryFinder(null));
List<SDKWarning> warnings = new ArrayList<SDKWarning>();
ruledictionary.update(warnings);
if (warnings.size() > 0) {
System.err.println("Rule Dictionary returned the followingv validation warnings: " + warnings);
}
}
finally {
if (reader != null) {
try {
reader.close();
} catch (IOException ioe)
{
ioe.printStackTrace();
}
}
if (writer != null) {
try {
writer.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
return ruledictionary;
}
/**
* This method take in the Test Suite XML file that is generated with the Test Suite wizard, iterates over
*  the Rules test suite file and retuns a list of all test cases contained in it.
*
* @param  tsFile  Absoulte path of the .XML Test Suite file
* @return  testCaseArrayList List of all Test Cases in the Test Suite
*/
private  static List<String> getTestCasesFromTestSuite(File tsFile)  throws InvalidTestSuiteException
{
ArrayList<String> testCaseArrayList = new ArrayList<String>();
ListIterator localListIterator;
if (tsFile != null) {
TestSuite localTestSuite = TestUtil.readTestSuite(tsFile);
List localList = localTestSuite.getTestCase();
for (localListIterator = localList.listIterator(); localListIterator.hasNext(); )
{
TestCaseType localTestCaseType = (TestCaseType)localListIterator.next();
testCaseArrayList.add(localTestCaseType.getName());
}
}
return testCaseArrayList;
}
/**
* This method take in the Test Suite XML file that is generated with the Test Suite wizard, iterates over
*  the Rules test suite file and retuns a list of all test cases contained in it.
*
* @param  reportDirectory  Absoulte path of the file system directory to save the test run output
* @param  reportSummary  String containing HTML summary of all test case status
*/
private  static void saveTestReport (String reportDirectory, String reportSummary)  throws InvalidTestSuiteException
{
try{
// Create file
FileWriter fstream = new FileWriter(reportDirectory+"\\"+"TestReport.html");
BufferedWriter out = new BufferedWriter(fstream);
out.write(reportSummary);
//Close the output stream
out.close();
}catch (Exception e){
System.err.println("Error: " + e.getMessage());
}

}

public static void main(String[] args) throws Exception {

RuleTestSuiteRunner testRunner = new RuleTestSuiteRunner();
String ruleProjectDirectory="C:\\JDeveloper\\mywork\\BusinessRulesApplication\\BusinessRulesProject"
+"\\oracle\\rules\\com\\obr\\sample\\app\\GradeAllocationRule.rules" ;
String decisionFunctionName="GradeAllocationRule_decideGrade";
String testSuiteName="GradeAllocationRulesTest";
String testSuiteXML="C:\\JDeveloper\\mywork\\BusinessRulesApplication\\BusinessRulesProject"
+"\\testsuites\\rules\\GradeAllocationRule\\GradeAllocationRulesTest.xml";
String reportDirectory="C:\\Arrun\\Reports";
testRunner.testRulesTestSuite(ruleProjectDirectory,decisionFunctionName,testSuiteName,testSuiteXML, reportDirectory);
}
}

Explaining the Code

Well, I have pretty much tried to use as much Java documentation as possible. Nevertheless, an object of the DFTestSuiteRunner class can be instantiated by passing the Test Suite file, Decision Function object, Rule Dictionary object and an object of type DFTestSuiteResult. All of these arguments can be constructed by simply either passing their fully qualified names or absolute path in the file system.

The getTestCasesFromTestSuite(File testSuiteFile) method a list of all test cases available in a given test suite. The DFTestSuiteRunner object can then be used to invoke the runTests(java.lang.String[] p1) method that unit tests all the test cases coming as an array of strings.

And finally you can use the DFTestSuiteResult object to print the test execution report summary and archive it to a file. The class contains a getResultSummary() method that returns an html string containing the execution report in the same tabular format as displayed in the test wizard.

Here is a sample of executing the main function of this class with all appropriate arguments being specified.

image

And the archived HTML report can be found in the directory location specified for the report output directory. It contains the test case assertion status and the execution trace. If there are any tests that fails the reason is specified in the comments column.

image

This code is much easy to implement and maintain. This is generic and practically constant. All you have to do is cover as many test scenarios to test your business rules as test cases inside the test suite xml file.

You can find the entire BusineRulesApplication containing the Rule composite and the Java project from here.

Also feel free to suggest any changes or improvements if there are any.

November 8, 2011

Using Intermediate Events and Advanced TaskService Interactions in Oracle BPM Suite 11g

This blog post will demonstrate with the help of a basic use-case the use and importance of intermediate events in Oracle BPM based processes. A typical business process also has manual touch points that are implemented by process users through Human Task UI’s. It is evident that a very important aspect in any agile business process is the ability to interact with these in-flight human tasks based on intermediate events. This post shall also demonstrate how to modify in-flight task States in Oracle BPM Suite 11g. You can similarly do a host of other operations with the full use of the Worklist Management API’s.  Keep reading.

Intermediate Events occur in the middle of the process and are of either Catch or Throw type. The Catch Events wait or block for appropriate signals while the Throw events proceed after throwing the signal.

The Basic Use Case

XYZ Bank has a simple business process defined for a Credit Card approval flow. Below are some important activities that any card application request has to go through.

Manual Card Approval

All requests that require further investigation (i.e. applications that cannot be pre approved using the business rules) should be sent to analysts belonging to the Credit Card Approvers role. The approver can complete the review by either Approving or Rejecting the request.

Cancel Card Application Event

While a card application request is in process, a customer can indicate that they wish to cancel their request. The customer is asked to provide an optional reason for wanting to cancel the request. The result of the cancellation request can be:

  • The request was cancelled
  • The request could not be cancelled because it had already been completed.

In that case the outcome of the original request should be provided to the customer.

Note : This example doesn’t deals with the cancellation scenario. This is explained in details in my previous blog post.

http://beatechnologies.wordpress.com/2011/10/17/working-with-custom-correlation-in-oracle-bpm-suite-11g-ps4-feature-pack/

Potential Fraud

There is an external process that is evaluating increase requests to look for patterns that might signal fraud. When the pattern is matched, the process generates an Handle Fraud Event for a specific application request with a score that indicates that fraud is:

Probable ( Score =< 8 )

Possible ( Score >8 )

The process needs to listen for these events and take the following actions when the Handle Fraud Event is for the specific request that is in flight.

For Possible Fraud

When a possible fraud is recorded the existing process should be terminated. Before terminating the process the Manual Approval In-Flight task (if any) should also be withdrawn.

For Probable Fraud

An Ad-Hoc Manual Task should be created for the role FraudInvestigator. While the investigation is ongoing, the normal path of process must be suspended. The outcomes of the investigation is either APPROVE or REJECT. If the outcome is REJECT the current card application request likely represents fraud, or NO, the current increase request does not represent fraud. If the investigation result is APPROVE, the normal approval processing should be resumed unless the process has been tagged as cancelled.

Refer the business process diagram below to understand the use case better.

image

Prerequisites

The following version of software have been used to for this example and demonstration.

  • JDeveloper 11g PS4 (With BPM-SOA FP Extension)
  • PS4 FP SOA and BPM Extensions for JDeveloper
  • Oracle BPM Suite 11g PS4 Feature Pack

More information about downloading it can be found here

Implementing the Process

Oracle  SOA Suite leverages the Human Workflow Engine to implement Manual/User Tasks. The Human Workflow Engine exposes APIs (both Java and Web Service based) which can be used to interact with Tasks for specific business needs. There are Task Management Services which can be used to alter States of in-flight tasks, Task Query Service that can query for task details based on taskId, taskNumber or other task Predicates.

In this example I will show how we can use the TaskService to manipulate task states from within a business process.

Getting the Task Id for the “Approve Card Manually” user task.

The first thing to do is create a Process Data Object called manualTaskApprovalId to hold the value of the generated Task Id for the manual Task. The data object should be assigned the value of execData.systemAttributes.taskId from the Output tab in the Data Association for the task activity.

image

We will use this obtained taskId to invoke operations on the TaskService API.

Creating a Reference to the TaskService in the Composite Application

Next we will have to create a reference to the TaskService.wsdl in our composite. The TaskService.wsdl can be located in the soainfra metadata store partition.

image

The operations of the TaskService Web Service API’s now appear in the External Reference panel of the composite application.

Create a Mediator Component that acts as a Proxy to the TaskService Interface

Drop a Mediator Component into the composite and Define its interface from the TaskService.wsdl that is now copied into the project directory. In case you have chosen not to copy the wsdl and its dependent artifacts into the project you can refer it from the MDS. It is just the same. Also uncheck the Create Composite Service with SOAP bindings since we will only need to invoke it from within the composite.

Double click on the Mediator Component you just created. We will see that all operations in the TaskService interface appear in the Mediator. Go to the suspendTask operation in the Mediator and create a static routing rule  for it. The static routing rule should invoke a Service. From the wizard prompt use the suspendTask operation from the TaskService interface.

image

In a similar way create the static routing for other two operations i.e withdrawTask and resumeTask.

Fraud Check Event Subprocess

Coming to the Fraud check event sun-process the first thing we need to do is define correlation for the Handle Fraud start event. This is required as this is an intermediate event and this need to correlate with the desired in-flight process instance.
image

To know more about the use of correlation in Oracle BPM 11g read my previous post here.

When there is a Probable Fraud i.e fraud check score is less than 8 the process needs to be suspended in case it is awaiting for manual approval.

This can be achieved quite easily. All that we have to do is create a Service Task Activity and invoke the suspendTask operation of the TaskFlowMediator.

To keep this absolutely simple the only input required for suspendTask operation is the taskId for the Approve Card Manually Task that we had captured earlier in a process data object.

image

This will suspend the Manual Approval task and hence the process instance cannot  move ahead unless it is withdrawn or resumed and subsequently Approved or Rejected.

Depending upon the outcome of the Ad Hoc Approval by the FraudInvestigator role the process can either be Resumed and the original process flow continue (as the Handle Fault Event was defined as a non Interrupting Event) or it can be withdrawn the process Terminated.

This is pretty much it about the defining the main tasks and services in the process. You can find the Composite Application attached here to be more acquainted with the process flow.

Testing the Process and Verifying the Results

Post deployment of the composite application to a running server we cam test it. The composite exposes three operations (approveCard, cancelCardRequest and handleFraudEvent). Let us start to test the composite by invoking the approveCard operation that will start the card application approval process.

image

As you observed the instance has moved to the ManualCardApproval touch point and is awaiting for a response from a user with CreditCardApprover role.

image

Now let say a Fraud Event is reported now for this instance while the CreditCardApprover still hasn’t dealt with this task. In this case the Fraud Event Subprocess should kick off and the FraudInvestigator is involved for Ad Hoc Approval in case the fraud is probable.

We can emulate this scenario by unit testing the composite once again. But this time we will invoke the handleFraudEvent opetation of the composite. One important point to note here is that since we are using the customer contact number to correlate the fraudEvent with the in-flight instance, we need to have the same customer contact number in the request of this operation.

image

The effect of a fraud intermediate event is that the original task assigned to the CreditCardApprover role will be suspended and hence the process instance is stalled.

The FraudInvestigator has to provide an ad hoc response to confirm/reject this probable fault. So an Ad Hoc Approval Task awaits his response in his worklist.

image

If the FraudInvestigator approves the application then the original task is once again resumed and appears in the Assigned state in the CreditCardApprover’s worklist. Once it is approved once again (this time the approval is based on things like applicant’s eligibility, credit score, limit requested etc) the process is successfully completed.

image

The entire process flow diagram will give a picture of the path that the process took during its Happy-Path completion.

image

Testing the Unhappy Path – FraudInvestigator Confirms a Probable Fraud

To test this follow a couple of steps that we did earlier i.e. invoking an approveCard operation and then invoking the intermediate fraud check event operation for the same customer.

The flow will be similar to the above till here. The Fraud Investigator will have an Ad Hoc Approval Task and the original task will be suspended.

Now if the FraudInvestigator confirms a fraud in the application then the process instance is terminated and the original Manual Card Approval task is withdrawn.

image

A look at the process flow will now reveal that the process instance doesn’t moves back to the original instance (Since it is Terminated).

image

That’s is with the process.

Conclusion

This article deals with some advanced concepts around Oracle BPM Suite 11g. Hope it explains how we can effectively use intermediate events (of both Interrupting and Non-Interrupting Type). It also explains how we can interact with the Worklist API’s using the TaskService interface to interact with Human Workflow tasks from within a BPM process.

The composite used for the demonstration can be downloaded from this location or from here

Please send across your questions, commends and feedback and i will be eager to answer them.

.

Older Posts »

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 912 other followers