Thursday, June 28, 2007

Improve your Company using Workflow System

Work flow,
Business Process Management,
Business Process Modeling,
Methodologies,
Work Procedures

All these related words can come together to build and understandable vision of the workflow system.

The Business Process is a group of logically related tasks that come together to form a methodology to implement work procedures.
And companies try to automate these procedures using a workflow system to gain its benefits.

You can find more about workflow here.

So why do we need workflow system?
Some of the benefits we can get by using workflow can be briefed by the following

  • Improved efficiency - automation of many business processes results in the elimination of many unnecessary steps
  • Better process control - improved management of business processes achieved through standardizing working methods and the availability of audit trails
  • Improved customer service – consistency in the processes leads to greater predictability in levels of response to customers
  • Flexibility – software control over processes enables their re-design in line with changing business needs
  • Business process improvement - focus on business processes leads to their streamlining and simplification

How to implement a workflow system for our company?

Well, Thanks god we didn't have to pay for a license to build a system using Microsoft workflow foundation.

We have JBPM (Java Business process management) which is a flexible, extensible workflow management system build on Java and it is an Open source project.

A lot of projects built on the JBPM engine are developed like (Open Business Engine The Open for Business Workflow Engine OpenWFE WfMOpen XFlow Micro-Flow JFlower YAWL Zebra Apache Agila Antflow Beexee Dalma Swish etc...)

I believe that RunaWFE is one of the best.

RUNA WFE is an environment for JBoss jBPM workflow engine.
It is a cross-platform end user solution for business process development and execution.

Together RUNA WFE and JBoss jBPM provide an easy to use business process management system.

RUNA WFE provides:

  • an end user GUI to define business processes without any coding: draw flowcharts, define roles and variables, lay out forms
  • an end user GUI to load and execute processes
  • an administrative interface to create and remove users/groups and grant rights
  • a possibility of writing automatic "bots" that can participate in business processes
  • a possibility to code new GUI elements, variable types, organizational structure functions etc. that extend existing RUNA WFE components and will be available to end users through the GUI

Then How to integrate our workflow system with other software?

Integrating RunaWFE with MySQL Database:

Simply, do the following steps:

  1. Add The File mysqldb-ds.xml to your jboss deploy folder "server\default\deploy".
  1. In server\default\conf\hibernate.cfg.xml Change

connection.datasource = java:/MYSQLDS
Dialect = net.sf.hibernate.dialect.MySQLDialect

  1. Important Note : Don't forget to add "com.mysql.jdbc.Driver" to your library This is done by adding "mysql-connector-java-3.1.14.jar" to the lib Folder.

Integrating RunaWFE with LDAP:

Unfortunately integrating RunaWFE with LDAP can be done to a certain level,

In any workflow system you have to define your users, their groups and also their permissions and Roles.

So you can authenticate through LDAP but you still has to add your ldap users in your workflow system so you can define their groups and Roles.

So what we will do now is to authenticate using our LDAP and also import our LDAP users into RunaWFE to manage their groups, Permissions and Roles.

Fortunately RunaWFE helps us in doing both the importing and the authentication.

To Add LDAP Authentication To RunaWFE Do the Following:

  1. Add the LDAPPasswordLoginModule to src\af\logic\ru\runa\af\authentication
public boolean login() throws LoginException {  

SERVER_URL= LDAPImporterResources.getServerURL();

if (callbackHandler == null)

throw new LoginException("No CallbackHandler provided.");

Callback[] callbacks = new Callback[2];

callbacks[0] = new NameCallback("actor name: ");

callbacks[1] = new PasswordCallback("password: ", false);

ExecutorDAO executorDAO = null;

try {

callbackHandler.handle(callbacks);

String actorName = ((NameCallback) callbacks[0]).getName();

if (actorName == null)

throw new LoginException("No actor name was provided.");

char[] tmpPasswordChars = ((PasswordCallback) callbacks[1]).getPassword();

if ((tmpPasswordChars == null) || (tmpPasswordChars.length == 0))

throw new LoginException("No password was provided.");

String password = new String(tmpPasswordChars);

env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sun.jndi.ldap.LdapCtxFactory");

env.put(Context.PROVIDER_URL, SERVER_URL);

env.put(Context.SECURITY_AUTHENTICATION, "simple");

env.put(Context.SECURITY_PRINCIPAL, "uid="+ actorName +

",ou=people,"+ LDAPImporterResources.getDC());

env.put(Context.SECURITY_CREDENTIALS, password);

DirContext ctx = new InitialDirContext(env);

ctx.close();

executorDAO = DAOFactory.getInstance().createExecutorDAO();

actor = executorDAO.getActorCaseInsensitive(actorName);

succeeded = true;

return succeeded;

} catch (IOException e) {

throw new LoginException(e.toString());

} catch (UnsupportedCallbackException e) {

throw new LoginException(e.getMessage());

} catch (NamingException e) {

throw new LoginException(e.getMessage());

} catch (InternalApplicationException e) {

throw new LoginException(e.getMessage());

} catch (ExecutorOutOfDateException e) {

throw new LoginException(e.getMessage());

} catch (RuntimeException e) {

throw new LoginException(e.getMessage());

} finally {

try {

DAOHelper.close(executorDAO, true);

} catch (InternalApplicationException e) {

throw new LoginException(e.getMessage());

}

}

}

  1. Modify the LDAP importer Configuration File ldap-importer.properties in server/conf to point to your LDAP server.
  2. Change login-module.properties in server/conf to the LDAPPasswordLoginModule.

#ru.runa.af.authenticaion.NTLMLoginModule=SUFFICIENT
#ru.runa.af.authenticaion.InternalDBPasswordLoginModule=SUFFICIENT
#ru.runa.af.authenticaion.ADPasswordLoginModule=SUFFICIENT
#ru.runa.af.authenticaion.KerberosLoginModule=SUFFICIENT
ru.runa.af.authenticaion.LDAPPasswordLoginModule
=SUFFICIENT

  1. You have to modify some constant variable in class LDAPImporter to accommodate with your LDAP settings.
private static final String OBJECT_CLASS_ATTR_USER_VALUE = "user";
private static final String DISPLAY_NAME = "name";
  1. Run the LDAP importer Tool which will import your users to the ldap users group in the Executors list of Runa.
  2. If you changed the Administrator login password don't forget to change it in the LDAPimporter script.

Finally to create your own processes you can use the Graphical Process Designer which helps design your processes in a very simple way.

Enjoy your Automated Workflow System and your process improvement.