Download - Wiki

bossprettyingΔιαχείριση Δεδομένων

28 Νοε 2012 (πριν από 4 χρόνια και 6 μήνες)

254 εμφανίσεις


Table of Contents


1

SYSTEM ARCHITECTURE

................................
................................
.............

2

2

INSTALLATION GUIDE

................................
................................
..................

2

2.1

DBMS

................................
................................
................................
...........

3

2.2

Application Server

................................
................................
........................

3

2.3

JBoss Portal

................................
................................
................................
...

4

2.4

JBPM
................................
................................
................................
.............

4

3

THE JBPMPORTLET PROJ
ECT

................................
................................
....

5

4

PROCESS MODELING AND

PROCESS DEPLOYMENT

..........................

6

5

REFERENCE

................................
................................
................................
......

6

2


Development

Note for

the jBPMPortlet

Ou Yi

Fachbereich Informatik

Technische Universität Kaiserslautern

o_yi@informatik.uni
-
kl.de

Abstract.

This
n
ote is a supplement to the Final Report for the Internship “Using
Open Source WFMS for Supporting University Studies” at DFKI, providing pra
c-
tical information for the development.

1

System Architecture

For
s
ystem
a
rchitecture please refer to

section 1.2 and 2.3.1 of

[1]
.

The

major

sof
t
ware
components
and fram
e
works
used in
the

development and their version are:



PostgreSQL
(
postgresql
-
8.2.3
)



JBoss Application Server (
jboss
-
4.0.5.GA
)



jBPM (jbpm
-
3.1.4)



JBoss Portal (j
boss
-
portal
-
2.4.1)

Environment: Java 1.5 on Linux (the above combination works also on Windows XP
,
but not covered in scope of this note
). Please make sure that the environmental variable
$JAVA_HOME is set to a JDK (1.4.2 or 1.5
, but not 1.6
).

2

Installation

Guide

This section shall call attention to the specific details which are important to the success
of the installation. The major sources of information for the installation are the doc
u-
mentations included in the downloaded packages of the corresponding s
oftware comp
o-
nents.
Another useful source of information is the JBoss forum
1
.





1

URL:
http://www.jboss.com/index.html?module=bb&op=main&c=5

3


2.1

DB
MS

2.1.1

Install and make sure the data
base server is running

For installation please refer to
[3]
. Useful c
ommands

for testing the db server

should be
s
omething similar to the following

(
executed

in the installation directory of pgsql)
:

mkdir log

mkdir data

.
\
bin
\
pg_ctl.exe
-
D data
-
l log
\
server.log start

.
\
bin
\
pg_ctl.exe
-
D data stop

.
\
bin
\
createdb test

.
\
bin
\
psql test

Default configuration files will
be created automatically in the directory “data”.

2.1.2

C
reate the database for jboss


Use any database tool

(e.g. DbVisualizer)

to connect to the created database “test”.

These tools normally use JDBC drivers, which should be downloaded and co
n
figured
in
the da
tabase tools
in advance to this step.

Issue

the SQL statement

create database jboss;

to create the database jboss for JBoss Portal und jBPM.

2.1.3

Create the
database

schema for
jBPM


Connect to the created database using
the
database tool.

Load and execute

the
SQL
script for PostgreSQL which can be found in the jbpm
-
starters
-
kit
-
3.1.2.

2.2

Application Server

2.2.1

Installation

Install the application server using the
jems
-
installer available at jboss download site
2
.
Make sure the option “
call by value
” is enabled. Details

for installation can be found in
[2]
. A “default” configuration will be created under the directory $JBOSS_HOME/server
with three sub directories: conf, lib and deploy, where $JBOSS_HOME is the installation
d
i
rectory of jboss.






2

URL: http://easynews.dl.sourceforge.net/sourceforge/jboss/jems
-
installer
-
1.2.0.GA.jar?download

4


2.2.2

DataSource Configuration

Check and edit the following xml files, using knowledge from section
2.1

to make sure
the corresponding DataSources are ready for use by the system and applications:



hsqldb
-
ds.xml

for DefaultDS



portal
-
ds.xml for PortalDS



jbpm
-
ds.xml for JbpmDS

These xml files are located under the directory:

$JBOSS_HOME/server/config_name/deploy

2.2.3

After Installation

Scripts to start and stop jboss server are under the directory $JBOSS_HOME/bin. To
start a server instanc
e using configuration other than default, the start script should be
called using option “
-
c config_name”
, e.g.:

./bin/run.sh

c defualt


If the security constraint is set during the installation, the shutdown script should be
called using

option “
-
u admin

-
p password”, e.g.:

./bin/shutdown.sh
-
u admin
-
p password

After first run of the server,
we should
p
ossibly edit
the file

d
e
ploy/jms/hsqldb
-
jdbc2
-
service.xml

and

set

CREATE_TABLES_ON_STARTUP = FALSE (it was
set to
TRUE)
.

2.3

JBoss Portal

Normally, JBoss Po
rtal can be deployed without problem.
For details please refer to
[4]
.
Possibly the files hibernate.cfg.xml (there are several of them, search for them using
the Linux utilities such as “find”) should be changed to have this li
ne being:

