Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump license-maven-plugin from 1.14 to 2.0.0 in /webapps #73

40 changes: 40 additions & 0 deletions database/pom.xml
Expand Up @@ -31,6 +31,7 @@
<version.db2-10.5>10.5.0.5</version.db2-10.5>
<version.db2>${version.db2-10.5}</version.db2>
<version.postgresql>9.4.1212</version.postgresql>
<version.informix>4.10</version.informix>

<!-- CockroachDB is compatible with PostgreSQL 9.5,
so a different version of the JDBC driver needs to be used -->
Expand Down Expand Up @@ -92,6 +93,11 @@
<artifactId>postgresql</artifactId>
<version>${version.postgresql}</version>
</dependency>
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
<version>${version.informix}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -557,6 +563,40 @@
</pluginManagement>
</build>
</profile>

<profile>
<id>informix</id>
<properties>
<database.type>informix</database.type>
<database.driver>com.informix.jdbc.IfxDriver</database.driver>
<database.datasource.class>com.informix.jdbcx.IfxDataSource</database.datasource.class>
</properties>

<dependencies>
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.ibm.informix.jdbc</groupId>
<artifactId>ifxjdbc</artifactId>
<version>${version.informix}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>

</project>
8 changes: 8 additions & 0 deletions distro/sql-script/pom.xml
Expand Up @@ -174,6 +174,10 @@
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" files="activiti.cockroachdb.create.engine.sql activiti.cockroachdb.create.case.engine.sql activiti.cockroachdb.create.decision.engine.sql activiti.cockroachdb.create.history.sql activiti.cockroachdb.create.case.history.sql activiti.cockroachdb.create.decision.history.sql" />
</concat>

<concat destfile="target/sql/create/informix_engine_${project.version}.sql" fixlastline="yes">
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" files="activiti.informix.create.engine.sql activiti.informix.create.case.engine.sql activiti.informix.create.decision.engine.sql activiti.informix.create.history.sql activiti.informix.create.case.history.sql activiti.informix.create.decision.history.sql" />
</concat>

<!-- add identity create files -->
<copy todir="target/sql/create" flatten="false">
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/create" />
Expand Down Expand Up @@ -220,6 +224,10 @@
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" files="activiti.cockroachdb.drop.decision.engine.sql activiti.cockroachdb.drop.case.engine.sql activiti.cockroachdb.drop.engine.sql activiti.cockroachdb.drop.decision.history.sql activiti.cockroachdb.drop.case.history.sql activiti.cockroachdb.drop.history.sql" />
</concat>

<concat destfile="target/sql/drop/informix_engine_${project.version}.sql" fixlastline="yes">
<filelist dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" files="activiti.informix.drop.decision.engine.sql activiti.informix.drop.case.engine.sql activiti.informix.drop.engine.sql activiti.informix.drop.decision.history.sql activiti.informix.drop.case.history.sql activiti.informix.drop.history.sql" />
</concat>

<!-- add identity drop files -->
<copy todir="target/sql/drop" flatten="false">
<fileset dir="target/camunda-engine-${project.version}/org/camunda/bpm/engine/db/drop" />
Expand Down
6 changes: 6 additions & 0 deletions distro/wildfly/modules/pom.xml
Expand Up @@ -78,6 +78,12 @@
<artifactId>camunda-connect-soap-http-client</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${version.jackson}</version>
</dependency>

<!-- script engine dependencies -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
Expand Down
@@ -0,0 +1,9 @@
<module xmlns="urn:jboss:module:1.0" name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" slot="@version.jackson@">
<resources>
<resource-root path="jackson-datatype-jsr310-@version.jackson@.jar" />
</resources>

<dependencies>
<module name="com.fasterxml.jackson.core.jackson-databind" slot="@version.jackson@" />
</dependencies>
</module>
Expand Up @@ -12,6 +12,7 @@
<module name="org.camunda.commons.camunda-commons-typed-values" />

<module name="com.fasterxml.jackson.core.jackson-databind" slot="@version.jackson.databind@" />
<module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" slot="@version.jackson@" />
<module name="com.jayway.jsonpath.json-path" />
</dependencies>

