Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
Issue #554
  • Loading branch information
rsoika committed Aug 31, 2019
1 parent 5b077a6 commit 2218264
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<artifactId>imixs-workflow</artifactId>
<version>5.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-workflow-lucene-core</artifactId>
<name>Apache Lucene Search Index</name>
<artifactId>imixs-workflow-index-lucene</artifactId>
<name>Search Index Apache Lucene</name>

<dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<artifactId>imixs-workflow</artifactId>
<version>5.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-workflow-lucene-solr</artifactId>
<name>Apache Solr Search Index</name>
<artifactId>imixs-workflow-index-solr</artifactId>
<name>Search Index Apache Solr</name>


<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<module>imixs-workflow-engine</module>
<module>imixs-workflow-faces</module>
<module>imixs-workflow-jax-rs</module>
<module>imixs-workflow-lucene</module>
<module>imixs-workflow-solr</module>
<module>imixs-workflow-index-lucene</module>
<module>imixs-workflow-index-solr</module>
</modules>

<properties>
Expand Down
134 changes: 20 additions & 114 deletions src/site/markdown/deployment/deployment_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,40 @@ To deploy the Imixs-Workflow engine on a specific platform see also the chapters
## Imixs-Workflow components
To bundle the Imixs-Workflow engine together with a business application the following components need to be added into the deployment:

* _imixs-workflow-core-4.x.x.jar_ - contains the core api and xml api
* _imixs-workflow-engine-4.x.x.jar_ - the jee workflow engine containing jpa and ejb components
* _imixs-workflow-core-x.x.x.jar_ - contains the core api and xml api
* _imixs-workflow-engine-x.x.x.jar_ - the workflow engine containing jpa and ejb components

For following components are used for web applications or the Rest API

* _imixs-workflow-faces-4.x.x.jar_ - contains optional JSF components
* _imixs-workflow-jax-rs-4.x.x.jar_ - contains the Imixs RESTful Web Service
* _imixs-workflow-faces-x.x.x.jar_ - contains optional JSF components
* _imixs-workflow-jax-rs-x.x.x.jar_ - contains the Imixs RESTful Web Service

