Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AmeerAhmed
IntegratingJBPMIntoA...
IntegratingJBPMIntoA...




JSPWiki v2.2.33

[RSS]


Hide Menu

IntegratingJBPMIntoAppFusePartTrois


Difference between version 21 and version 1:

At line 1 changed 1 line.
__Part I:__ [Integrating jBPM into AppFuse] - Integrating jBPM Support (via Spring-Modules) into AppFuse.\\
__Part I:__ [Integrating jBPM into AppFuse] - Integrate jBPM Support (via Spring-Modules) into AppFuse.\\
At line 3 changed 1 line.
__Part III:__ [Integrating jBPM into AppFuse Part Trois] - Enhancing defintions to support tasks, users, schedule and injecting spring beans into actions.\\
__Part III:__ [Integrating jBPM into AppFuse Part Trois] - Enhance defintions to support tasks, users, schedule and injecting spring beans into actions.\\
At line 7 changed 1 line.
This is the 3rd tutorial of a 3 part series. The tutorial will cover enhanding defintions with users, tasks, schedule, peristnece and injecting spring beans into action. Before proceeding further please review Part I / Part II.\\
This is the 3rd tutorial of a 3 part series. The tutorial will cover enhancing defintions with users, tasks, schedule, persistence and injecting spring beans into action. Before proceeding further please review Part I / Part II.\\
At line 11 changed 7 lines.
* [2] Create and load identities into jBPM database
* [3] Enhance Process Defintion by creating and assigning tasks
* [4] Write test case to validate Process Definition execution
* [5] Enhance Process Defintion by creating ActionHandlers (DecisionHandler)
* [6] Write test case to validate new Process Definition execution
* [7] Wire spring beans inside jBPM Actions
* [8] Test spring bean execution
* [2] Enhance Process Defintion by creating and assigning tasks
* [3] Write test case to validate Process Definition execution
* [4] Enhance Process Defintion by creating ActionHandlers (DecisionHandler)
* [5] Write test case to validate new Process Definition execution
* [6] Wire spring beans inside jBPM Actions
* [7] Test spring bean execution
At line 20 added 81 lines.
Before we create the schema tasks lets create some packages which willl contain actions and config files.
Create the following packages:\\
{{org.appfuse.jbpm.config}}\\
{{org.appfuse.jbpm.action}}\\
The following files are from the Jbpm Starter Kit (see [IntegratingJBPMIntoAppFuse] for the download link) :-
Copy these files to {{org.appfuse.jbpm.config}}:\\
1. {{jbpm/src/config.files/hibernate.cfg.xml}}\\
2. {{jbpm/src/resources/hsqldb/create.db.hibernate.properties}}\\
3. {{jbpm/src/resources/hsqldb/identity.db.xml}}\\
{{create.db.hibernate.properties}} does require modification . It has to point to the Jbpm datasource (same as the one defined in Part I).
{{{
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/jbpm?useUnicode=true&characterEncoding=utf-8
hibernate.connection.username=root
hibernate.connection.password=
hibernate.show_sql=true
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
}}}
;:%%(color: blue)''You might want to change the cache provider for production usage to a more robust one such as Ecache. If you plan on sticking with this one, ensure that {{dao.compile.classpath}} in {{properties.xml}} contains this reference:''%%
{{{
<!-- DAO -->
<path id="dao.compile.classpath">
...
<pathelement location="${commons-collections.jar}"/>
...
</path>
}}}
{{identity.db.xml}} contains users/group/participation data. It can be modified to your liking. More on this later when we delve into creating / assinging tasks in the workflow.
And finally add these targets to your main AppFuse {{build.xml}} file:
{{{
<target name="build.processes" description="builds the example processes">
<copy todir="build/dao/gen/org/appfuse/jbpm/process/test">
<fileset dir="src/dao/org/appfuse/jbpm/process/test" />
</copy>
<zip destfile="build/dao/gen/org/appfuse/jbpm/process/test.process">
<fileset dir="build/dao/gen/org/appfuse/jbpm/process/test" />
</zip>
</target>
<target name="clean_jbpm" depends="build.processes, declare.jbpm.tasks" description="refreshes jbpm database">
<jbpmschema actions="drop"
cfg="src/dao/org/appfuse/jbpm/config/hibernate.cfg.xml"
properties="src/dao/org/appfuse/jbpm/config/create.db.hibernate.properties"/>
<jbpmschema actions="create"
cfg="src/dao/org/appfuse/jbpm/config/hibernate.cfg.xml"
properties="src/dao/org/appfuse/jbpm/config/create.db.hibernate.properties"/>
<deployprocess cfg="src/dao/org/appfuse/jbpm/config/hibernate.cfg.xml"
properties="src/dao/org/appfuse/jbpm/config/create.db.hibernate.properties">
<fileset dir="build/dao/gen/org/appfuse/jbpm/process" includes="*.process" />
</deployprocess>
<loadidentities file="src/dao/org/appfuse/jbpm/config/identity.db.xml"
cfg="src/dao/org/appfuse/jbpm/config/hibernate.cfg.xml"
properties="src/dao/org/appfuse/jbpm/config/create.db.hibernate.properties"/>
</target>
<target name="declare.jbpm.tasks">
<taskdef classpathref="dao.compile.classpath" resource="org/jbpm/ant/jbpm.ant.tasks.properties" format="properties"></taskdef>
</target>
}}}
\\
{{build.processes}} is a convenience task to build process defnitions. Multiple definitions can be added.\\
{{declare.jbpm.tasks}} does exactly what it names implies, loads task definitions used in clean_jbpm target.\\
{{clean_jbpm}} refreshes the jbpm db. Which i find myself doing a lot of! It first drops the schema(you will lose all changes, so beware), then creates a new one, then deploys process defintions and finally loads workflow identities(users) into the jbpm database.
Execute __ant clean_jbpm__ and watch the magic happen!

Back to IntegratingJBPMIntoAppFusePartTrois, or to the Page History.