Pages

Helpful Links

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



Thursday, November 10, 2011

Oracle BPM: Send Email to End Users

End user communication is really important for any project. In oracle bpm there is no direct way to send emails to End Users. It can be easily done from any automatic activity. We are gonna use the scenario below. The Email will be sent from initiator to the head of Department with the details of the issuance criteria.

Workflow
Now add an automatic activity below:

Automatic Activity
An Email will be sent whenever an instance passes this automatic activity. This activity is given Add the code below in the automatic activity as it requires some customization with regards to your own project. Notice that HTML syntax are being used. You can use all HTML syntax's to improve the style of your emails.


//Email Code Starts here

mydate as Time
dateString as String

mydate = 'now'
dateString = format(mydate, mask : "dd-MMM-yyyy")
reminderEmail as Mail
reminderEmail = Mail()
cc as String[]
bcc as String[]
bb as String[]
reminderEmail.from = "bpmadmin@example.com"
reminderEmail.recipient = "<target recipient>" + "<target recipient>"

bcc[] = "Administrator@example.com"
reminderEmail.subject = "Activity submitted at your end" + instance_variable.number
reminderEmail.contentType = "text/html;charset=UTF-8"
reminderEmail.message = "Dear User," +

"\nA new work has been submitted for your approval\n" +
"\n Product: " + instance_variable.product +
"\n qty: " + instance_variable.qty +
"\n type "+ instance_variable.type +
"\n Approval Deadline is: " + dateValue(Approval_Deadline) +
"Regards \n Administrator"
reminderEmail.cc = cc
reminderEmail.bcc = bcc
sender as MailSender
sender = MailSender(mail : reminderEmail)

send sender

After using this code you should be able to send E-mails to many participants.

One more thing, You have to add smtp settings. 

In studio:
  1. Go to project Navigator
  2. Right Click your project
  3.  Select Engine Preferences
  4. Select Engine -> General Tab
  5. In networking panel, give smtp server, port and admin Email.  
  6. Save your project 

In Enterprise Standalone:

  1. Go to Process Administrator
  2. Select Engines
  3. Click on your Engine
  4. Go to networking tab and enter your settings
  5. It requires smtp server, port, Admin Email, URL (The URL for End Users)
  6. Click Save and Apply

Friday, November 4, 2011

Oracle BPM: How to add external Resources (Databses) in Presentations

Hello Everyone!!!!!!!!

One of the most important task of using BPM is getting data from different sources, databases and different type of webservices into your project. This is like a tutorial to importing databases into your bpm project. For this example I will be using the simple WorkFlow below:

Work Flow
In this workflow the initiator select the item to issue and Head of Department Approves it and issuer checks it. As the inventory is another system we only need to get the list of available products for approval and issuance through BPM.


First go to project Navigator and select your project. Then right click on external resources and select "new external resource". A new window opens up. Give the name of your external resource and Type as "SQL Database". Select the type of external resource you are using not necessarily SQL; it can be a SAP service, a webservice or Java service depending on your needs, just browse through the list find the appropriate. If you have select the SQL database then a new field opens up called "Supported Types". In this LOV we select the DB we are using or its driver.

Add External Resource
Add Host name or ip address of DB server. Port by default is 1521 or your customized, user or schema name, its pass and schema name. You can also check the Advanced settings. Then go to tablespaces tabs and give the name of tablespace; As shown below:


Now import the external database to your module by Catalog --> Your module, then right click your module select catalog component and select SQL or the external resource you added. Then a new window appears that shows all the SQL resources you added select it then press next. Now it will show you all the Tables present in your schema select the tables you want to import and press next.It now appears as the picture on the Left.
When this external resource is added it will appear under external resource. Now go to  Catalog --> Your module --> Your BPM Object --> Double click the attribute you want to get an LOV. Go to valid Values and select Dynamic method. Click new under "method or values....."
Dynamic LOV Attribute

Name your new method and then write the query like the one below:    Do remember to select Server Side Method to "Yes".

Query to get LOV

After the successful query Your results in the form will look like this:

Presentation

If you have any query or question leave a comment and i will get back asap.

Saturday, October 29, 2011

Oracle BPM: Disaster Recovery (Using Enterprise Standalone Recovery)

The last post was about the recovery of BPM if the Enterprise server crashes and it has to be reinstalled on the same machine. The following steps can be followed to install and connect new Enterprise server with the existing database. 
  1.      In the Admin Centre of the Enterprise go to configuration (do not start it). In the Configuration option press add button. 
  2.    A new window opens up. Check the Use existing Directory Service radio button. Uncheck the Create Process Engine checkbox.
  3.  Press next. Select Use a database managed by Oracle BPM 
  4.  Press next. Enter the directory Configuration name, its description, Directory provider, BPM Admin user and pass. 
  5.  Press next. Enter the host database (IP address or its name).Port by default is 1521 for Directory provider: Oracle BPM Driver version 10, 11. Enter user, pass and SID for the username you gave to your schemas. 
  6.  This username and pass should be the BPM directory database (DIR). 
  7.  Press next. Save template. Finish 
  8.  Close the window. 
  9.  Press Start BPM WEB Application from the admin center. 
  10.  When it is started. Launch Process Administrator. Check engines, projects, OU, BAM, External Resources, Variable, and External Processes all are working fine.

