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 maven-resources-plugin from 2.6 to 3.2.0 in /webapps #74

Next Next commit
IBM Informix support.
  • Loading branch information
Frank Langelage authored and langfr committed Mar 6, 2021
commit 0fcab09606fb2246fbd707b298131a46ac391d41
40 changes: 40 additions & 0 deletions database/pom.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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,34 @@ 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 (");
databaseSpecificLimitAfterStatements.put(INFORMIX, ")");
databaseSpecificInnerLimitAfterStatements.put(INFORMIX, databaseSpecificLimitAfterStatements.get(INFORMIX));
databaseSpecificLimitBetweenStatements.put(INFORMIX, "");
databaseSpecificLimitBetweenClobStatements.put(INFORMIX, databaseSpecificLimitBetweenStatements.get(INFORMIX));
databaseSpecificOrderByStatements.put(INFORMIX, defaultOrderBy);
databaseSpecificLimitBeforeNativeQueryStatements.put(INFORMIX, "");

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");

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");
dbSpecificConstants.put(INFORMIX, constants);
}

protected String databaseType;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
-- create case definition table --

create table if not exists 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),
primary key (ID_)
);

-- create case execution table --

create table if not exists 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,
REPEATABLE_ boolean,
REPETITION_ boolean,
primary key (ID_)
);

-- create case sentry part table --

create table if not exists 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),
SATISFIED_ boolean,
primary key (ID_)
);

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

-- 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;

-- create foreign key constraints on ACT_RU_TASK --
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;

-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART --
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;

create index if not exists ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_);
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
create table ACT_HI_CASEINST (
ID_ varchar(64) not null,
CASE_INST_ID_ varchar(64) not null,
BUSINESS_KEY_ varchar(255),
CASE_DEF_ID_ varchar(64) not null,
CREATE_TIME_ datetime year to fraction(5) not null,
CLOSE_TIME_ datetime year to fraction(5),
DURATION_ bigint,
STATE_ integer,
CREATE_USER_ID_ varchar(255),
SUPER_CASE_INSTANCE_ID_ varchar(64),
SUPER_PROCESS_INSTANCE_ID_ varchar(64),
primary key (ID_),
unique (CASE_INST_ID_)
);

create table ACT_HI_CASEACTINST (
ID_ varchar(64) not null,
PARENT_ACT_INST_ID_ varchar(64),
CASE_DEF_ID_ varchar(64) not null,
CASE_INST_ID_ varchar(64) not null,
CASE_ACT_ID_ varchar(255) not null,
TASK_ID_ varchar(64),
CALL_PROC_INST_ID_ varchar(64),
CALL_CASE_INST_ID_ varchar(64),
CASE_ACT_NAME_ varchar(255),
CASE_ACT_TYPE_ varchar(255),
CREATE_TIME_ datetime year to fraction(5) not null,
END_TIME_ datetime year to fraction(5),
DURATION_ bigint,
STATE_ integer,
REQUIRED_ boolean,
REPEATABLE_ boolean,
REPETITION_ boolean,
primary key (ID_)
);

create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_);
create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_);
create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_);
create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_);
create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- create decision definition table --
create table ACT_RE_DECISION_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),
primary key (ID_)
);

create index if not exists ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_);
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
-- create history decision instance table --
create table ACT_HI_DECINST (
ID_ varchar(64) not null,
DEC_DEF_ID_ varchar(64) not null,
DEC_DEF_KEY_ varchar(255) not null,
DEC_DEF_NAME_ varchar(255),
PROC_DEF_KEY_ varchar(255),
PROC_DEF_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
CASE_DEF_KEY_ varchar(255),
CASE_DEF_ID_ varchar(64),
CASE_INST_ID_ varchar(64),
ACT_INST_ID_ varchar(64),
ACT_ID_ varchar(255),
EVAL_TIME_ datetime year to fraction(5) not null,
COLLECT_VALUE_ double precision,
USER_ID_ varchar(255),
TENANT_ID_ varchar(64),
primary key (ID_)
);

-- create history decision input table --
create table ACT_HI_DEC_IN (
ID_ varchar(64) not null,
DEC_INST_ID_ varchar(64) not null,
CLAUSE_ID_ varchar(64) not null,
CLAUSE_NAME_ varchar(255),
VAR_TYPE_ varchar(100),
BYTEARRAY_ID_ varchar(64),
DOUBLE_ double precision,
LONG_ bigint,
TEXT_ lvarchar(4000),
TEXT2_ lvarchar(4000),
TENANT_ID_ varchar(64),
primary key (ID_)
);

-- create history decision output table --
create table ACT_HI_DEC_OUT (
ID_ varchar(64) not null,
DEC_INST_ID_ varchar(64) not null,
CLAUSE_ID_ varchar(64) not null,
CLAUSE_NAME_ varchar(255),
RULE_ID_ varchar(64) not null,
RULE_ORDER_ integer,
VAR_NAME_ varchar(255),
VAR_TYPE_ varchar(100),
BYTEARRAY_ID_ varchar(64),
DOUBLE_ double precision,
LONG_ bigint,
TEXT_ lvarchar(4000),
TEXT2_ lvarchar(4000),
TENANT_ID_ varchar(64),
primary key (ID_)
);


create index if not exists ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_);
create index if not exists ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_);
create index if not exists ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_);
create index if not exists ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_);
create index if not exists ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_);
create index if not exists ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_);
create index if not exists ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_);
create index if not exists ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_);

create index if not exists ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_);
create index if not exists ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_);

create index if not exists ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_);
create index if not exists ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_);
Loading