The Imixs JEE Workflow provides a flexible database schema which allows to store all workflow data into a relational database. The Imixs JEE Workflow makes use of the Java Persistence API (JPA) which allows to manage relational data from any JEE application in a flexible and scalable architecture. The Implementation is vendor independent so you can use any database system which runs on your JEE application server.
The Imixs JEE Workflow stores each process instance (workitem) and also the workflow model automatically into a database. As the Imixs JEE Components are providing an easy to use API to access any kind of data stored by the Imixs Workflow system, there is no need for a developer to take much care about the data management.
The following section will give a brief overview about the installation requirements and the database schema.
To install the Imixs JEE Workflow system into a JEE Application server it is necessary to provide the workflow instance with a JEE datasource. A JEE datasource defines the connection form your application to a relational database on a database server. The only configuration file which is necessary to define the database connection is the persistence.xml. This is a standard descriptor which should be placed into your application.
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="org.imixs.workflow.jee.jpa"> <jta-data-source>jdbc/workflow-db</jta-data-source> <!-- Make sure that the library version maches the library included in ear/lib --> <jar-file>lib/imixs-workflow-jee-2.0.1-SNAPSHOT.jar</jar-file> <properties> .... //vendor specific database properties </properties> </persistence-unit> </persistence>
The persistence-unit specifies the data objects which should be stored into the database. The unit name is defined by the Imixs JEE Components and should not be changed. The jta-data-source defines the name of the datasource to be used by the Imixs JEE WOrkflow to store data into the database.
To provide a data-source in the application server there are different ways how to configure the database connection. The following pictures shows how a database source to a MySQL database is defined in a Glassfish Application server.
Definition of a JDBC Connection pool to access a database
Definition of a JDBC Resource used by the Imixs Workflow Application
The Imixs JEE Workflow provides a generic and flexible database schema which enables a workflow application to store any kind of data into a relational data base system. The database schema consists of 9 different JPA classes which are defined by the package org.imixs.workflow.jee.jpa. These classes are mapped automatically to a database schema from a database.
Each WorkItem or ModelItem will be mapped to an Entity Object which contains a unique ID to identify the Entity inside the database schema. The Entity holds also access informations which describes how the entity can be read or modified from individual users. So the schema provides a kind of access control list (ACL) for each Entity Object. The data of a WorkItem or ModelItem will be stored into the EntityData Object which is mapped to a binary large object (blob) inside a database. This enables an application to store any kind of data independent from the structure of the database.
To access data in a relational way the Imixs JEE Data Object are providing 4 additional data type specific Objects
An Imixs Workflow Application can map any data stored by the EntiyData Object to one of these specific data types. As a result the Dataobjects will be stored in separate tabels which allow to access these data using a query language. So the Imixs JEE Components are support all features of the powerful EJB Query language provided by the JEE / JAP specification. To read more about the usage of the JPQL feature in a Imxis JEE Workflow Application read the section "Query Examples".