JBoss Community

Currently Being Moderated

GWT-Console-JBPM

VERSION 18

Created on: Oct 29, 2008 5:30 PM by Heiko Braun - Last Modified:  Jun 29, 2009 7:49 AM by Heiko Braun

Project information

 

 

Related projects

 

Overview

console_sample.png

The client side uses GWT and additionally relies on GWT-Ext. There is an intermediary facade build on RESTeasy (JSR311) which uses Json encoding. The console server itself is decoupled from concrete jBPM implementations through an integration layer,

which needs to be implemented by managed runtimes. The following picture shows a high level overview:

 

gwt-console-arch.jpg

GWT Application

The client side use GWT 1.5 and currently relies on the GWT-Ext extensions. Recent discussions show that it's quiet likely that we are going to move away from GWT-Ext due to a change in their license model, but for now it enables us to get things done quickly. The client application shares a domain model (DTO) with the REST facade and json encoded data for the backend integration.

Console Server

The server is build on RESTeasy, a JSR 311 implementation. It allows for rapid publishing of REST resources and has out of the box support for "application/json" and "text/xml" marshalling. Support for specific content types can easily be extended, which can become important when extending the BI/BAM capabilities (think PDF or Image generation). REST was chosen over GTW RPC for several reasons:

  • Decoupling of client and server (See "Testing the GWT console")
  • Extendable content types
  • Support for non  GWT clients, i.e. the eclipse tooling
  • Simplified development model (i.e curl)

Integration Layer

The integration layer decouples the console server from the managed BPM runtime. Both the GWT application and the intermediary layer share a domain model which needs to be adopted by concrete BPM implementations. Differences between jBPM3 and jBPM4 will be tackled at this level.

Project structure

If you take a look at the maven build structure, you'll find  the modules: RPC,Server and WAR.

  • RPC: Shared domain model between the GWT app and the console server
  • Server: The REST facade plus integration layer
  • WAR: The GWT application itself and test suite

 

The server and war modules create distinct web applications which can be deployed separately. This allows you to deploy the REST facade on  a running JBoss AS instance, while still developing in GWT hosted mode. The test suite  does rely on this mechanism as well. It's necessary, because the DAOFactory implementation usually require server resources like EJB's, Datasources, etc.

 

 

NOTE: The server module needs to be deployed on a running jboss instance, along with jbpm.
The easiest way is using the installer as described here: http://www.jboss.org/community/docs/DOC-12863

 

Build and test the console

The console is build within the WAR module. It relies on the maven-gwt plugin, which automatically downloads and install a GWT bundle specific to your OS. Detailed information goals, setup and examples can be found here .

Follow these 3 steps to get started:

 

1. Build the whole package:

 

 

cd gwt-console/trunk
mvn install

 

 

2. Make sure the gwt-console-server.war is installed along with jBPM

 

 

3. Launch/debug the GWT app itself

cd war

# compile and launch in hosted mode, requires the REST facade to be deployed
mvn gwt:gwt

# hook up a debugger
mvn gwt:debug

# execute both junit tests and specific GWT tests 
mvn test

Roadmap and Releases

The gwt console ships as optional installation component with the jBPM installer (beginning 3.3.0.GA). Since it has a dependency on the jBPM runtime it will follow the same release cycle, which every 8 weeks. Details on the jBPM roadmap can be found here .

 

Problems?

Ask for help at irc.codehaus.org#jbpm

Tags: jbpm, gwt
Average User Rating
(0 ratings)




Edward Staub Edward Staub  says:

The DAOFactory in the text is DTOFactory in the picture - which is it?

Heiko Braun Heiko Braun  says:

Thanks, I've changed that.

Heiko Braun Heiko Braun  says:

Udaypal says:

 

 

I did have quite a long day trying to setup the environment. I used the following references to start with but please do let me know if there are others I should be looking at.
Couple of comments regarding these documents
  1. As a user starting from scratch, I found it quite difficult (more than 3 hours spent) to setup the environment mainly because there is no document that clearly describes steps involved in getting GWT up and running or may be I am missing something here.
  2. Although the diagram, in this document, seems to indicate that we can have GWT running with both jbpm3 and jbpm4 I was only able to get farther with version 4 than 3.
  3. The instructions in this document are little bit outdated but this one has the latest.
  4. Roughly, here are the steps I followed to be where I am currently (please let me know if I am doing anything redundant or if there is a better way of doing this)
1. Checkout gwt-console code
2. Build gwt-console
$ cd gwt-console
$ mvn install
3. Checkout jbpm4 code

# Rename profiles.xml.example to profiles.xml
$ cp profiles.xml.example profiles.xml

# Edit profiles.xml
# Update the JBOSS_HOME properties
# Update database connectivity properties (mainly used for running database test scenarios)

$ mvn package

# This step is necessary because the above instruction doesn't seem to compile the distribution
# I am using the distribution build for the jbpm-installer that it builds. More later
$ mvn -Pdistro clean install
4. Installing jBPM to JBoss
# Instal using the installer. The installer gives options for choosing the JBoss installation you want
# to use (this depends on how many JBoss Homes you provided in your profiles.xml).
#  It also asks for which database you want to use (mysql, hsqldb, sybase etc...) and which jboss
# configuration to use. Quite handy for the time timers.
$ cd jbpm4/modules/distro/target
$ java -jar jbpm4-installer-<version>.jar

5. Installing GWT to JBoss
# To install GWT simply copy the following
$ cp gwt-console/war/target/gwt-console.war $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/server/target/gwt-console-server.war $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/server/target/gwt-console-server-integration.jar $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/rpc/target/gwt-console-rpc-<version>.war $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/plugin-api/target/gwt-console-plugin-api-<version>.war $JBOSS_HOME/server/<config>/deploy/jbpm

6. Start JBoss and access GWT console
# Start JBoss
$ $JBOSS/bin/run.sh -c <config>

# login using username/password = admin/admin

7. GWT console in hosted mode
# In order to run GWT in the hosted mode (skip #5 & #6) follow these instructions
# Copy gwt-console-server related files to jboss
$ cp gwt-console/server/target/gwt-console-server.war $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/server/target/gwt-console-server-integration.jar $JBOSS_HOME/server/<config>/deploy/jbpm
$ cp gwt-console/rpc/target/gwt-console-rpc-<version>.war $JBOSS_HOME/server/<config>/deploy/jbpm
# Start JBoss
$ $JBOSS/bin/run.sh -c <config>

# Start GWT console
$ cd gwt-console/war

# This command will launch google windows and should prompt you
$ mvn com.totsp.gwt:maven-googlewebtoolkit2-plugin:gwt


By no means this is complete in any shape or form. These are just the notes I maintained trying to get it working.

More Like This

  • Retrieving data ...

Incoming Links