Pages

Helpful Links

Showing posts with label variables. Show all posts
Showing posts with label variables. Show all posts

Thursday, December 8, 2011

Oracle BPM: Working with Exceptions

Like every project and application exceptions are really important. They make small mistakes in the project almost negligible, good exception handling tries to hide the bugs in the project. In Oracle BPM exception handling is covered and multiple ways are given to handle the exception that occur outside the normal flow. 4 types of exception are covered:
  1. System Exceptions
  2. Business Exceptions
  3. Code level Exception Handling
  4. Process level exception Handling
1. System level exception for hardware and software problems or unavailability. It is covered by BPM itself as it contains in component catalog -> java -> Lang -> Exception. An error or reason is given to end user.

2. Business Exceptions are generated by business rules. They are generated if some business rule is not met, for example the code below
if creditlimit > givenlimit then
   limitException as OverLimitException = OverlimitException()
   limitException.value  = creditlimit
   throw limitException 
end 
3.  Code level exceptions are handled at code level like
do
  // regular code 

on Exception
  // exception handling code

on exit
  // clean-up code (always executed)

end 
4. When an exception is not handled at code level it becomes a process level exception. It can be handled in flow like the flow given below.
 First add two interactive activities one for instance expiration and one for business exception:
Exception Handling
 Take note from the image given above. First a new instance variable called exception Holder is added of type:Any. Secondly, a business Exception is added under the currently used module of the name Exception by Right clicking on the module-> New-> Business Exception.


Right Click on any role and click Exception to then give the name of the activities you want the type of Exceptions to be handled. The business Exception from the flow above is a business exception that is thrown from Fill Product detail activity using the following code in method.

throw Product.Exception;

The exception is then catched by the Process Exception and the following properties are being entered inside the connector.

Exception Handling
 Now we reach the Exception Handling stage where inside the exception handling stage we can ask the end user how he/she wants to handle the exception. This stage can be handled using the presentation and methods. I have used the method that asks users how they want to handle the exception using the method. The choices are they want to abort(delete) the instance or they want to send the exception back to the activity where the exception occurs. The third choice is to hold the instance in the exception handling stage.


Exception Handling choices


Note: We don't always need to ask the end users for exception handling. Almost all of the exception handling can be done without user interaction. For Example in the case of Instance Expiration from the process deadline missed, this process exception can be sent back to the activity where the exception was generated by removing or extending the deadline.


 

Wednesday, November 23, 2011

Oracle BPM: Working with project variables

There are four types of variables used in Oracle BPM.
  1. Project Variable
  2. Instance Variable
  3. Local Varaible
  4. Predefined
Project variables are really important, they are designed at the time of project design as they have links in Engine and BAM database as well as the Datamart and Archive database. They are really important as they are used at time of reporting. Project variables have many advantages:
  • Project variables are defined at project level to integrate with all processes
  • Project variable are present inside the engine database
  • They are visible to end users on their workspace
  • Workspace and Database searches and sorting can be performed through project variables
  • Same project variables can be reused in different projects
  • They can be used as business indicators that can be used in BAM and Datamart
  • Project variable are accessible from all activities and processes
Project variable have a limit of 256 variables per project.

Below is the way we can add project variables to a project. I am using the same project used in previous posts:
Original Process

Now we go to the projects tab on the right side of the screen, if it is not visible go to window -> Show view -> Click on variables
Now Click + icon and a new window appears:

Project Variables
The basic information should be entered then select the business indicator.

Now for all the project variables add them as per your project
Added PVs
Once the PVs have been added then click on the icons on top titled "Map as Incoming Argument" and "Map as Outgoing Argument". These will make the incoming and outgoing arguments for all the Variables. Now Double Click on Begin activity you can see all the defined variables and assign them the variables as per project requirements as shown:

Begin Activity
These PVs can be defined in any Activity outgoing process as well. After argument mapping you can add or update all PVs through all the activities. In the workspace it looks like this:

Workspace Showing 3 Added PVs at end
Keep reading and you are free to request any view or comment.