All artifacts can be downloaded from the [Maven central repository page](https://search.maven.org/). In case of maven the components will be downloaded and bundled automatically during the maven build process.

### Lucene
### Search Index

The Imixs-Workflow engine uses a [Lucene Search Index](https://lucene.apache.org/) to query documents. Therefore the following lucene artifacts need to be added into the deployment unit:
The Imixs-Workflow engine includes a search index based on the [Lucene Search Technology](https://lucene.apache.org/). The search index is used to query documents. There are two different index implementations available:

* lucene-core-6.x.x.jar - Lucene core engine
* lucene-analyzers-common - Lucene analyzers
* lucene-queryparser - Lucene query parser
* lucene-codecs - codecs
* _imixs-workflow-index-lucene-x.x.x.jar_ - Search index based on the Lucene Core engine
* _imixs-workflow-index-solr-x.x.x.jar_ - Search index based on Lucene Solr

The Lucene-Core index is the default index for Imixs-Workflow it can be deployed by teh



## Building an Web Application (WAR)
To install and deploy the Imixs-Workflow engine into a web application it is sufficient to bundle the Imixs-Workflow components and Luncene libraries into the WEB-INF/lib folder. This is called the "EJB Lightway Runtime Environment". To customize the deployment the deployment descriptor _ejb-jar.xml_ should be added into to WEB-INF/ folder. The persitence.xml is placed into the /WEB-INF/classes folder:
To install and deploy the Imixs-Workflow engine into a web application it is sufficient to bundle the Imixs-Workflow components into the WEB-INF/lib folder. This is called the "EJB Lightweight Runtime Environment". To customize the deployment the deployment descriptor _ejb-jar.xml_ can be added into to WEB-INF/ folder. The persitence.xml is placed into the /WEB-INF/classes folder:

/
+- WEB-INF/
| |- ejb-jar.xml (optional)
| +- lib/
| | |- imixs-workflow-core-4.1.2.jar
| | |- imixs-workflow-engine-4.1.2.jar
| | |- imixs-workflow-faces-4.1.2.jar
| | |- imixs-workflow-jax-rs-4.1.2.jar
| | |- lucene-codecs-6.3.0.jar
| | |- lucene-core-6.3.0.jar
| | |- lucene-analyzers-common-6.3.0.jar
| | |- lucene-queries-6.3.0.jar
| | |- lucene-queryparser-6.3.0.jar
| | |- lucene-sandbox-6.3.0.jar
| | |- imixs-workflow-core-5.1.0.jar
| | |- imixs-workflow-engine-5.1.0.jar
| | |- imixs-workflow-faces-5.1.0.jar
| | |- imixs-workflow-jax-rs-5.1.0.jar
| | |- imixs-workflow-index-lucene-5.1.0.jar
| | |- ....
| +- classes/
| | +- META-INF/
| | | |- persistence.xml
Expand Down Expand Up @@ -83,26 +78,10 @@ The following example shows the maven dependencies used in a maven project:
<artifactId>imixs-workflow-faces</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>
<!-- Apache Lucene -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
<version>${lucene.version}</version>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-index-lucene</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -164,77 +143,4 @@ This tag should always point to the imixs-workflow-engine Jar File. The version

In the example the jta-data-source point to a JDBC Resource with the JNDI Name 'jdbc/workflow-db'. The jar-file points to the imixs-workflow-engine.jar part of your application.


## Using shared libraries
In difference to the deployment example shown above it is also possible to deploy part of the Imixs-Workflow components as shared libraries into an EAR. In this case the jars are put into the /lib/ folder of the EAR. Jars deployed into the /lib folder of an ear are visible to all other modules and components. Except for the imixs-workflow-engine.jar all Imixs jars can be placed into the lib/ directory. The EAR structure will look like this:

/
+- META-INF/
| |- application.xml
|- lib/
| |- imixs-workflow-core-4.0.0.jar
| |- lucene-codecs-6.2.0.jar
| |- lucene-core-6.2.0.jar
| |- lucene-analyzers-common-6.2.0.jar
| |- lucene-queries-6.2.0.jar
| |- lucene-queryparser-6.2.0.jar
| |- lucene-sandbox-6.2.0.jar
|- my_ejb_module.jar
|- my_web_module.war
|- imixs-workflow-engine-4.0.0.jar

In this EAR layout the EJB module only needs to include the imixs-workflow-engine.jar into the classpath. So the MANIFEST.MF file can be changed to:

Manifest-Version: 1.0
Class-Path: imixs-workflow-engine-4.0.0.jar


## Building an Enterprise Archive (EAR)
Deploying the Imixs-Workflow engine into a Enterprise Archive (EAR) differs in some details from the deployment into a web application as explained before. An EAR splits the business logic (EJBs) and the users web front-end (WAR) into separate modules. This gives more flexibility in designing enterprise applications. Basically the structure of an EAR looks typical like this:

/
+- META-INF/
| |- application.xml
|- my_ejb_module.jar
|- my_web_module.war

The components imixs-workflow-core and imixs-workflow-engine are added into the root of the EAR structure. The lucene components can be added into the /lib/ folder:

/
+- META-INF/
| |- application.xml
|- my_ejb_module.jar
|- my_web_module.war
|- imixs-workflow-core-3.0.0.jar
|- imixs-workflow-engine-3.0.0.jar
+- lib/
| |- lucene-codecs-6.2.0.jar
| |- lucene-core-6.2.0.jar
| |- lucene-analyzers-common-6.2.0.jar
| |- lucene-queries-6.2.0.jar
| |- lucene-queryparser-6.2.0.jar
| |- lucene-sandbox-6.2.0.jar



The components imixs-workflow-faces and imixs-workflow-jax-rs are bundled into the corresponding web module as explained before. So these components are still part of your web module:

/
+- lib/
| |- imixs-workflow-faces-3.0.0.jar
| |- imixs-workflow-jax-rs-3.0.0.jar

To get the Imixs-Workflow engine deployed together with custom business logic located in the EJB module (my_ejb_module.jar) it is necessary to configure the classpath of the EJB Module. This step makes the Imixs-Workflow engine visible to all other EAR modules but it allows also to specify server specific configurations like the JDBC/Database or the security realm by overwriting the default settings. The structure of the EJB Module as part of your EAR will typically look like this:

/
+- META-INF/
| |- MANIFEST.MF
| |- ejb-jar.xml
| |- persistence.xml

The MANIFEST.MF file is used to add additional component libraries to be used together with your EJB module. The Class-Path definition need to be added into the META-INF/MANIFEST.MF file of your ejb module including all Imixs jar files:

Manifest-Version: 1.0
Class-Path: imixs-workflow-core-4.0.0.jar imixs-workflow-engine-4.0.0.jar

This makes the Imixs-Workflow engine part of your EJB module. The ejb-jar.xml included in your EJB module can be left empty as EJBs will be deployed automatically. The _ejb-jar.xml_ deployment descriptor allows to control about the default behavior of the EJBs provided by the Imixs-Workflow engine. For example in case to define a 'run-as-principal' role to a ejb or a method or to inject a local jndi-mail or jndi-directory resource.

7 changes: 6 additions & 1 deletion src/site/markdown/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All components of Imixs-Workflow are build with Maven which makes it easy to add

<properties>
.....
<org.imixs.workflow.version>4.5.0</org.imixs.workflow.version>
<org.imixs.workflow.version>5.1.0</org.imixs.workflow.version>
</properties>
...
<dependency>
Expand All @@ -19,6 +19,11 @@ All components of Imixs-Workflow are build with Maven which makes it easy to add
<artifactId>imixs-workflow-jax-rs</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-index-lucene</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>

The latest version number can be look up by browsing the [maven-central-repository](http://search.maven.org/#browse). Also detailed information about each artifact are provided in separate sections of the different Imixs-Workflow subprojects.

Expand Down
5 changes: 5 additions & 0 deletions src/site/markdown/webtools/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Since Java EE6 the lightweight Web Profiles simplifies the deployment of Java EE
<artifactId>imixs-workflow-faces</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-index-lucene</artifactId>
<version>${org.imixs.workflow.version}</version>
</dependency>
....

You will find more information about the Maven support of Imixs-Workflow in the [section Maven](../maven.html).
Expand Down

0 comments on commit 2218264

Please sign in to comment.