Adding Custom Events
Goal: Provide a mechanism to suspend a task for a period of time, and automatically resume the task after the time period is up.
Solution: Add custom Events for task suspend and task resume, override the suspend and resume methods in a custom task instance to fire the suspend and resume events.
1) Optional - Add two new EVENTTYPEs for suspend and resume to the org.jbpm.graph.def.Event class. (not necessary however, just a convenience)
public static final String EVENTTYPE_TASK_SUSPEND = "task-suspend";
public static final String EVENTTYPE_TASK_RESUME = "task-resume";
2) Optional - Add these to the supported EventTypes in the org.jbpm.graph.def.Task class. (not necessary since jBPM determines event-types dynamically).
static final String[] supportedEventTypes = new String[]{
Event.EVENTTYPE_TASK_CREATE,
Event.EVENTTYPE_TASK_ASSIGN,
Event.EVENTTYPE_TASK_START,
Event.EVENTTYPE_TASK_END,
Event.EVENTTYPE_TASK_SUSPEND,
Event.EVENTTYPE_TASK_RESUME
2) Subclass .jbpm.graph.exe.TaskInstance
Override Suspend and Resume
public void suspend(String date) {
super.suspend();
if ( (task!=null)
&& (token!=null)
) {
ExecutionContext executionContext = new ExecutionContext(token);
// the TASK_SUSPEND event is fired
executionContext.setTaskInstance(this);
executionContext.setTask(task);
executionContext.getTaskInstance().setVariable("suspendUntilDate", date);
task.fireEvent(Event.EVENTTYPE_TASK_SUSPEND, executionContext);
}
}
public void resume() {
super.resume();
if ( (task!=null)
&& (token!=null)
) {
ExecutionContext executionContext = new ExecutionContext(token);
// the TASK_RESUME event is fired
executionContext.setTaskInstance(this);
executionContext.setTask(task);
task.fireEvent(Event.EVENTTYPE_TASK_RESUME, executionContext);
}
}
3) Configure the timer on the task
<process-definition
xmlns="urn:jbpm.org:jpdl-3.1"
name="simple">
<action name="resume" class="com.sample.action.ResumeActionHander" />
<start-state name="start">
<transition name="" to="Create Order"></transition>
</start-state>
<end-state name="end"></end-state>
<task-node name="Approve Order" create-tasks="true">
<task name="approve" description="Review order">
<assignment class="com.sample.assignment.SomeAssignmentHandler"
</assignment>
<event type='task-suspend'>
<action name="Suspend Timer" class="com.sample.action.CreateTimerActionHandler">
<action>resume</action>
</action>
</event>
<event type="task-resume">
<action name="SendMessage" class="com.sample.action.MessageActionHandler">
<message>resumed the task instance</message>
</action>
</event>
<controller class="com.sample.taskinstance.CustomTaskControllerHandler"></controller>
</task>
<transition name="" to="end"></transition>
</task-node>
...
</process-definition>
4) Implement CreateTimerActionHandler
public class CreateTimerActionHandler implements ActionHandler {
private String action;
private static final long serialVersionUID = 1L;
/** {@inheritDoc} */
public void execute(ExecutionContext executionContext) throws Exception {
Timer timer = new Timer(executionContext.getToken());
timer.setName(executionContext.getAction().getName());
TaskInstance taskInstance = executionContext.getTaskInstance();
String dueDate = (String)taskInstance.getVariable("suspendUntilDate");
// parse the due date
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.SHORT);
Date date = format.parse(dueDate);
timer.setDueDate(date);
// retrieve a named action from the process definition
Action action = executionContext.getProcessDefinition().getAction(
this.action);
timer.setAction(action);
// set the TaskInstance so the resume action knows what taskInstance to resume
timer.setTaskInstance(taskInstance);
SchedulerService schedulerService = (SchedulerService) Services
.getCurrentService(Services.SERVICENAME_SCHEDULER);
schedulerService.createTimer(timer);
}
}
5) Implement ResumeActionHandler
public class Resume implements ActionHandler {
public class ResumeActionHandler implements ActionHandler {
private static final long serialVersionUID = 1L;
public void execute(ExecutionContext executionContext) throws Exception {
System.out.println("resuming taskInstance");
TaskInstance taskInstance = executionContext.getTaskInstance();
System.out.println("TaskInstance is " + taskInstance);
CustomTaskInstance cti = (CustomTaskInstance) executionContext.getJbpmContext().getSession().load(CustomTaskInstance.class, new Long(taskInstance.getId()));
cti.resume();
}
}
Wednesday, February 18, 2009
Adding Custom Events using JBoss JBPM - JPDL
Creating "Timer" tasks in JBoss JBPM using JPDL
NOTE: This example has not been updated to work with jBPM versions 3.2 or greater.
Use-Case
Suppose you receive an order on 2006/10/05 and some related task is created on 10/7; the task needs to be done within 5 days of recieving the order. How do we do that?
jBPM's definition language, JPDL, does not provide a packaged mechanism for dynamically setting Due Dates on Timers and Tasks based on arbitrary data. However, it is not too difficult to work up a solution that brings us the flexibility we need. Here is an example that takes advantage of an ActionHandler? to set these due dates dynamically based on a process instance variable:
<?xml version="1.0" encoding="UTF-8"?>
<process-definition name="Due date Test">
<start-state name='START' >
<transition name='done' to='NODE1'/>
</start-state>
<task-node name='NODE1'>
<task name='task1'/>
<event type='node-enter' >
<create-timer name='myTimeout' duedate='2000 days' >
<script>System.out.println("I reset my timer!");</script>
</create-timer>
<!-- Dynamically set due date of the timer created in the line above.
(This ActionHandler can also be used to dynamically set a Task's due date
by substituting the <timerName> tag with a <taskName> tag) -->
<action name='setThisTimer' class='com.???.UpdateDueDateAH'>
<timerName>myTimeout</timerName>
<!-- Process instance variable containing a java.util.Date. This value will
be used as a base value for calculating the Timer's new due date. If not
provided, the current time will be used. -->
<baseTimeVar>testDate</baseTimeVar>
<!-- The 'baseTimeVar' Date can be modified by optionally adding a period of
time. The value is a valid jBPM Duration styled string -->
<addDuration>2 minutes</addDuration>
</action>
</event>
<event type='node-leave' >
<!-- To mimic the 'node context' of the short hand timer syntax <timer>, we
would need to ensure that our timer is cancelled on node exit. -->
<cancel-timer name='timeout' />
</event>
<event type='task-create'>
<!-- Use UpdateDueDateAH here to dynamically set a task's due date -->
<action name='setDueDate' class='com.???.UpdateDueDateAH'>
<taskName>task1</taskName>
<baseTimeVar>testDate</baseTimeVar>
<addDuration>5 minutes</addDuration>
</action>
</event>
<transition name='done' to='NODE2'/>
<transition name='_sys_redoNode' to='NODE1'/>
</task-node>
<state name='NODE2'>
<!-- Timers with this syntax are created on node-enter and cancelled on node-leave.
If timer creation is needed from within an event element or the timer should continue
after the node has exited, then use <create-timer> instead -->
<timer name='thisNodeOnlyTimeout' duedate='5 minutes' transition='done' />
<transition name='done' to='END'/>
</state>
<end-state name="END" />
</process-definition>
...and here is the UpdateDueDateAH? class:
/*
* UpdateDueDateAH.java
*
*
*/
package com.???;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;
import org.jbpm.taskmgmt.exe.*;
import org.jbpm.calendar.BusinessCalendar;
import org.jbpm.calendar.Duration;
import org.jbpm.svc.Services;
import org.jbpm.scheduler.SchedulerService;
import org.jbpm.db.SchedulerSession;
import org.jbpm.scheduler.exe.Timer;
import java.io.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
public class UpdateDueDateAH implements ActionHandler{
//-- variables set by process def action parameter elements --
private String baseTimeVar = null;
private String addDuration = null; //a jbpm Duration styled string
private String timerName = null; //either this OR taskName should be set
private String taskName = null; //either this OR timerName should be set
private ExecutionContext ec = null;
public Log log = LogFactory.getLog(this.getClass());
public UpdateDueDateAH() {
}
/*Execute the action handler*/
public void execute(ExecutionContext executionContext){
ec = executionContext;
try{
Token token = ec.getToken();
Date newDueDate = null;
if(timerName != null) {
SchedulerSession schedulerSession = ec.getJbpmContext().getSchedulerSession();
//apparently throws an exception if no timer is found...
List timers = schedulerSession.findTimersByName(timerName, token);
for(Object o : timers) {
Timer timer = (Timer)o;
try{
newDueDate = this.calculateDueDate();
timer.setDueDate(newDueDate);
}catch(Exception e) {
throw new Exception("Timer '" + timer.getName() + "' due date was not updated to " +
newDueDate + "': " + e);
}
schedulerSession.saveTimer(timer);
log.info("Timer '" + timer.getName() + "' due date updated to " + timer.getDueDate());
}
}else if(taskName != null) {
TaskMgmtInstance tmi = ec.getTaskMgmtInstance();
for(Object o : tmi.getTaskInstances()) {
TaskInstance task = (TaskInstance)o;
//if wildcard is specified, update all tasks...
if(taskName.equals("*")) {
try{
newDueDate = this.calculateDueDate();
task.setDueDate(newDueDate);
}catch(Exception e) {
throw new Exception("Task '" + task.getName() + "' due date was not updated to " +
newDueDate + "': " + e);
}
log.info("Task '" + task.getName() + "' due date updated to " + task.getDueDate());
}else{
if(taskName.equals(task.getName())) {
try{
newDueDate = this.calculateDueDate();
task.setDueDate(newDueDate);
}catch(Exception e) {
throw new Exception("Task '" + task.getName() + "' due date was not updated to '" +
newDueDate + "': " + e);
}
log.info("Task '" + task.getName() + "' due date updated to "+task.getDueDate());
}
}
}
}
}catch(java.lang.Exception e){
log.error(e.getMessage(), e);
}
}
private Date calculateDueDate() throws Exception {
Date dueDate = null;
Calendar cal = Calendar.getInstance();
//if a baseTime is specified, we'll use that; otherwise, we'll just use the current time
if(baseTimeVar != null && baseTimeVar.length() > 0) {
Object baseTime = ec.getContextInstance().getVariable(baseTimeVar);
if(baseTime != null) {
if(baseTime instanceof String) {
throw new Exception("Could not calculate Due Date: the variable '" + baseTimeVar + "' should be a type of java.util.Date.");
}else if(baseTime instanceof Date) {
cal.setTime((Date)baseTime);
}else{
throw new Exception("Could not calculate Due Date: baseTimeVar '" + baseTimeVar +
"' was specified but no valid date/time data was found.");
}
}else{
throw new Exception("Could not calculate Due Date: baseTimeVar was specified but no data was found.");
}
}
if(addDuration != null) {
BusinessCalendar businessCalendar = new BusinessCalendar();
Duration duration = new Duration(addDuration);
dueDate = businessCalendar.add( cal.getTime(), duration );
}
return dueDate;
}
public void setTimerName(String timerName) {
if(timerName != null && timerName.trim().length() > 0) this.timerName = timerName;
}
public void setTaskName(String taskName) {
if(taskName != null && taskName.trim().length() > 0) this.taskName = taskName;
}
public void setBaseTimeVar(String baseTimeVar) {
this.baseTimeVar = baseTimeVar;
}
/*
* Takes a jbpm Duration styled string
*/
public void setAddDuration(String addDuration) {
this.addDuration = addDuration;
}
}
Softwares used : JBoss JBPM JPDL 3.2.2, XML
Deploying JBoss JBPM Web Console(3.2.2) on Weblogic 9.2
Steps to deploy the jbpm-console on Weblogic 9.1 and Oracle 9i
Note: I didnt try this effort using latest JBoss JBPM Version,if you run into issues with new version,let me know..
1. Download the jbpm- jPDL Suite (jbpm-jpdl-3.2.1.zip) or the latest stable version jbpm-jpdl-3.2.2 from http://sourceforge.net/project/showfiles.php?group_id=70542&package_id=145174
2. Extract to C:\
3. Go to deploy folder at C:\jbpm-jpdl-3.2.2\deploy
4. Create a new Folder jbpm-console
5. Create a directory structure as,
C:\jbpm-jpdl-3.2.2\deploy\jbpm-console
\build
\dist
\src
\WebContent
\build.xml
6. The contents of build.xml are :
<project basedir="." default="create.war">
<property name="dist" value="dist" />
<target name="create.war">
<war destfile="dist/jbpm-console.war" webxml="WebContent/WEB-INF/web.xml" basedir="WebContent">
</war>
</target>
</project>
7. The contents of WebContent folder are, the directory structure is,
WebContent
\images
\META-INF
\sa
\ua
\WEB-INF
\index.jsp
Just copy the webapp contents from c:\jbpm-jpdl-3.2.2\deploy\webapp into WebContent folder
8.The contents of index.jsp file are :
<%
final String queryString = request.getQueryString();
final String contextRoot = request.getContextPath();
final String target = contextRoot + "/sa/processes.jsf";
if (queryString != null && queryString.length() > 0) {
response.sendRedirect(target + "?" + queryString);
} else {
response.sendRedirect(target);
}
%>
9. Go to WebContent folder and remove jboss-web.xml
10.Go to WebContent\WEB-INF\classes folder and edit hibernate.cfg.xml file
Add these lines ,
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@HOSTNAME:1521:SID</property>
<property name="hibernate.connection.username">USER</property>
<property name="hibernate.connection.password">PASS</property>
<!-- JDBC connection properties (end) -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
Comment these lines in hibernate.cfg.xml
<!-- DataSource properties (begin) === -->
<!-- <property name="hibernate.connection.datasource">java:/JbpmDS</property>
==== DataSource properties (end) -->
Assumption:jbpm tables already created on the Oracle 9i application schema.
<!-- identity mappings (begin) -->
<!-- <mapping resource="org/jbpm/identity/User.hbm.xml"/>
<mapping resource="org/jbpm/identity/Group.hbm.xml"/>
<mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
identity mappings (end) -->
<!-- logging properties (begin) ===
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
==== logging properties (end) -->
11. Copy the following jars from C:\jbpm-jpdl-3.2.1\server\server\jbpm\lib
to C:\jbpm-jpdl-3.2.1\deploy\jbpm-console\WebContent \WEB-INF\lib
commons-beanutils.jar
dom4j.jar
antlr-2.7.6.jar
ojdbc14.jar
hibernate3.jar
jboss-backport-concurrent.jar
commons-digester.jar
cglib.jar
jbpm-jpdl.jar
bsh.jar
jbossretro-rt.jar
commons-logging.jar
asm.jar
stax-api-1.0.jar
wstx-lgpl-2.0.6.jar
commons-collections.jarjboss-retro-1.1.0-rt.jar
cglib.jar
jbpm-jpdl.jar
bsh.jar
jbossretro-rt.jar
commons-logging.jar
asm.jar
stax-api-1.0.jar
wstx-lgpl-2.0.6.jar
commons-collections.jar
12. Edit the access.properties file in C:\jbpm-jpdl-3.2.2\deploy\jbpm-console\WebContent\WEB-INF and add the user roles the application needs, like
role.identities.user=manager,admin,user
role.identities.user.add=manager,admin,user
role.identities.user.delete=manager,admin,user
role.identities.user.modify=manager,admin,user
role.identities.group=manager,admin,user
role.identities.group.add=manager,admin,user
role.identities.group.delete=manager,admin,user
role.identities.group.modify=manager,admin,user
# Process definition operations
role.process.deploy=manager,admin,user
role.process.delete=manager,admin,user
role.process.start=manager,admin,user
# Process instance and token operations
role.execution.suspend=manager,admin,user
role.execution.edit=manager,admin,user
role.execution.delete=manager,admin,user
role.execution.end=manager,admin,user
# Task management operations
role.tasks=manager,admin,user
role.task.assign=manager,admin,user
role.task.assign.any=manager,admin,user
role.task.modify=manager,admin,user
# Job management operations
role.jobs=manager,admin,user
role.jobs.delete=manager,admin,user
13. Add weblogic.xml in C:\jbpm-jpdl-3.2.2\deploy\jbpm-console\WebContent\WEB-INF
The contents are :
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd
http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<jsp-descriptor>
<debug>true</debug>
</jsp-descriptor>
<context-root>jbpm-console</context-root>
</weblogic-web-app>
14. Edit the web.xml file C:\jbpm-jpdl-3.2.1\deploy\jbpm-console\WebContent\WEB-INF
And comment these lines
<!-- <security-constraint>
<web-resource-collection>
<web-resource-name>Secure Area</web-resource-name>
<url-pattern>/sa/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>-->
<!-- Login configuration option #1 - use the login page ==>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/ua/login.jsf</form-login-page>
<form-error-page>/ua/login.jsf?error=true</form-error-page>
</form-login-config>
</login-config>
<!== End Login configuration option #1 -->
<!-- Login configuration option #2 - use basic auth ==>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>jBPM Administration Console</realm-name>
</login-config>
<!== End Login configuration option #2 -->
And ,
<!-- This section is so that the web console can deploy in the jbpm-enterprise.ear module -->
<!-- <ejb-local-ref>
<ejb-ref-name>ejb/LocalTimerServiceBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>org.jbpm.scheduler.ejbtimer.LocalTimerServiceHome</local-home>
<local>org.jbpm.scheduler.ejbtimer.LocalTimerService</local>
<ejb-link>TimerServiceBean</ejb-link>
</ejb-local-ref> -->
15. After making all these changes, run “ant build.xml” from C:\jbpm-jpdl-3.2.2\deploy\jbpm-console at command prompt and then “ ant create.war” to create the jbpm-console.war file in “C:\jbpm-jpdl-3.2.2\deploy\jbpm-console\dist”
16. Copy this war file in C:\bea91\user_projects\domains\PRJ_DOMAIN\autodeploy and start your application server to deploy jbpm console on weblogic
17. Go to http://localhost:7001/jbpm-console
18. Softwares Needed :
Ant 1.6.5/Ant1.7 , weblogic 9.0/9.1/9.2 , jbpm-jpdl-3.2.2 suite
19.While deploying this war file on weblogic if you get any exceptions listed below, follow the solutions given below
a) javax.enterprise.deploy.spi.exceptions.InvalidModuleException: [J2EE Deployment SPI:260105]Failed to create DDBeanRoot for application, 'C:\jbpm-jpdl-3.2.1\deploy\jbpmgui.war'
use 2.3 dtd instead of 2.4 xsd
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd
http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
b) error 503 service unavailable
Set the following Environment variables:
i) JAVA_HOME = c:\bea\jdk142_08\bin;C:\bea\jrockit81sp5_142_08\bin;
ii) ANT_HOME = c:\ant\bin
iii) CLASSPATH = c:\bea\weblogic91\server\lib;C:\bea\weblogic91\server\lib\Weblogic.jar;
(You might need to set some of these CLASSPATHS after building the WAR files)
Any questions, please leave comments and suggestions are more than welcome...
Using BPM for Software Delivery-The Process
Using BPM for Software Delivery
Traditional Approach:
1. Software projects go through requirements analysis. This phase involves talking to business and get individual requirements in document fashion and then are converted into software design and implementation decisions.
2. These requirements together form complete picture.
3. In that sense it is bottom-up design approach. Which leaves a lot to interpretation when it comes to how business and IT “see” the complete picture of organizational flow of information.
BPM Approach:
1. Main way it differs from traditional approach is that, it is top-down approach. Meaning it should start with Business Analysts and/or Users creating block diagrams to describe their overall flow of information in complete manner.
2. These blocks can be as abstract or detailed as Business can provide or wants them to be.
3. Each of these blocks interact with others via various synchronous/asynchronous mechanisms there by enabling Service Oriented Architecture (SOA) in the design and foundational infrastrure of all business requirements.
4. This also will automatically make sure all the sides involved “see” EXACT same “big picture” and can agree on the same.
5. Corollary effect of that is to allow all levels to drill down , see interdependencies, and make whole organization flexible, and more responsive to changes/updates.
6. Increased ROI, Risk-mitigation, reduced cost and other benefits follow the above.
***** BPM tool is ideal for flows of information that can be depicted as individual tasks that are controlled by some business logic or rules and can in general be described as a “process”
Most, if not all business process can be described in such a manner,
***
Implementation methodology:
To achieve BPM enabled software delivery following steps should be taken.
1. Business users/Analysts will provide Block diagram describing the process in terms of individual steps, decisions and flows.
This is very much like the “flow-charts” that all are familier with. Any IDE based tool of BPM (Jboss JBPM Engine) provides an easy to use and quick to adapt designer (Eclipse based Graphical Process Designer (GPD)) that can be used for this purpose.
This tool will create a simple text (xml formatted) file. Please see attached diagram below for example of such an image.
2.These blocks are then filled with details of functionality that is represented by that block.This normally means business analyst and business users doing requirements analysis and create a simple document that will give following information.
a. Globally applicable rules for process flows.
a. – These might include details such as business units responsible and allowed to see this process.
b. What are global variables if any are there any rules or validation that apply when this process fits in bigger flow as a sub-process maybe. (for e.g. Create Employee Payroll process might be a sub-process to Hire New Employee Process and can only be run if new employee SSN is validated against legal dept’s validate SSN service”)
c. Global tasks needed which can be organization wide rules or task. (for. e.g. upon completion of each order above email may be sent to manager)
b. Each individual block should then be given detailed description with following pieces
a. What is the functionality? Describe actual task
b. Timers and notification info – Due date, (if any) escalation actions (might be emails to supervisors, automated DB updates) , Rules for sending emails on task start, completion, expiring of task due dates etc.
c. Assignment and management rules – What business roles should be able to start/complete/stop task. Is task automatically sent to some user or is there specific set of rule for doing so.
d. User Interface details – Does task have any specific screen that should be associated while performing that task.
e. Auditing information – What are the business Process measurement matrices that are needed. (for e.g. Number of Orders processed in a day? Total Orders not completed in time, How many employees have more than 10 tasks in their to-do list etc)
f. If there is existing application/code that already does a particular functionality depicted by a block it should be noted and it will be RE-USED in almost all cases.
g. After all the above are given, any other specific rules, details of tasks, out of ordinary requests etc should be noted in a separate section under each block details.
3. Block diagram and subsequent info then is sent to IT for analysis and IT will create design and solution.
a. After previous steps and input from them, IT basically has all the info needed. At this point IT will likely look for re-use, application integration of existing coded functionality, and custom coding of new or updated functionality. But even if individual step is missed or has bugs.. the “BIG PICTURE” will be exactly what business has in mind.
b. IT does not have to write code to follow business flow, BPM tools will automatically do that based on outcome of individual business steps.
c. Business performance matrices become automatically available. – For this BPM tool will integrate with outside monitoring tools as needed,
Enhancing BPM Processes Performance
Declaring BPM Processes Instance Variables as "Separated"...
From my personal experience it has been seen so far that if the BPM Processes has big Instance Variables like Value Objects,Transfer Objects, Collection Objects, they consume lot of memory for processing each single instance and BPM Engine starts throwing Severe Exceptions like "Max Instance Size has exceeded",which will hinder the progress of execution of business activity.
Below is the short synopsis related to different ways of increasing Max Instance Size in ALBPM...
Advantages:
1)Enhance BPM Processes Execution
2)Lowering the BPM Message size can affect the performance of these processes specially...
Disadvantages of Higher Message size:
Each single process instance takes that much more time to persist to BPM DB and they are stored as Binary Objects(BLOB) in DB...so it will increase the cache memory/space consumed by these processes in DB
Workaround with 32KB Instance Size:
Declare these 'big' (10k or more) instance variables (VO/TO)as 'separated'. In ALBPM,while declaring variables,there is an attribute called 'Category' and the default value is 'Normal'. If you declare an instance variable as 'Separated' the data will be stored in another database table and it's size won't count towards the process instance size and it will not affect the BPM DB Cache Memory..
Cataloging Components in ALBPM
1)When registering/creating Java Libraries as part of External Resources in BPM Studio, we have two options :Versionable and Non-versionable
If we select "Versionable",then the JARS will be included in the Project Export from Studio and when the project is published and deployed into an Enterprise Environment, then these will be stored as binaries in the BPM Directory Service..The BPM Engine and Workspace applications will be pulling them and injecting into appropriate classloader...As per the configuration for the Java Libraries in the Enterprise Process Administrator,they are just there for a reference..The binding is determined at project publication time if we use "Versionable" Java Libraries..
2)On the other hand,if we use Non-Versionable Libraries for BPM Cataloging,then manually we need to include them into Process Administrator's Classpath...Most likely, these JARS wll need to be copied into Process Administrators' WEB-INF/lib directory.... and the path is, ~/albpm5.7/j2eewl/webapps/webconsole/WEB-INF/lib and then restart the BPM Server...
Basic principle to follow before you catalog BPM components in Studio is to make sure
1 )The "External Resources" does include "Versionable" libraries before publishing/deploying the BPM project to get the latest JAR files and make them run in ALBPM Enterprise Server. Right Click -> "External Resources" -> Select "Versionable" -> then do a publish/deploy project in Studio.
2) Then complete the BPM Catalog process manually from studio
Copy the Application JARS in BPM Webconsole and Portal WEB-INF/lib folder and regenerate BPM EAR to get latest versions of these files and then execute BPM cataloging from Studio using External Resources..
Tuesday, May 13, 2008
Business Process Management- Quick look at three more products
Business Process Management ,the subject or concept which is gripping every major enterprise applications deployment now-a-days coupled with SOA/Web Services, has been part of my pedigree since more than a year now and the more I tend to learn about it, the more I feel like a naive,its such a vast concept . Many people have asked me how do you define a "Business Process Management"? and I tend to come up with different answers (not my fault...because each of the BPM solution providers have their own definition and meaning to it.
First thing first, as part of BPM initiatives so far I have been exposed to different products like Jboss JBPM(I still feel this is the best one,as far as IDE based BPM tools go,next best Intalio) , Albpm , Savvion & Intalio.
Currently Iam working on an enterprise application using ALBPM(Aqualogic BPM) from BEA as the BPM product and good thing is adopted by many leading companies and the thing which sometimes worries me about it is very little documentation and support from BEA(thats my perception) and coming from IDE background primarily for most of the development ,I feel it is behind Jboss Jbpm or Intalio because these products does support IDEs like Eclipse,which definitely makes my life easy as a Developer,Well BEA may argue with me that ALBPM Studio 6.0 has development environment similar to Eclipse or rather built on Eclipse IDE,but then Iam using ALBPM Studio 5.7 right now which doesnt come with full IDE support ...But I must say among commercial solutions this fits the bill...
And over the year,one thing which has worried me as a BPM Developer is how best I can make the Business Analysts or the business folks,understand the business processes which I have developed better,because in hindsight we expect them to be not technical savvy to really understand the workflow pattern being used nor how it has been developed since their major priority is how best this workflow/application fits their business needs .....For Example,l to overcome this situation,in one of my assignments while using Jboss Jbpm,I had to develop an EXE file or installer (something like Java Web Start)for BA and Testers,which simulates the workflow processes being developed without them having to worry about seeing it in action in a IDE ..And then as part of my curiosity and research,I realized there are different BPM solutions/products out there in IT industry that are so easy to understand ,that even non-technical folks can understand.And with this article Iam going to introduce such BPM products because most of them are browser based and not IDE based ...
Today we will be looking at 3 different BPM products that have been adopted by noted companies and how best they are serving the needs for workflow management and development.I will be giving an overview about each one of them,their features and benefits
I) Appian : Accidently I came across this product and it is definitely worth trying in any business process management effort. And when I see its customers list who have adopted Appian-Enterprise-based business process management (BPM) solution for their IT department it definitely must have some reason to it.Then I realized the advantages/benefits it brings to the table.From its legacy in the portal/knowledge-management (KM) space, Appian has built its functionality into a full blown BPM suite. In turn, it's built on a Java base following the Unified Modeling Language (UML) and the XML Process Definition Language (xPDL). (These are solid standards all, and which seem to be doing what standards should do without the interference of the European Union and Document Freedom Day groupies--. From an open source perspective, Appian comes with JBoss out of the box but of course works with WebSphere and WebLogic. It makes use of Lucene search engine as well. Not open source but Appian’s doing some real interesting stuff with KX Systems Kdb.
But the good news is that users don’t have to worry about all that technology stuff . Appian’s Form and Rules Designers and other real-user-facing components all work vis a straight Web interface (no need for Flash, plug-ins, etc.). That’s important for security requirements, which is key to many of Appian's government customers. But it is also good for ease of use for any customer. More important are the ease of Appian BPM implementation templates developed over the 10 years since it was founded. Examples are available for procurement in federal government, for wealth management with rules for credit scoring, a program with Instill to build a quality management solution for the food/service industry... I think the best place to know about Appian would be seeing its recorded webinars
Cordys BPMS is a single toolset, built from the ground up to offer comprehensive BPM and SOA capabilities, giving business managers direct control over new and existing processes.And I you see the below listed features,Iam sure everyone will be curios to use and test it for their BPM efforts.And when I see that a utility which I use frequently for my business needs "WebEx", the leading provider of Web communication services has adopted Cordys,I gave it a try.
Features & Benefits :
a)Graphical, browser-based interface
* Accurately draw executable business processes using a Visio-like application
* Bridge the gap between business and IT
* Enable business users to control and quickly change their own processes
* Consolidate and present data from disparate sources as one unified and personalized workspace for higher productivity
b)Intuitive, drag-and-drop business process execution, with virtually no coding
cDistributed, fault-tolerant, and scalable architecture
* Configure nonstop, fault-tolerant runtime environments with no single point of failure on commodity hardware
d)Real-time alerts and notifications
* Accelerate responsiveness to critical events and exceptions
e)Operational intelligence dashboard
* Obtain real-time, enterprise-wide visibility of business process performance and business metrics
f)Historical analysis
* Discover enterprise performance trends for more-informed decision making
g)Composite application framework
* Create Web 2.0 interfaces quickly by visualizing, combining, and manipulating data from disparate sources
h)Composite application developer
* Create needed business services
i)SOA Grid
* Connect incompatible systems together, allowing them to communicate
* Rapidly assemble composite objects based on a variety of previously non-interoperable backends
* Govern and manage Web services, both in design and run time
j)Data manager
* Facilitate template-based reconciliation of differences among disparate data connected to the Cordys platform
k)Secure file transfer
* Provide end-to-end document security, including legal grade non-repudiation and guaranteed integrity of transmitted data
III) Lombardi
Last but not the least is Lombardi.Best place to know about this product is its resource section
Major customer which has adopted Lombardi's Teamworks BPM software is Wells Fargo Financial.
I hope some of the organizations start looking at adopting at either one of these for their BPM implementations,considering how easy they can be understood and used by workflow developers,business folks and Business Analysts.
Saturday, January 5, 2008
Business Process Management - Things to watch out for in 2008
Business Process Management
"Comparison between different BPM products and choose one which suits best to your enterprise needs"
First I would like to start describing the core meaning what BPM stands for and what makes it one of the things to watch out for in enterprise applications.
Business Process Management (BPM) has become one of the most important enterprise software market segments as evidenced by recent industry analyst reports, as well as a growing number of companies claiming to offer BPM software. Like the rush by a broad range of software vendors to re-brand their products as ‘CRM solutions’ when the acronym first came on the scene, the same has quickly occurred with BPM and, as was the case with CRM, the products offered by the vendors vary dramatically in capability and functionality.
What is a Business Process Management platform?
First let’s define the core element, a business process. A business process is an aggregation of operations performed by people and software systems containing the information used in the process, along with the applicable business rules.
Execution of Business Processes
The execution of a business process achieves a business objective. The people and systems may be inside the boundaries of a company, but often times are in multiple enterprises needing to collaborate to achieve their business objectives. These processes also include business rules that may be documented policies and procedures, as well as the undocumented ‘how we really do things’ rules that exist in most enterprises.
A comprehensive Business Process Management platform provides an organization with the ability to collectively define their business processes, deploy those processes as applications accessible via the Web that are integrated with their existing software systems, and then provide managers with the visibility to monitor, analyze, control and improve the execution of those processes in real time. To be a comprehensive BPM platform a system must not only automate processes, it must:
* Integrate with existing operational systems such as ERP and databases
* Integrate business processes with those of a company’s suppliers and partners
* Incorporate the business rules that guide a business
* Provide managers with the visibility into those automated processes
to monitor operations in real time
* Offer managers the ability to deal with exceptions when they occur by changing business rules or entire processes to respond to business conditions in real time
BPM Versus EAI
Many products on the market today purporting to be Business Process Management systems provide only basic process automation or workflow capabilities that route tasks between systems or people. There is a great deal more involved in critical business processes. And there is a significant gap in the capabilities of a basic EAI or workflow system
If you were to consider an enterprise as an interconnected set of layers with the very top being the business strategy layer and the bottom the IT infrastructure layer you would begin to see how very different BPM is from EAI, Application Server and Workflow systems. The terms that make up the acronyms BPM, Business, Process and Management and EAI Enterprise Application Integration give a good indication for where they fit into the enterprise ‘stack’. BPM provides an organization with the ability to define at a business strategy level its processes, then automate those processes in a controlled application to execute on that strategy and finally to provide business managers with the visibility to monitor and analyze the operation of those processes to improve their operation and to resolve business problems when they occur. EAI, on the other hand is a ‘middleware’ technology that provides the ‘plumbing’ to route data between applications (application integration). EAI operates at the technology layer of a business and is a set of programming tools used by an IT organization to reduce the amount of custom software that would otherwise need to be written. BPM addresses business issues and EAI addresses IT issues. As the top layer in the stack, BPM serves as the critical business productivity layer linked to the software systems, applications, middleware, databases, messaging technologies and the IT resources of large scaled business enterprises to execute those processes. Some applications such as ERP systems incorporate the middleware and databases in one layer. Others, like new Supply Chain Management (SCM) products, exist at the application layer and run on top of application servers and EAI/B2Bi services.
It is very important for a BPM platform to allow processes that span multiple enterprises and use multiple existing software systems, to be defined quickly and to be deployed rapidly. Otherwise, a BPM platform provides little value to no value as a business automation and management platform. Business is in a constant state of change, driven by internal and external activities and a business process management system must be able to respond to these changes.
What of Overlapping Systems?
When looking at product offerings claiming to offer BPM capabilities, it is important to recognize that these products were developed to address specific problems, such as routing documents and tasks between office workers, in the case of Workflow, and coordinating the flow of information between legacy systems, in the case of EAI technology.
Workflow Systems
Basic Workflow products overlap with BPM systems as they address one element of BPM, providing for the definition and flow of operations performed by people. Workflow systems:
* Are designed for groupware and human collaboration applications.
* Do not integrate operations to be performed by software systems.
* Typically are based on client-server architectures
(rather than Web-based thin client architectures)
* Limit operations to those performed inside the enterprise.
* Do not allow business rules to be aggregated with business operations.
As Workflow companies move to extend their systems to address the above deficiencies, it invariably means grafting new technologies on old architectures or entirely redeveloping their products, both expensive and problematic processes.
Existing workflow products, in addition to having client-server architectures, rather than Web architecture, have been implemented in C or at best in C++ languages rather than in Java. They represent processes in proprietary notations rather than in XML. They do not have rule and integration engines, which are essential components of a top down business productivity BPM platform.
EAI/B2Bi Systems
Existing EAI/B2Bi products overlap with BPM systems as they provide for the flow of operations performed by systems to be defined and executed. This is in effect facilitating the flow of information between integrated applications. EAI/B2Bi systems:
* Have been designed to integrate applications that execute related
business transactions
* Typically do not allow operations to be performed by people
* Are technical, low-level systems requiring extensive IT expertise to deploy
* Are tied to an integration server and cannot be used without it
* Provide no business management capability, as their purpose is automation.
As with workflow systems, EAI/B2Bi companies are also looking to extend their systems to address the above deficiencies with the same negative impact. Adding Workflow to an EAI/B2Bi system facilitates information routing process, but does nothing to address the underlying business process and business management problems enterprises face. It is important to recognize that a process to an EAI system is typically measured in sub-seconds and their architectures are designed to meet that goal. Business processes when viewed from the business level, often take days if not months to complete (product life cycle) involving hundreds of different steps and exceptions, necessitating a systems architecture designed to manage the workload.
Different BPM Solutions
Here I would like to present the pros and cons of different BPM solutions available in market now.
A) BEA Aqualogic BPM -
I did get an opportunity to use this product while working in one of my projects and what I like most about this product coming from BEA it does seamlessly integrates with your BEA development environment and the support and articles given by BEA extremely useful while implementing your application.And you do need BPM Designer and BPM studio to complete the product stack you need to develop business processes.
The main features of Aqualogic BPM are ,
BEA AquaLogic BPM directly leverages this infrastructure by enabling the orchestration of services deployed in the service network, and by allowing people to interact with those services through managed work processes. The benefits of SOA become very clear to business users when they can design work processes that directly interact with business services provided by the underlying service network. BEA AquaLogic BPM also integrates directly with BEA AquaLogic User Interaction, a portal and Web experience framework, provide a richer user experience for process users. This integration also delivers a powerful combination of Business Process Management and human collaboration tools that supports the wider balance of structured and unstructured work patterns.
BEA AquaLogic BPM is also well-suited for deployments that do not yet involve a service infrastructure. Enterprises often enjoy the benefits of Business Process Management without first service-enabling their existing systems simply by using a common system for modeling and documenting work processes and activities, and also by using the underlying system connectivity capabilities within the product. BEA AquaLogic BPM supports non-SOA environments using powerful introspection technology that makes it easy to connect processes to a wide variety of proprietary IT systems, including IBM, TIBCO, Oracle and SAP, using simple wizard-style interfaces.
BEA AquaLogic® BPM Designer is the business analyst's design environment. It enables the creation of any type of process by simply dragging and dropping process elements onto swim-lanes.
BEA AquaLogic BPM Studio supports multiple programming languages using a "skin" approach. The developer can seamlessly switch between .NET and Java at any time for both existing and new code. BEA AquaLogic BPM Studio provides a unique wizard driven tool to connect to external systems. The tool supports a variety of interface standards, including Java, .NET, EJB, JNDI, Web Service, XML, CORBA, COM, SQL, UDDIv3 and more. Finally, developers can easily assemble the user interfaces required for process participants. No Web design or coding is necessary. BEA AquaLogic BPM Studio automatically generates the necessary Web components based on the interaction and message formats specified in the process
B)IBM Websphere BPM Suite
IBM's new BPM suite based on Websphere Business Modeler,Business Monitor and Process Server Version 6 brings all of these functional elements together in a common service-oriented framework.The architecture provides a common orchestration engine,common data respresentation,common invocation model and common design environment for all aspects of business integration solutions.
Websphere Process Server and ita associated design tools are aimed broadly at SOA developers building composite applications on Websphere.
The Websphere BPM suite has four primary components :
Websphere Business Modeler v6 , provides analytical modeling of process flow, resources,costs,data and performance management,simulation of process scenarios and Business Measures Editor , which defines key performance indicators.
Websphere Integration Developer v6 provides executable process modeling through service-oriented assembly. It imports BPEL and business objects from Websphere Business Modeler and deploys executable models to the Process Server runtime environment.
Websphere Process Server it is layered on WAS and its SOA core services include Service Component Architecture ,business objects and the Common Event Infrastructure used for process monitoring.In BPMS solutions, Process Server provides the BPEL orchestration engine,business rule engine and component execution environment as well as Websphere ESB and last in the product hierarchy is Websphere Business Monitor is the performance management runtime component.Using metrics defined in modeler ,both real-time and historical analytics can be displayed in dashboards and charts.Websphere Business Monitor runs as Portlets in IBM Websphere Portal.
C) Jboss JBPM
I used this in one of my most recent projects and I must say, this is the most easy to use BPM product,though a lot more support and tutorials would have been useful for SOA developers.I did used it to create different process definitions and business process workflows as well as a process definition which initiates a Timer in background for a running batch job process and intimates the supervisor and developer responsible for that business process execution.
JBoss jBPM provides a process-oriented programming model (jPDL) that blends the best of both Java and declarative programming techniques.
JBoss jBPM, like all JBoss Enterprise Frameworks, is modular. It runs with JBoss Enterprise Middleware or any other Java EE middleware platform and plus its Open Source and if one reads the JIRA issues associated with this solution,you may get to see the progress made by jbpm everyday.
Watch here a demo of Jboss JBPM
D)Other BPMS products worth having a look at,
Intalio ,Open source and Savvion and here you see the demo of this product,Savvion
And I do believe expertise in either of these BPM solutions, will further enhance a J2EE Developer caliber and ofcourse gets you a challenging assignment to work on and your profile will be in demand.










digg
reddit
del.icio.us
