Pages

Helpful Links

Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Friday, December 16, 2011

Oracle BPM: Working with Buttons

In oracle BPM applying different codes or methods to the buttons is not straight forward as in some other applications. Different logics can be applied in the jsp (for which I will give a complete tutorial in a few days). For now for easy understanding I am using the presentations from the studio to apply logic and decisions to the buttons code, it can also be used for form validations and requirements fulfillment, easy to understand for people with web development background.

I have seen the Oracle tutorials about buttons and they have made a mess of it. Its really simple.

Now if you look at the following project:

Workflow
The workflow shows that when the product detail is entered by the Initiator. It goes the Head of Department (HoD) for approval. The HoD can simply approve and reject it based on the content. By default there are two buttons present in the presentation called submit and Cancel. We can remove them and add our own or edit them to function as we want them to.

First of all we need to make a new method in project-> Catalog -> Module -> right click your object -> New -> Method. Name your method like "submitApproval". In the method enter your logic as


//Any Logic
submit("Approvesubmit");

Save it.

Following is the Approval Issuance form available to the HoD:

Approve Reject buttons
Please take not that Approve button is selected, you can see in the properties on the right that the Action is selected as action and Method Invoked is submitApproval() as defined earlier. Now this presentation is given to the Approve form interactive component call inside the screen-flow of the Approval activity.

Approval screenflow

As shown in the figure above. Now add the logic of  result="Approvesubmit" in the conditional transition and logics are entered going out of the screenflow. In the automatic activities we can define logics about different actions as per our project. I have made simple attribute that says approval=true.

Whenever a submit button is clicked the value inside the submit("") method is assigned to the result variable. Result is a predefined variable of type string. For example if submit("me") is given in method. The result variable is result="me".

In the screenshot below we can see a new conditional transition from Approve activity to Fill product detail activity. In the case of Rejection this flow is followed. In the condition its simply written approval !=true.




         
Modified Screenflow


Please leave a comment for every question, query and suggestion







Thursday, December 1, 2011

Oracle BPM: Using Global Activities

Global activities are an important feature of BPM used in almost every project. Global activities can be assigned to a role that is then applied to a participant (can be end user), so eventually all participants in the role can see the global activity. Global Activities are available to the user no matter what stage or role the activity is currently at. Global Activities can be used to run applications related to the project or some statistical data analysis, query the database, show any in-process or completed forms and reports and even email the users. It can also be use to delete and hold instances

Global activities can start a project instance and automatically process
  • process batch reports
  • download a set of files at a schedules time.
  • listen for an specific event in the process.
  • listen to a port.
  • check for specific events, such as a mouse-click or a broken connection error in a remote component.
  • invoke a component or application to create new process instances.
The task of a Global Interactive activity can have the following implementation types:
  • Method
  • Screen-flow
  • Show Workload
  • Show Dashboard
  • Edit Business Rules
Implementation types can be Method,Component, Screen-flow, Show Process Image, Display Instance, Variables (only if the property Use activity instance for presentation is selected) 
 
 The following is a demonstration of adding a global activity to show a form that is being completed, we have a project running. We added a new role swimlane and added a global interactive activity called ViewForm in it.


Add Global Interactive activity
We will give global activity the access in the properties as below:

Global Interactive Properties

 From the Global Interactive Main Task we select the implementation type as required in my case its screenflow with read only access.

Main Task
 
Add an interactive component call inside the screen-flow and the setting in the picture below can be used to display the form. As the screen flow is read-only no changes will be allowed on it. Its primary purpose is to be viewed by user with the role assigned at any stage of the process.

Presentation to be viewed
The following pic shows how Global Interactive Activity is visible to the end user. Under the select action -> under the Applications Heading.

Workspace showing Global Interactive Activity
Hope Global Interactive Activity is clear if there is any query or suggestion, please comment. 
I will give feedback asap

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.

Thursday, November 17, 2011

Oracle BPM: Working with Deadlines, Calendar and Holiday Rules

Working with deadlines is the core of every tracking and time related process. Deadlines are really important for a project to be completed on time and additional resources are required if a project is lacking time. Good planning always involve using deadlines. In BPM also, Deadlines are given a lot of importance, if the deadlines are not met reminders can be generated for approval, moving forward, skipping activities and generating emails to the required participants a.k.a users.

There is a small problem that most of the industry and offices work in shifts and usually have one or two days off in a week, its an irony :), so calendar rules needed to be generated so that deadlines exist and expire in working time or when most of the staff are present on their desk. In addition to calendar rules we have also got both expected and unexpected holidays for example weekends, country national days, regional holidays like Religious festivals. The need is to include these holidays into our plan so that these holidays are not hurting the deadlines.

In the discussion below I will show how to use deadlines in a simple way with the integration of holiday and calendar rules. We start by using the simplest flow of inventory approval used in earlier post.

Simple WorkFlow

Now we want to add a deadline for the approval activity so that a reminder is generated after the deadline is passed. For example an email can be sent or if no activity is done in the deadline period it is reassigned to another participant.

Deadline Added on Approval activity

Check the swim line of Head of Department role, you can see a new automatic activity has been added with a due transition. In the due connector add the time of deadline.

Inside Due transition
This is the simplest way to add deadline. The variable entry is of interval type. Now see the workspace below showing 1 day deadline. Suppose we started the instance reached Approval Activity on Nov 17, 2011 and deadline is calculated after a day that is Nov 18, 2011.

 
Workspace showing deadline

Now we are going to add calendar and holiday rules and integrate them with deadlines.

Add Holiday Rule:
  1. Go to Organization, inside your project
  2. Right click Holiday Rules 
  3. New 
  4. Name it
  5. Then a new tab opens 
  6. Click Add 
  7. Add the Holiday you want for example suppose tomorrow Nov 18, 2011 is a holiday.
Add Calendar Rule:
  1. Go to Organization, inside your project
  2. Right click Calendar Rules
  3. New 
  4. Name it
  5. Then a new tab opens
  6. Add your companies shift timings or necessary information, I have given Saturday and Sunday as Holiday. See Figure Below
  7. Add Holiday Rule made earlier into the Calendar Rule and Save it.

Add Calendar Rules

Now go to project Navigator -> Select Your project -> Your Module -> Right Click Module -> New -> BPM Object -> In the Object Make a method called set Calendar Deadlines and a variable integer for number of days.As shown in the figure below:

Calendar Rule Code
This is code inside the method for calendar deadlines. Make sure the server side method is Yes and return type is Interval, As seen in the figure above save it

//Code for Calendar Rule

calendar as CalendarRule

calendar = CalendarRule.fetch(calendarName : "CRule")
start as Time
memday as Time
start = 'now'
memday = start
newdead as Time

count as Int
count = 0
numDays=1
numDays=numDays+1

if numDays> 0 then
    while count < numDays do
        if (isHoliday(calendar, time : start) == false &&
        isWorkDate(calendar, time : start) == true) then
            count = count + 1
        end
    start = start + '1d'
    end
start = start - '1d'
end
newdead=start


deadint as Interval
deadint=newdead-'now'
return deadint


Save Project. Go back to Due Activity -> Properties and write the code below Inside Due Transition.


PDProcess.CalRulOBject.setCalDeadlines(numDays:1)

<module>.<CalendarRuleObject>.<method>(variable:value)

Now if we calculate the new deadline like Nov 18, 2011 is holiday and Nov 19 and Nov 20 are weekly offs. The new deadline will be calculated to Nov 21, 2011. As show below.

Deadline Solution
 Looking forward to any queries, suggestions and questions. Leave a comment here or E-mail me with reference to this topic.

Best Regards