Skip navigation

Here is an exmple that shows how to deploy 'HelloProcess' exmaple (http://community.jboss.org/people/bpmn2user/blog/2011/02/27/helloprocess-example-using-jbpm5-eclipse-plug-in) using JBPM5 console.

 

How to install and run this example in an appserver (e.g. JBoss or Tomcat)?

 

 

 

1.) This example has one ftl file (HelloTask.ftl) for the human task following the pattern {TaskName}.ftl

 

2.) Create the image of the bpmn file using 'Export image (PNG)' option.

ScreenHunter_11 Feb. 27 17.31.gif

3.) Create a jar, e.g, 'HelloProcess.jar' file for all the artifacts (HelloProcess.ftl, Hello.ftl and Hello.png).

Alternately these artifacts can also be debloyed in Guvnor as shown in

(http://people.redhat.com/kverlaen/jBPM5-guvnor-integration.swf)

 

4.) Copy the HelloProcess.jar to server's CLASSPATH. For example, it can be one of the options as shown below:

 

Copy the jar file into gwt-console-server war file  ( ..gwt-console-server\WEB-INF\lib)

or Copy the jar file into appserver's lib direcory (JBOSS_HOME\server\default\lib for JBOSS or TOMCAT_HOME\lib for TOMCAT)

 

 

5.) Copy the HelloProcess.bpmn file  to the directory where the other bpmn files are located

(specified using the parameter -Djbpm.console.directory).

 

6.) Start the appserver and login to http://localhttp://localhttp://localhttp://localhost:8080/jbpm-console

(krisv/krisv)

You can see the process after starting it.

ScreenHunter_12 Feb. 27 17.36.gif

ScreenHunter_13 Feb. 27 17.36.gif

 

You can click on the 'Personal Tasks' and approve this task.

 

ScreenHunter_14 Feb. 27 17.36.gif

Here is an example that shows the required steps to create a HelloWorld example with jBPM5 plug-in in Eclipse.

First install jBPM5 plugin using the steps (http://community.jboss.org/people/bpmn2user/blog/2011/02/27/eclipse-plug-in-installation-for-jbpm5) or using the install script  (http://kverlaen.blogspot.com/2011/01/jbpm-50-released.html).

 

 

A simple example (http://people.redhat.com/kverlaen/jBPM5-guvnor-integration.swf) is considered here to show the features of jBPM5 eclipse plug-in.

'Hello Task' is created as follows. Attached files (HelloProcess.bpmn, HelloTask.ftl and Hello.ftl) can be imported into the HelloProcess project created in http://community.jboss.org/people/bpmn2user/blog/2011/02/27/eclipse-plug-in-installation-for-jbpm5.

 

 

 

ScreenHunter_06 Feb. 27 13.24.gif

 

The user form for the task 'HelloTask' is created using the pattern {TaskName}.ftl as shown below.

ScreenHunter_07 Feb. 27 13.24.gif

 

The 'HelloProcessTest.java' is created to read the 'HelloProcess.bpmn' file as shown below (also find the complete file as an attachement below):

 

 

 

public class HelloProcessTest {

 

 

 

public static final void main(String[] args) {
  try {

 

 

EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
         TaskService taskService  = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
        
         /*
          * Add the required users
          */
         TaskServiceSession taskSession = taskService.createSession();  
         taskSession.addUser(new User("Administrator"));
         taskSession.addUser(new User("krisv"));
        
         /* Start Mina server for HT*/
         MinaTaskServer server = new MinaTaskServer(taskService);
         Thread thread = new Thread(server);
         thread.start();
         System.out.println("Server started ...");
       
         /*Create the knowledge base for HelloProcss.bpmn */
         KnowledgeBase kbase = readKnowledgeBase();
   StatefulKnowledgeSession ksession = createSession(kbase);
   KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
  
   ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

 

  
   System.out.println(" started the humantask");
   ksession.startProcess("Hello");

logger.close();

 

}

 

 

Select the 'Human Task View' using Window->ShowView->Drools Task->Human Task View. Start the program 'HelloProcessTest.java' and look for  the tasks using the userID 'krisv'. 'Hello Task' can then be selected to perform tasks such as 'Start', 'Complete' etc.

ScreenHunter_08 Feb. 27 14.50.gif

Here are the manual steps to install jBPM5 plug-in and run a sample example in Eclipse.This install is done automatically after running jBPM5 installer (http://kverlaen.blogspot.com/2011/06/jbpm-510-released.html). Following procedure, however, might be useful if you want to understand (or having problems completing the install) the main install steps provided in the automated install script for JBPM5.2. The install instructions for the previous release 5.1 can also be found in the attachment jbpm5.1install.zip.

 

1.) Download Eclipse Helios:

http://download.eclipse.org/technology/epp/downloads/release/helios/SR2/eclipse-java-helios-SR2-win32.zip

 

Unzip this into a directory, say JBPM5

 

2.) Download Drools and JBPM5 plugin, i.e., org.drools.updatesite-5.3.1.Final-assembly.zip:

https://repository.jboss.org/nexus/content/repositories/releases/org/drools/org.drools.updatesite/5.3.1.Final/org.drools.updatesite-5.3.1.Final-assembly.zip

 

 

Unzip this plugin to a temp directory, say TEMP\drools-update-site. Copy 'features' and 'plugins' directories from TEMP\drools-update-site into

JBPM5\eclipse

 

It is required to have a runtime dependant libraries that a jBPM5 sample can use.

 

3.) Download the libraries (jbpm-5.2.0.Final-bin.zip ) from http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.2.0.Final/jbpm-5.2.0.Final-bin.zip/download and unzip into a directory, say JBPM5\runtime.

 

4.) Create a new jBPM sample project in Eclipse and use the runtime libraries downloaded in Step 4.

 

ScreenHunter_05 Feb. 27 09.42.gif

 

 

ScreenHunter_01 Feb. 27 09.19.gif

ScreenHunter_02 Feb. 27 09.19.gif

EclipseInstallSimpleHelloWorld.PNG

 

Select 'Configure Workspace Setting' link below and set it to 'JBPM5\runtime' directory created in Step4.

 

SimpleHelloWorldRuntimeSetting.PNG

RunSimpleHelloWorld.PNG

 

Update for the version 5.4:

 

Following two links can be used in Steps 2 and 3 for  JBPM 5.4 plugin and the runtime libraries.

 

jBPM Plugin: http://download.jboss.org/drools/release/5.5.0.Final/droolsjbpm-tools-distribution-5.5.0.Final.zip

jbpm-5.4.0.Final-bin.zip : jbpm-5.2.0.Final-bin.ziphttp://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.4.0.Final/jbpm-5.4.0.Final-bin.zip/download