Starting/Stopping Engine nodes

Process Execution Engine nodes can be started/stopped using Process Administrator.
  1. Login to Process Administrator
  2. Click Engines. The list of available Process Execution Engines appears.
  3. Select the Basic Configuration tab
  4. Click Engine Nodes.
  5. In the Engine Actions column select one of the following:
    • Click play button to start the Engine node.
    • Click stop button to stop a running Engine node.
Based on the action you selected, the Process Execution Engine node is started or stopped. If there are problems, click log icon to view the start up log.
Additionally, you can view the engine log file located at: <ORABPM_HOME>/log/<engineName> on that host's node.



Oracle BPM: Disaster Recovery (Using DATABASE)

Last Post was about back ups, now i will show you how to perform disaster recovery using it.

Recovery using Database:


Follow the following steps if you want to change the database or if the database crashes and you want to start the BPM in a different database.

1.       Make new schemas of the same names as in the previous database. From your exported database of BPM users use them to recover it in a new location

d
2.       Import the schema users into the new (empty) schema that has been taken as backup, using the following script
<Your Location>D:\oracle\product\10.2.0\db_1\BIN\imp userid=system/<password> file=D:\Backup\<Restore_File_Name.dmp> SHOW=n IGNORE=n CONSTRAINTS=y FROMUSER=(ENGINE,BAM,DM,DIR,ARCHIVE,EXTDB) TOUSER=( ENGINE,BAM,DIR,DM,ARCHIVE,EXTDB) log=D:\Backup\ Restore_File_Name.log

 
Follow the steps below:
 1.       Make sure to check the log that all the tables of all the schemas have been imported and no errors have been found. 
2.       Install the BPM Enterprise server on the machine, if it doesn’t already exist. 
3.       In the Admin Centre of the Enterprise go to configuration (do not start it). In the Configuration option press add button. 
4.       A new window opens up. Check the Use existing Directory Service radio button. Uncheck the Create Process Engine checkbox. 

5.       Press next. Select Use a database managed by Oracle BPM 

6.       Press next. Enter the directory Configuration name, its description, Directory provider, BPM Admin user and pass. 

7.       Press next. Enter the host database (IP address or its name).Port by default is 1521 for Directory provider: Oracle BPM Driver version 10,11. Enter user, pass and SID for the username you gave to your schemas. 

8.       This username and pass should be the BPM directory database (DIR). 
9.       Press next. Save template. Finish 
10.   Close the window. 
11.   Press Start BPM WEB Application from the admin center. 
12.   When it is started. Launch Process Administrator. Check engines, projects, OU, BAM, External Resources, Variable, and External Processes all are working fine. 
13.   Launch Workspace in the Admin center. If it does not open then go to Process Administrator -> Engines-> Select your Engine -> networking tab -> Workspace URL. Change this workspace URL to the current machine or the URL that is required.
14.  Change the logs locations as required


Oracle BPM Backups: Databases and Files

I found that the most important topic for the BPM developers, Architects and DBAs is Disaster Recovery specially in production environments. Many of the BPM projects are tracking and live systems which are updated round the clock. So it becomes a headache if the system crashes or is unavailable to the users. This post will show how to avoid the problem and then use the data from the database and move it to a new location is the application server crashes booth in the case of weblogic server or standalone.

Before starting disaster recovery we should have the backup of the following databases and


Few of the ways are given in the link below by oracle administration guide:


Take the back up of the following files whenever you make configuration changes or periodically.

Oracle BPM Files for backup

File Type Description Location
Configuration Files $INST_DIR/enterprise/conf
Non-versionable JAR Files Java libraries that are not part of a project file.
  • INSTALL_DIR/webapps/webconsole/WEB-INF/lib
  • INSTALL_DIR/ext
  • INSTALL_DIR/webapps/portal/WEB-INF/lib
Properties Files ../directory.properties
Web Applications Customized application files, including CSS files, custom JSPs, and image files.
WorkSpace Custom JSP used by WorkSpace $INST_DIR/webapps/portal/WEB-INF/portal.properties
WorkSpace Administrator Workspace Administrator properties file $INST_DIR/webapps/portaladmin/WEB-INF/portaladmin.properties
Archive Viewer Property and configuration files for the Archive Viewer application.
  • $INST_DIR/webapps/archivingviewer/WEB-INF/archiving.properties
  • $INST_DIR/webapps/archivingviewer/WEB-INF/configDrivers.xml