Expand Down
Expand Up @@ -1561,6 +1561,7 @@ protected static Properties getDefaultDatabaseTypeMappings() {
databaseTypeMappings.setProperty("DB2/SUN64", "db2");
databaseTypeMappings.setProperty("DB2/PTX", "db2");
databaseTypeMappings.setProperty("DB2/2", "db2");
databaseTypeMappings.setProperty("Informix Dynamic Server", "informix");
return databaseTypeMappings;
}

Expand Down
Expand Up @@ -43,7 +43,8 @@ public class DbSqlSessionFactory implements SessionFactory {
public static final String POSTGRES = "postgres";
public static final String MARIADB = "mariadb";
public static final String CRDB = "cockroachdb";
public static final String[] SUPPORTED_DATABASES = {MSSQL, DB2, ORACLE, H2, MYSQL, POSTGRES, MARIADB, CRDB};
public static final String INFORMIX = "informix";
public static final String[] SUPPORTED_DATABASES = {MSSQL, DB2, ORACLE, H2, MYSQL, POSTGRES, MARIADB, INFORMIX};

protected static final Map<String, Map<String, String>> databaseSpecificStatements = new HashMap<>();

Expand Down Expand Up @@ -653,6 +654,67 @@ public class DbSqlSessionFactory implements SessionFactory {
constants.put("constant.integer.cast", "NULL");
constants.put("constant.null.reporter", "NULL AS REPORTER_");
dbSpecificConstants.put(MSSQL, constants);

// informix
databaseSpecificLimitBeforeStatements.put(INFORMIX, "SELECT SKIP ${firstResult} FIRST ${maxResults} * FROM (");
optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements.put(INFORMIX, "");
databaseSpecificLimitAfterStatements.put(INFORMIX, ")");
databaseSpecificInnerLimitAfterStatements.put(INFORMIX, databaseSpecificLimitAfterStatements.get(INFORMIX));
optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenFilterStatements.put(INFORMIX, "");
databaseSpecificLimitBeforeWithoutOffsetStatements.put(INFORMIX, "FIRST ${maxResults}");
databaseSpecificLimitAfterWithoutOffsetStatements.put(INFORMIX, "");
databaseSpecificOrderByStatements.put(INFORMIX, defaultOrderBy);
databaseSpecificLimitBeforeNativeQueryStatements.put(INFORMIX, "");
databaseSpecificDistinct.put(INFORMIX, "distinct");

databaseSpecificEscapeChar.put(INFORMIX, defaultEscapeChar);

databaseSpecificBitAnd1.put(INFORMIX, "BITAND(");
databaseSpecificBitAnd2.put(INFORMIX, ",");
databaseSpecificBitAnd3.put(INFORMIX, ")");
databaseSpecificDatepart1.put(INFORMIX, "");
databaseSpecificDatepart2.put(INFORMIX, "(");
databaseSpecificDatepart3.put(INFORMIX, ")");
databaseSpecificDummyTable.put(INFORMIX, "FROM SYSMASTER:SYSDUAL");
databaseSpecificTrueConstant.put(INFORMIX, "'t'");
databaseSpecificFalseConstant.put(INFORMIX, "'f'");
databaseSpecificIfNull.put(INFORMIX, "NVL");

databaseSpecificDaysComparator.put(INFORMIX, "DATE(${date}) + ${days} <= #{currentTimestamp}");

addDatabaseSpecificStatement(INFORMIX, "selectFilterByQueryCriteria", "selectFilterByQueryCriteria_oracleDb2");

addDatabaseSpecificStatement(INFORMIX, "deleteAttachmentsByRemovalTime", "deleteAttachmentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteCommentsByRemovalTime", "deleteCommentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricActivityInstancesByRemovalTime", "deleteHistoricActivityInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionInputInstancesByRemovalTime", "deleteHistoricDecisionInputInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionInstancesByRemovalTime", "deleteHistoricDecisionInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDecisionOutputInstancesByRemovalTime", "deleteHistoricDecisionOutputInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricDetailsByRemovalTime", "deleteHistoricDetailsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteExternalTaskLogByRemovalTime", "deleteExternalTaskLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricIdentityLinkLogByRemovalTime", "deleteHistoricIdentityLinkLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricIncidentsByRemovalTime", "deleteHistoricIncidentsByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteJobLogByRemovalTime", "deleteJobLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricProcessInstancesByRemovalTime", "deleteHistoricProcessInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricTaskInstancesByRemovalTime", "deleteHistoricTaskInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricVariableInstancesByRemovalTime", "deleteHistoricVariableInstancesByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteUserOperationLogByRemovalTime", "deleteUserOperationLogByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteByteArraysByRemovalTime", "deleteByteArraysByRemovalTime_informix");
addDatabaseSpecificStatement(INFORMIX, "deleteHistoricBatchesByRemovalTime", "deleteHistoricBatchesByRemovalTime_informix");

constants = new HashMap<String, String>();
constants.put("constant.event", "'event'");
constants.put("constant.op_message", "NEW_VALUE_ || '_|_' || PROPERTY_");
constants.put("constant_for_update", "for update");
constants.put("constant.datepart.quarter", "QUARTER");
constants.put("constant.datepart.month", "MONTH");
constants.put("constant.datepart.minute", "MINUTE");
constants.put("constant.null.startTime", "CAST(NULL AS DATETIME) AS START_TIME_");
constants.put("constant.varchar.cast", "'${key}'");
constants.put("constant.null.reporter", "CAST(NULL AS VARCHAR(255)) AS REPORTER_");
dbSpecificConstants.put(INFORMIX, constants);
}

protected String databaseType;
Expand Down
Expand Up @@ -133,8 +133,11 @@ public static boolean checkForeignKeyConstraintViolation(Throwable cause) {
List<SQLException> relatedSqlExceptions = findRelatedSqlExceptions(cause);
for (SQLException exception : relatedSqlExceptions) {

// Exception.message can be null on Informix
if (exception.getMessage() == null) {
return false;
// PostgreSQL doesn't allow for a proper check
if ("23503".equals(exception.getSQLState()) && exception.getErrorCode() == 0) {
} else if ("23503".equals(exception.getSQLState()) && exception.getErrorCode() == 0) {
return false;
} else if (
// SqlServer
Expand All @@ -154,6 +157,9 @@ public static boolean checkForeignKeyConstraintViolation(Throwable cause) {
|| (exception.getMessage().toLowerCase().contains("sqlstate=23503") && exception.getMessage().toLowerCase().contains("sqlcode=-530"))
// DB2 zOS
|| ("23503".equals(exception.getSQLState()) && exception.getErrorCode() == -530)
// Informix
|| (exception.getMessage().toLowerCase().contains("referential constraint")
|| ("23000".equals(exception.getSQLState()) && exception.getErrorCode() == -691))
) {

return true;
Expand All @@ -167,7 +173,10 @@ public static boolean checkVariableIntegrityViolation(Throwable cause) {

List<SQLException> relatedSqlExceptions = findRelatedSqlExceptions(cause);
for (SQLException exception : relatedSqlExceptions) {
if (
// Exception.message can be null on Informix
if (exception.getMessage() == null) {
return false;
} else if (
// MySQL & MariaDB
(exception.getMessage().toLowerCase().contains("act_uniq_variable") && "23000".equals(exception.getSQLState()) && exception.getErrorCode() == 1062)
// PostgreSQL
Expand All @@ -177,7 +186,9 @@ public static boolean checkVariableIntegrityViolation(Throwable cause) {
// Oracle
|| (exception.getMessage().toLowerCase().contains("act_uniq_variable") && "23000".equals(exception.getSQLState()) && exception.getErrorCode() == 1)
// H2
|| (exception.getMessage().toLowerCase().contains("act_uniq_variable") && "23505".equals(exception.getSQLState()) && exception.getErrorCode() == 23505)
|| (exception.getMessage().toLowerCase().contains("act_uniq_variable_index_c") && "23505".equals(exception.getSQLState()) && exception.getErrorCode() == 23505)
// Informix
|| (exception.getMessage().toLowerCase().contains("act_uniq_variable") && "23000".equals(exception.getSQLState()) && exception.getErrorCode() == -239)
) {
return true;
}
Expand Down
@@ -0,0 +1,137 @@
--
-- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- create case definition table --

create table ACT_RE_CASE_DEF (
ID_ varchar(64) not null,
REV_ integer,
CATEGORY_ varchar(255),
NAME_ varchar(255),
KEY_ varchar(255) not null,
VERSION_ integer not null,
DEPLOYMENT_ID_ varchar(64),
RESOURCE_NAME_ lvarchar(4000),
DGRM_RESOURCE_NAME_ lvarchar(4000),
TENANT_ID_ varchar(64),
HISTORY_TTL_ integer,
primary key (ID_)
);

-- create case execution table --

create table ACT_RU_CASE_EXECUTION (
ID_ varchar(64) not null,
REV_ integer,
CASE_INST_ID_ varchar(64),
SUPER_CASE_EXEC_ varchar(64),
SUPER_EXEC_ varchar(64),
BUSINESS_KEY_ varchar(255),
PARENT_ID_ varchar(64),
CASE_DEF_ID_ varchar(64),
ACT_ID_ varchar(255),
PREV_STATE_ integer,
CURRENT_STATE_ integer,
REQUIRED_ boolean,
TENANT_ID_ varchar(64),
primary key (ID_)
);

-- create case sentry part table --

create table ACT_RU_CASE_SENTRY_PART (
ID_ varchar(64) not null,
REV_ integer,
CASE_INST_ID_ varchar(64),
CASE_EXEC_ID_ varchar(64),
SENTRY_ID_ varchar(255),
TYPE_ varchar(255),
SOURCE_CASE_EXEC_ID_ varchar(64),
STANDARD_EVENT_ varchar(255),
SOURCE_ varchar(255),
VARIABLE_EVENT_ varchar(255),
VARIABLE_NAME_ varchar(255),
SATISFIED_ boolean,
TENANT_ID_ varchar(64),
primary key (ID_)
);

-- create index on business key --
create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_);

-- https://app.camunda.com/jira/browse/CAM-9165
create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_);

-- create foreign key constraints on ACT_RU_CASE_EXECUTION --
alter table ACT_RU_CASE_EXECUTION
add constraint foreign key (CASE_INST_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_CASE_EXE_CASE_INST;

alter table ACT_RU_CASE_EXECUTION
add constraint foreign key (PARENT_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_CASE_EXE_PARENT;

alter table ACT_RU_CASE_EXECUTION
add constraint foreign key (CASE_DEF_ID_)
references ACT_RE_CASE_DEF(ID_)
constraint ACT_FK_CASE_EXE_CASE_DEF;

alter table ACT_RU_VARIABLE
add constraint foreign key (CASE_EXECUTION_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_VAR_CASE_EXE;

alter table ACT_RU_VARIABLE
add constraint foreign key (CASE_INST_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_VAR_CASE_INST;

alter table ACT_RU_TASK
add constraint foreign key (CASE_EXECUTION_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_TASK_CASE_EXE;

alter table ACT_RU_TASK
add constraint foreign key (CASE_DEF_ID_)
references ACT_RE_CASE_DEF(ID_)
constraint ACT_FK_TASK_CASE_DEF;

alter table ACT_RU_CASE_SENTRY_PART
add constraint foreign key (CASE_INST_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_CASE_SENTRY_CASE_INST;

alter table ACT_RU_CASE_SENTRY_PART
add constraint foreign key (CASE_EXEC_ID_)
references ACT_RU_CASE_EXECUTION(ID_)
constraint ACT_FK_CASE_SENTRY_CASE_EXEC;

-- indexes for concurrency problems - https://app.camunda.com/jira/browse/CAM-1646 --
-- create index ACT_IDX_CASE_EXEC_CASE on ACT_RU_CASE_EXECUTION(CASE_DEF_ID_);
-- create index ACT_IDX_CASE_EXEC_PARENT on ACT_RU_CASE_EXECUTION(PARENT_ID_);
-- create index ACT_IDX_VARIABLE_CASE_EXEC on ACT_RU_VARIABLE(CASE_EXECUTION_ID_);
-- create index ACT_IDX_VARIABLE_CASE_INST on ACT_RU_VARIABLE(CASE_INST_ID_);
-- create index ACT_IDX_TASK_CASE_EXEC on ACT_RU_TASK(CASE_EXECUTION_ID_);
-- create index ACT_IDX_TASK_CASE_DEF_ID on ACT_RU_TASK(CASE_DEF_ID_);

-- add indexes for ACT_RU_CASE_SENTRY_PART --
-- create index ACT_IDX_CASE_SENTRY_CASE_INST on ACT_RU_CASE_SENTRY_PART(CASE_INST_ID_);
-- create index ACT_IDX_CASE_SENTRY_CASE_EXEC on ACT_RU_CASE_SENTRY_PART(CASE_EXEC_ID_);

create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_);
create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_);