<property name="dialect">


org.hibernate.dialect.PostgreSQLDialect

</property>

2.4

JBPM

JBPM needs to be adjusted and
re
compiled before deployment

to suit our environment
and to avoid class
-
loading issues
. Assume that the package jbpm
-
3.1.4.zip is un
zipped to a
directory $JBPM_HOME:



Edit file $JBPM_HOME/build.properties according to the specific environment



Edit file $JBPM_HOME/b
uild.xml
to
comment out hsql specific <replace> tag
s.



Edit file $JBPM_HOME/b
uild
.deploy
.xml
, change the deploy.webapp target

as
follows:

5




<!
--

<fileset dir="lib/jsf" includes="*.jar" />
--
>




<fileset dir="lib/jsf" includes="jstl*.jar" />




<fileset dir="lib/jsf" includes="standard*.jar" />



<!
--

<fileset dir="lib/dom4j" includes="*.jar" />
--
>



Edit file $
JBPM_HOME/src/conf
ig.files/hibernate.cfg.xml

as follows:


<property
name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect


</property>

<!
--

<property
name="hibernate.connection.datasource">java:/JbpmDS


</property>

--
>

<property
name="hibernate.connec
tion.driver_class">org.postgresql.Driver

</property>

<property
name="hibernate.connection.url">jdbc:postgresql://localhost:5432/jboss

</property>


<property name="hibernate.connection.username">username</property>

<property name="hibernate.connection.pa
ssword"></property>

We comment out the
connection.
datasource
property

and add the JDBC connection
properties

to enable JUnit
testing because datasource can not be accessed
outside of the
application server, i.e.
by JUnit framework.

After these steps the jb
pm and its web application can be recompiled and deployed
using the script build.deploy.xml. Examples of the above configurations can be checked
out from the subversion repository (project DFKIJBPM_WIN)
.

3

T
he jBPMPortlet
Project

The logical structure or arc
hitecture of this portlet application can be found in section 2
of
[1]
.
The

project can be checked out from subversion repository (project
DFKIJBPMPortlet). This project references project DFKIJBPM_WIN and requires
a

log


dire
ctory in home d
i
rectory of the current user

for the purpose of logging

at runtime
.

The project consists of following

physical

parts:

src

Contains
java source files

test

Contains
java source files for JUnit tests

(The class JbpmDelegatorTest contains e
s-
sent
ial test cases for the application and is runnable as JUnit test case)

6


process

Contains
source files for the process definitions

WebContent

Contains jsp files, configuration files, layouts and themes (these layouts and themes are
available also for other a
pplications in the same portal)

At packaging time,
the directory structure of WebContent is unchanged and copied into
the directory of the web application;
the java class files are jarred and copied into the
WEB
-
INF/lib di
rectory
, together with the require
d libraries. Details can be found in
build.xml file of the DFKIJBPMPortlet project.

4

Process
Modeling

and
Process
Deployment

Process definition can be modeled and deployed using
the
graphical process designer,
which is included in the JBoss Eclipse IDE (
JBo
ssIDE
-
2.0.0.Beta2
-
Bundle
-
xxx
.zip
,
available at JBoss download site
). The JBoss Eclipse IDE requires a valid installation of
jbpm
-
jpdl
-
3.2.GA
. It also requires a deployed and running servlet for the deployment of
the
process
defin
i
tion
. In jbpm
-
3.1.4 this s
ervlet

listens to the URL:
//SERVER/jbpm/upload (
in

jbpm
-
jpdl
-
3.2.GA

this URL should be
//SERVER/jbpm
-
console/upload, but in our co
n
figuration only the jbpm
-
3.1.4 is running).

For notes on process modeling please refer to section 2.2 of
[1]
. The article
[6]

provides
some general concept on graph oriented programming
.


To set up the JBoss Eclipse IDE with JSF support, please refer to the tutorial

[9]
.

5

Reference

[1]

Y. Ou: Fina
l Report for the internship “Using Open Source WFMS for Supporting University
Studies”

[2]

JBoss 4 Installation Guide,
URL:

http://labs.jboss.com/jbossas/docs

[3]

PostgreSQL 8.2.4 Documentation,
URL:

http://www.postgresql.org/docs/8.2/static/index.html

[4]

JBoss Porta
l Reference Manual,
URL:

http://docs.jboss.com/jb
Portal
/v2.4/reference
-
guide/en/html/

[5]

jBPM User Guide,
URL:

http://docs.jboss.com/jbpm/v3/userguide/

[6]

T. Baeyens: The State of Workflow,
URL:

http://www.jboss.com/products/jbpm/stateofworkflow

[7]

JBoss Forums at
http://www.jboss.com

[8]

JBoss jBPM Getting Started Guide, URL:

http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted

7


[9]

WTP Tutorials
-

JavaServer Faces Tools Tutorial

at

http://www.eclipse.org/webtools/jsf/dev_resource/JSFTutorial
-
RC3/JSFTools_tutorial.
html