-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# How to Run Imixs-Office-Workflow with Microsoft SQL Server | ||
|
||
Imixs-Office-Workflow can be used with databases from different vendors. In the default configuration, a PostgreSQL database is used. | ||
The following section shows how to connect the Imixs Office workflow running under Wildfly with a Microsodft SQL Server. | ||
|
||
## Install the Driver Module | ||
|
||
First you need to ensure that you have configured a driver module. Create the following directory structure | ||
|
||
``` | ||
├── modules | ||
│ └── com | ||
│ └── microsoft | ||
│ └── sqlserver | ||
│ └── jdbc | ||
│ └── main | ||
│ ├── module.xml | ||
│ └── mssql-jdbc-12.8.1.jre11.jar | ||
``` | ||
|
||
The `/main` directory includes the mssql jdbc driver and a module.xml file with the following content: | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module xmlns="urn:jboss:module:1.6" name="com.microsoft.sqlserver.jdbc"> | ||
<resources> | ||
<resource-root path="mssql-jdbc-12.8.1.jre11.jar" /> | ||
<!-- Make sure this matches the name of the JAR you are installing --> | ||
</resources> | ||
</module> | ||
``` | ||
|
||
Now you can add the Driver together with the datasource configuration for Imixs-Office-Workflow into your standalone.xml file from Wildfly: | ||
|
||
```xml | ||
.... | ||
<subsystem xmlns="urn:jboss:domain:datasources:7.0"> | ||
<datasources> | ||
.... | ||
<!-- imixs-workflow datasource --> | ||
<datasource jta="true" jndi-name="java:/jdbc/office" pool-name="office" | ||
enabled="true" use-ccm="true"> | ||
<connection-url>${env.MSSQL_CONNECTION}</connection-url> | ||
<driver>mssql</driver> | ||
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> | ||
<security> | ||
<user-name>${env.MSSQL_USER}</user-name> | ||
<password>${env.MSSQL_PASSWORD}</password> | ||
</security> | ||
<validation> | ||
<check-valid-connection-sql>select 1</check-valid-connection-sql> | ||
</validation> | ||
</datasource> | ||
|
||
<drivers> | ||
.... | ||
<!-- MSSQL Integration--> | ||
<driver name="mssql" | ||
module="com.microsoft.sqlserver.jdbc"> | ||
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> | ||
</driver> | ||
</drivers> | ||
</datasources> | ||
..... | ||
|
||
``` | ||
|
||
|
||
The datasource is connected with the installed JDBC driver and uses environment variables to connect to your MS SQL server. | ||
Here is an example how to configure the datasource in your `docker-compose.yaml` file: | ||
|
||
``` | ||
version: "3.6" | ||
services: | ||
db: | ||
image: mcr.microsoft.com/mssql/server:2022-preview-ubuntu-22.04 | ||
environment: | ||
ACCEPT_EULA: "Y" | ||
MSSQL_SA_PASSWORD: "yourStrong12345Password" | ||
volumes: | ||
- dbdata:/var/lib/mssql/data | ||
app: | ||
image: imixs/imixs-documents:2.1.0 | ||
depends_on: | ||
- db | ||
environment: | ||
MSSQL_CONNECTION: "jdbc:sqlserver://db:1433;databaseName=office;encrypt=true;trustServerCertificate=true" | ||
MSSQL_USER: "sa" | ||
MSSQL_PASSWORD: "yourStrong12345Password" | ||
TZ: "Europe/Berlin" | ||
ports: | ||
- "8080:8080" | ||
- "8787:8787" | ||
volumes: | ||
- ./docker/configuration/standalone-mssql.xml:/opt/jboss/wildfly/standalone/configuration/standalone.xml | ||
- ./docker/configuration/modules/com/microsoft/:/opt/jboss/wildfly/modules/com/microsoft/ | ||
``` | ||
|
||
We use the volumes mapping here to inject the modules and standalone.xml file into the container. | ||
|
||
|
||
## Setup Microsoft SQL Server | ||
|
||
In this example we use a preview version of Microsoft SQL running in a container. | ||
You can test your Microsoft SLQ Server and create the database `office` using commandline tool `sqlcmd` | ||
|
||
``` | ||
$ docker exec -it office-goslar-db-1 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yourStrong12345Password | ||
``` | ||
|
||
From the commandline shell you can create the database with: | ||
|
||
``` | ||
1> CREATE DATABASE office | ||
2> GO | ||
``` | ||
|
||
Now you can start Imixs-Office-Workflow connecting to your local Microsoft SQL Server. | ||
|
||
In general we recommend to use a Open Source Database instead of the proprietary Microsoft SQL Server. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters