diff --git a/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/history/HistoricCaseInstanceQuery.java b/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/history/HistoricCaseInstanceQuery.java index e272219558a..c9360327052 100644 --- a/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/history/HistoricCaseInstanceQuery.java +++ b/modules/flowable-cmmn-api/src/main/java/org/flowable/cmmn/api/history/HistoricCaseInstanceQuery.java @@ -60,6 +60,16 @@ public interface HistoricCaseInstanceQuery extends Query { CaseInstanceQuery caseDefinitionKey(String caseDefinitionKey); + CaseInstanceQuery caseDefinitionKeyLike(String caseDefinitionKeyLike); + CaseInstanceQuery caseDefinitionKeyLikeIgnoreCase(String caseDefinitionKeyLikeIgnoreCase); CaseInstanceQuery caseDefinitionKeys(Set caseDefinitionKeys); CaseInstanceQuery caseDefinitionId(String caseDefinitionId); CaseInstanceQuery caseDefinitionIds(Set caseDefinitionIds); CaseInstanceQuery caseDefinitionCategory(String caseDefinitionCategory); + CaseInstanceQuery caseDefinitionCategoryLike(String caseDefinitionCategoryLike); + CaseInstanceQuery caseDefinitionCategoryLikeIgnoreCase(String caseDefinitionCategoryLikeIgnoreCase); CaseInstanceQuery caseDefinitionName(String caseDefinitionName); + CaseInstanceQuery caseDefinitionNameLike(String caseDefinitionNameLike); + CaseInstanceQuery caseDefinitionNameLikeIgnoreCase(String caseDefinitionNameLikeIgnoreCase); CaseInstanceQuery caseDefinitionVersion(Integer caseDefinitionVersion); CaseInstanceQuery caseInstanceId(String caseInstanceId); CaseInstanceQuery caseInstanceIds(Set caseInstanceIds); @@ -39,7 +45,11 @@ public interface CaseInstanceQuery extends Query caseDefinitionKeys; protected Set caseDefinitionIds; protected String caseDefinitionName; + protected String caseDefinitionNameLike; + protected String caseDefinitionNameLikeIgnoreCase; protected String caseDefinitionCategory; + protected String caseDefinitionCategoryLike; + protected String caseDefinitionCategoryLikeIgnoreCase; protected Integer caseDefinitionVersion; protected String caseInstanceId; protected Set caseInstanceIds; @@ -66,7 +72,11 @@ public class HistoricCaseInstanceQueryImpl extends AbstractVariableQueryImpl caseDefinitionKeys) { @@ -590,6 +732,32 @@ public HistoricCaseInstanceQueryImpl caseInstanceTenantId(String tenantId) { } return this; } + + @Override + public HistoricCaseInstanceQueryImpl caseInstanceTenantIdLike(String tenantIdLike) { + if (tenantIdLike == null) { + throw new FlowableIllegalArgumentException("caseInstance tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLike = tenantIdLike; + } else { + this.tenantIdLike = tenantIdLike; + } + return this; + } + + @Override + public HistoricCaseInstanceQueryImpl caseInstanceTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + if (tenantIdLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("caseInstance tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } else { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } + return this; + } @Override public HistoricCaseInstanceQueryImpl caseInstanceWithoutTenantId() { @@ -1015,6 +1183,14 @@ public String getCaseDefinitionId() { public String getCaseDefinitionKey() { return caseDefinitionKey; } + + public String getCaseDefinitionKeyLike() { + return caseDefinitionKeyLike; + } + + public String getCaseDefinitionKeyLikeIgnoreCase() { + return caseDefinitionKeyLikeIgnoreCase; + } public Set getCaseDefinitionKeys() { return caseDefinitionKeys; @@ -1027,10 +1203,26 @@ public Set getCaseDefinitionIds() { public String getCaseDefinitionName() { return caseDefinitionName; } + + public String getCaseDefinitionNameLike() { + return caseDefinitionNameLike; + } + + public String getCaseDefinitionNameLikeIgnoreCase() { + return caseDefinitionNameLikeIgnoreCase; + } public String getCaseDefinitionCategory() { return caseDefinitionCategory; } + + public String getCaseDefinitionCategoryLike() { + return caseDefinitionCategoryLike; + } + + public String getCaseDefinitionCategoryLikeIgnoreCase() { + return caseDefinitionCategoryLikeIgnoreCase; + } public Integer getCaseDefinitionVersion() { return caseDefinitionVersion; @@ -1061,9 +1253,25 @@ public String getBusinessKey() { return businessKey; } + public String getBusinessKeyLike() { + return businessKeyLike; + } + + public String getBusinessKeyLikeIgnoreCase() { + return businessKeyLikeIgnoreCase; + } + public String getBusinessStatus() { return businessStatus; } + + public String getBusinessStatusLike() { + return businessStatusLike; + } + + public String getBusinessStatusLikeIgnoreCase() { + return businessStatusLikeIgnoreCase; + } public String getCaseInstanceParentId() { return caseInstanceParentId; @@ -1140,6 +1348,14 @@ public String getReferenceType() { public String getTenantId() { return tenantId; } + + public String getTenantIdLike() { + return tenantIdLike; + } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } public boolean isWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java index 9eaee2a748d..2d3a6041bea 100644 --- a/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java +++ b/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/runtime/CaseInstanceQueryImpl.java @@ -44,10 +44,16 @@ public class CaseInstanceQueryImpl extends AbstractVariableQueryImpl caseDefinitionKeys; protected Set caseDefinitionIds; protected String caseDefinitionCategory; + protected String caseDefinitionCategoryLike; + protected String caseDefinitionCategoryLikeIgnoreCase; protected String caseDefinitionName; + protected String caseDefinitionNameLike; + protected String caseDefinitionNameLikeIgnoreCase; protected Integer caseDefinitionVersion; protected String name; protected String nameLike; @@ -55,7 +61,11 @@ public class CaseInstanceQueryImpl extends AbstractVariableQueryImpl caseInstanceIds; protected String caseInstanceParentId; @@ -74,6 +84,7 @@ public class CaseInstanceQueryImpl extends AbstractVariableQueryImpl caseDefinitionKeys) { @@ -521,6 +666,19 @@ public CaseInstanceQueryImpl caseInstanceTenantIdLike(String tenantIdLike) { return this; } + @Override + public CaseInstanceQueryImpl caseInstanceTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + if (tenantIdLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } else { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } + return this; + } + @Override public CaseInstanceQueryImpl caseInstanceWithoutTenantId() { if (inOrStatement) { @@ -864,6 +1022,14 @@ public void enhanceCachedValue(CaseInstanceEntity caseInstance) { public String getCaseDefinitionKey() { return caseDefinitionKey; } + + public String getCaseDefinitionKeyLike() { + return caseDefinitionKeyLike; + } + + public String getCaseDefinitionKeyLikeIgnoreCase() { + return caseDefinitionKeyLikeIgnoreCase; + } public String getCaseDefinitionId() { return caseDefinitionId; @@ -872,10 +1038,26 @@ public String getCaseDefinitionId() { public String getCaseDefinitionCategory() { return caseDefinitionCategory; } + + public String getCaseDefinitionCategoryLike() { + return caseDefinitionCategoryLike; + } + + public String getCaseDefinitionCategoryLikeIgnoreCase() { + return caseDefinitionCategoryLikeIgnoreCase; + } public String getCaseDefinitionName() { return caseDefinitionName; } + + public String getCaseDefinitionNameLike() { + return caseDefinitionNameLike; + } + + public String getCaseDefinitionNameLikeIgnoreCase() { + return caseDefinitionNameLikeIgnoreCase; + } public Integer getCaseDefinitionVersion() { return caseDefinitionVersion; @@ -897,10 +1079,26 @@ public Set getCaseInstanceIds() { public String getBusinessKey() { return businessKey; } + + public String getBusinessKeyLike() { + return businessKeyLike; + } + + public String getBusinessKeyLikeIgnoreCase() { + return businessKeyLikeIgnoreCase; + } public String getBusinessStatus() { return businessStatus; } + + public String getBusinessStatusLike() { + return businessStatusLike; + } + + public String getBusinessStatusLikeIgnoreCase() { + return businessStatusLikeIgnoreCase; + } public Date getLastReactivatedBefore() { return lastReactivatedBefore; @@ -981,6 +1179,10 @@ public String getTenantId() { public String getTenantIdLike() { return tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } public boolean isWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CaseInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CaseInstance.xml index cf8be50c10f..791a56b839e 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CaseInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/CaseInstance.xml @@ -362,6 +362,12 @@ and CASE_DEF.KEY_ = #{caseDefinitionKey, jdbcType=VARCHAR} + + and CASE_DEF.KEY_ like #{caseDefinitionKeyLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.KEY_) like lower(#{caseDefinitionKeyLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and RES.CASE_DEF_ID_ IN @@ -377,9 +383,21 @@ and CASE_DEF.CATEGORY_ = #{caseDefinitionCategory, jdbcType=VARCHAR} + + and CASE_DEF.CATEGORY_ like #{caseDefinitionCategoryLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.CATEGORY_) like lower(#{caseDefinitionCategoryLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and CASE_DEF.NAME_ = #{caseDefinitionName, jdbcType=VARCHAR} + + and CASE_DEF.NAME_ like #{caseDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.NAME_) like lower(#{caseDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and CASE_DEF.VERSION_ = #{caseDefinitionVersion, jdbcType=INTEGER} @@ -411,9 +429,21 @@ and RES.BUSINESS_KEY_ = #{businessKey, jdbcType=VARCHAR} + + and RES.BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(RES.BUSINESS_KEY_) like lower(#{businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and RES.BUSINESS_STATUS_ = #{businessStatus, jdbcType=VARCHAR} + + and RES.BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(RES.BUSINESS_STATUS_) like lower(#{businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and RES.START_TIME_ <= #{startedBefore, jdbcType=TIMESTAMP} @@ -456,6 +486,9 @@ and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR} + + and lower(RES.TENANT_ID_) like lower(#{tenantIdLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and (RES.TENANT_ID_ is null or RES.TENANT_ID_ = '') @@ -608,6 +641,12 @@ or CASE_DEF.KEY_ = #{orQueryObject.caseDefinitionKey, jdbcType=VARCHAR} + + or CASE_DEF.KEY_ like #{orQueryObject.caseDefinitionKeyLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.KEY_) like lower(#{orQueryObject.caseDefinitionKeyLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + or RES.CASE_DEF_ID_ IN @@ -623,9 +662,21 @@ or CASE_DEF.CATEGORY_ = #{orQueryObject.caseDefinitionCategory, jdbcType=VARCHAR} + + or CASE_DEF.CATEGORY_ like #{orQueryObject.caseDefinitionCategoryLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.CATEGORY_) like lower(#{orQueryObject.caseDefinitionCategoryLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + or CASE_DEF.NAME_ = #{orQueryObject.caseDefinitionName, jdbcType=VARCHAR} + + or CASE_DEF.NAME_ like #{orQueryObject.caseDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.NAME_) like lower(#{orQueryObject.caseDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or CASE_DEF.VERSION_ = #{orQueryObject.caseDefinitionVersion, jdbcType=INTEGER} @@ -644,9 +695,21 @@ or RES.BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=VARCHAR} + + or RES.BUSINESS_KEY_ like #{orQueryObject.businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(RES.BUSINESS_KEY_) like lower(#{orQueryObject.businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or RES.BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=VARCHAR} + + or RES.BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(RES.BUSINESS_STATUS_) like lower(#{orQueryObject.businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or RES.START_TIME_ <= #{orQueryObject.startedBefore, jdbcType=TIMESTAMP} @@ -687,7 +750,10 @@ or RES.TENANT_ID_ = #{orQueryObject.tenantId, jdbcType=VARCHAR} - or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=VARCHAR} + or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(RES.TENANT_ID_) like lower(#{orQueryObject.tenantIdLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} or (RES.TENANT_ID_ is null or RES.TENANT_ID_ = '') diff --git a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml index 1bee6a23ab3..ca7d56d886a 100644 --- a/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml +++ b/modules/flowable-cmmn-engine/src/main/resources/org/flowable/cmmn/db/mapping/entity/HistoricCaseInstance.xml @@ -335,6 +335,12 @@ and CASE_DEF.KEY_ = #{caseDefinitionKey, jdbcType=VARCHAR} + + and CASE_DEF.KEY_ like #{caseDefinitionKeyLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.KEY_) like lower(#{caseDefinitionKeyLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and CASE_DEF.KEY_ IN @@ -344,9 +350,21 @@ and CASE_DEF.CATEGORY_ = #{caseDefinitionCategory, jdbcType=VARCHAR} + + and CASE_DEF.CATEGORY_ like #{caseDefinitionCategoryLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.CATEGORY_) like lower(#{caseDefinitionCategoryLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and CASE_DEF.NAME_ = #{caseDefinitionName, jdbcType=VARCHAR} + + and CASE_DEF.NAME_ like #{caseDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(CASE_DEF.NAME_) like lower(#{caseDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and CASE_DEF.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=VARCHAR} @@ -459,6 +477,12 @@ or CASE_DEF.KEY_ = #{orQueryObject.caseDefinitionKey, jdbcType=VARCHAR} + + or CASE_DEF.KEY_ like #{orQueryObject.caseDefinitionKeyLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.KEY_) like lower(#{orQueryObject.caseDefinitionKeyLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + or CASE_DEF.KEY_ IN @@ -468,9 +492,21 @@ or CASE_DEF.CATEGORY_ = #{orQueryObject.caseDefinitionCategory, jdbcType=VARCHAR} + + or CASE_DEF.CATEGORY_ like #{orQueryObject.caseDefinitionCategoryLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.CATEGORY_) like lower(#{orQueryObject.caseDefinitionCategoryLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + or CASE_DEF.NAME_ = #{orQueryObject.caseDefinitionName, jdbcType=VARCHAR} + + or CASE_DEF.NAME_ like #{orQueryObject.caseDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(CASE_DEF.NAME_) like lower(#{orQueryObject.caseDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or CASE_DEF.VERSION_ = #{orQueryObject.caseDefinitionVersion, jdbcType=INTEGER} @@ -638,9 +674,21 @@ and ${queryTablePrefix}BUSINESS_KEY_ = #{businessKey, jdbcType=VARCHAR} + + and ${queryTablePrefix}BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(${queryTablePrefix}BUSINESS_KEY_) like lower(#{businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus, jdbcType=VARCHAR} + + and ${queryTablePrefix}BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(${queryTablePrefix}BUSINESS_STATUS_) like lower(#{businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and ${queryTablePrefix}END_TIME_ is not null @@ -692,6 +740,12 @@ and ${queryTablePrefix}TENANT_ID_ = #{tenantId, jdbcType=VARCHAR} + + and ${queryTablePrefix}TENANT_ID_ like #{tenantIdLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + and lower(${queryTablePrefix}TENANT_ID_) like lower(#{tenantIdLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + and (${queryTablePrefix}TENANT_ID_ is null or ${queryTablePrefix}TENANT_ID_ = '') @@ -773,9 +827,21 @@ or ${queryTablePrefix}BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=VARCHAR} + + or ${queryTablePrefix}BUSINESS_KEY_ like #{orQueryObject.businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(${queryTablePrefix}BUSINESS_KEY_) like lower(#{orQueryObject.businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=VARCHAR} + + or ${queryTablePrefix}BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(${queryTablePrefix}BUSINESS_STATUS_) like lower(#{orQueryObject.businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or ${queryTablePrefix}END_TIME_ is not null @@ -827,6 +893,12 @@ or ${queryTablePrefix}TENANT_ID_ = #{orQueryObject.tenantId, jdbcType=VARCHAR} + + or ${queryTablePrefix}TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=VARCHAR}${wildcardEscapeClause} + + + or lower(${queryTablePrefix}TENANT_ID_) like lower(#{orQueryObject.tenantIdLikeIgnoreCase, jdbcType=VARCHAR})${wildcardEscapeClause} + or (${queryTablePrefix}TENANT_ID_ is null or ${queryTablePrefix}TENANT_ID_ = '') diff --git a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoricCaseInstanceQueryImplTest.java b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoricCaseInstanceQueryImplTest.java index 728b29d72f3..a0ba0d005d8 100644 --- a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoricCaseInstanceQueryImplTest.java +++ b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoricCaseInstanceQueryImplTest.java @@ -98,6 +98,72 @@ public void getCaseInstanceByCaseDefinitionKey() { .isEqualTo(caseInstance.getId()); } } + + @Test + public void getCaseInstanceByCaseDefinitionKeyLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionKeyLike("oneTask%") + .caseInstanceId("Undefined") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionKeyLike("oneTask%") + .caseInstanceId("Undefined") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLike("none%").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseDefinitionKeyLike("none%").caseInstanceId("Undefined").endOr().list()).hasSize(0); + } + } + + @Test + public void getCaseInstanceByCaseDefinitionKeyLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionKeyLikeIgnoreCase("onetask%") + .caseInstanceId("Undefined") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionKeyLikeIgnoreCase("onetask%") + .caseInstanceId("Undefined") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("none%").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseDefinitionKeyLikeIgnoreCase("none%").caseInstanceId("Undefined").endOr().list()).hasSize(0); + } + } @Test public void getCaseInstanceByCaseInstanceName() { @@ -262,6 +328,72 @@ public void getCaseInstanceByCaseDefinitionName() { .isEqualTo(caseInstance.getId()); } } + + @Test + public void getCaseInstanceByCaseDefinitionNameLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLike("oneTask%").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLike("oneTask%").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLike("oneTask%").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionNameLike("oneTask%") + .caseInstanceId("undefined") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionNameLike("oneTask%") + .caseInstanceId("undefined") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLike("none%").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseDefinitionNameLike("none%").caseInstanceId("undefined").endOr().list()).hasSize(0); + } + } + + @Test + public void getCaseInstanceByCaseDefinitionNameLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionNameLikeIgnoreCase("onetask%") + .caseInstanceId("undefined") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseDefinitionNameLikeIgnoreCase("onetask%") + .caseInstanceId("undefined") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("none%").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseDefinitionNameLikeIgnoreCase("none%").caseInstanceId("undefined").endOr().list()).hasSize(0); + } + } @Test public void getCaseInstanceByCaseDefinitionId() { @@ -482,6 +614,74 @@ public void getCaseInstanceByBusinessKey() { } } + @Test + public void getCaseInstanceByBusinessKeyLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .businessKey("businessKey") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLike("%Key").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLike("%Key").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLike("%Key").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLike("%Key") + .caseDefinitionName("undefinedId") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLike("%Key") + .caseDefinitionName("undefinedId") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLike("%none").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseInstanceBusinessKeyLike("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + } + + @Test + public void getCaseInstanceByBusinessKeyLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .businessKey("businessKey") + .start(); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLikeIgnoreCase("%key") + .caseDefinitionName("undefinedId") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLikeIgnoreCase("%key") + .caseDefinitionName("undefinedId") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%none").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseInstanceBusinessKeyLikeIgnoreCase("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + } + @Test public void getCaseInstanceByBusinessStatus() { CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() @@ -520,6 +720,41 @@ public void getCaseInstanceByBusinessStatus() { .isNull(); } } + + @Test + public void getCaseInstanceByBusinessStatusLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + cmmnRuntimeService.updateBusinessStatus(caseInstance.getId(), "businessStatus"); + + if (CmmnHistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, cmmnEngineConfiguration)) { + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").count()).isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLike("%Status") + .caseDefinitionName("undefinedId") + .endOr() + .count()) + .isEqualTo(1); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLike("%Status") + .caseDefinitionName("undefinedId") + .endOr() + .list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceBusinessStatusLike("%none").list()).hasSize(0); + assertThat(cmmnHistoryService.createHistoricCaseInstanceQuery().or().caseInstanceBusinessStatusLike("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + } @Test public void getCaseInstanceByParentId() { diff --git a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoryDataDeleteTest.java b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoryDataDeleteTest.java index 578fea74005..c8ae1c59505 100644 --- a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoryDataDeleteTest.java +++ b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/history/HistoryDataDeleteTest.java @@ -882,7 +882,11 @@ public void testDeleteHistoricInstancesWithAllQueryOptions() throws InvocationTa // If this test fails verify that the properties that are missing are added to DeleteHistoricCaseInstancesUsingBatchesCmd and BatchDeleteCaseConfig Map methodNameToExpectedQueryPropertyName = new HashMap<>(); methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessKey", "businessKey"); + methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessKeyLike", "businessKeyLike"); + methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessKeyLikeIgnoreCase", "businessKeyLikeIgnoreCase"); methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessStatus", "businessStatus"); + methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessStatusLike", "businessStatusLike"); + methodNameToExpectedQueryPropertyName.put("caseInstanceBusinessStatusLikeIgnoreCase", "businessStatusLikeIgnoreCase"); methodNameToExpectedQueryPropertyName.put("caseInstanceCallbackType", "callbackType"); methodNameToExpectedQueryPropertyName.put("caseInstanceCallbackId", "callbackId"); methodNameToExpectedQueryPropertyName.put("withoutCaseInstanceCallbackId", "withoutCallbackId"); @@ -890,6 +894,8 @@ public void testDeleteHistoricInstancesWithAllQueryOptions() throws InvocationTa methodNameToExpectedQueryPropertyName.put("caseInstanceReferenceId", "referenceId"); methodNameToExpectedQueryPropertyName.put("caseInstanceWithoutTenantId", "withoutTenantId"); methodNameToExpectedQueryPropertyName.put("caseInstanceTenantId", "tenantId"); + methodNameToExpectedQueryPropertyName.put("caseInstanceTenantIdLike", "tenantIdLike"); + methodNameToExpectedQueryPropertyName.put("caseInstanceTenantIdLikeIgnoreCase", "tenantIdLikeIgnoreCase"); methodNameToExpectedQueryPropertyName.put("withoutCaseInstanceParent", "withoutCaseInstanceParentId"); Set methodsToIgnore = new HashSet<>(); methodsToIgnore.add("limitCaseVariables"); diff --git a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/runtime/CaseInstanceQueryImplTest.java b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/runtime/CaseInstanceQueryImplTest.java index b742ec02a47..8cddf467440 100644 --- a/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/runtime/CaseInstanceQueryImplTest.java +++ b/modules/flowable-cmmn-engine/src/test/java/org/flowable/cmmn/test/runtime/CaseInstanceQueryImplTest.java @@ -89,6 +89,50 @@ public void getCaseInstanceByCaseDefinitionKey() { cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKey("oneTaskCase").caseInstanceId("Undefined").endOr().singleResult().getId()) .isEqualTo(caseInstance.getId()); } + + @Test + public void getCaseInstanceByCaseDefinitionKeyLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLike("oneTask%").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLike("oneTask%").caseInstanceId("Undefined").endOr().count()) + .isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLike("oneTask%").caseInstanceId("Undefined").endOr().list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat( + cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLike("oneTask%").caseInstanceId("Undefined").endOr().singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLike("none%").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLike("none%").caseInstanceId("Undefined").endOr().list()).hasSize(0); + } + + @Test + public void getCaseInstanceByCaseDefinitionKeyLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("onetask%").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLikeIgnoreCase("onetask%").caseInstanceId("Undefined").endOr().count()) + .isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLikeIgnoreCase("onetask%").caseInstanceId("Undefined").endOr().list().get(0).getId()) + .isEqualTo(caseInstance.getId()); + assertThat( + cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLikeIgnoreCase("onetask%").caseInstanceId("Undefined").endOr().singleResult().getId()) + .isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionKeyLikeIgnoreCase("none%").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionKeyLikeIgnoreCase("none%").caseInstanceId("Undefined").endOr().list()).hasSize(0); + } @Test public void getCaseInstanceByCaseDefinitionKeys() { @@ -142,6 +186,58 @@ public void getCaseInstanceByCaseDefinitionCategory() { .endOr() .list()).hasSize(2); } + + @Test + public void getCaseInstanceByCaseDefinitionCategoryLike() { + cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLike("%cmmn").count()).isEqualTo(2); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLike("%cmmn").list()).hasSize(2); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionCategoryLike("%cmmn") + .caseInstanceId("undefined") + .endOr() + .count()).isEqualTo(2); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionCategoryLike("%cmmn") + .caseInstanceId("undefined") + .endOr() + .list()).hasSize(2); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLike("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionCategoryLike("%none").caseInstanceId("undefined").endOr().list()).hasSize(0); + } + + @Test + public void getCaseInstanceByCaseDefinitionCategoryLikeIgnoreCase() { + cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLikeIgnoreCase("%cmmn").count()).isEqualTo(2); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLikeIgnoreCase("%cmmn").list()).hasSize(2); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionCategoryLikeIgnoreCase("%cmmn") + .caseInstanceId("undefined") + .endOr() + .count()).isEqualTo(2); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionCategoryLikeIgnoreCase("%cmmn") + .caseInstanceId("undefined") + .endOr() + .list()).hasSize(2); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionCategoryLikeIgnoreCase("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionCategoryLikeIgnoreCase("%none").caseInstanceId("undefined").endOr().list()).hasSize(0); + } @Test public void getCaseInstanceByCaseDefinitionName() { @@ -172,6 +268,60 @@ public void getCaseInstanceByCaseDefinitionName() { .endOr() .singleResult().getId()).isEqualTo(caseInstance.getId()); } + + @Test + public void getCaseInstanceByCaseDefinitionNameLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLike("oneTask%").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLike("oneTask%").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLike("oneTask%").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionNameLike("oneTask%") + .caseInstanceId("undefined") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionNameLike("oneTask%") + .caseInstanceId("undefined") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLike("none%").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionNameLike("none%").caseInstanceId("undefined").endOr().list()).hasSize(0); + } + + @Test + public void getCaseInstanceByCaseDefinitionNameLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("onetask%").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionNameLikeIgnoreCase("onetask%") + .caseInstanceId("undefined") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseDefinitionNameLikeIgnoreCase("onetask%") + .caseInstanceId("undefined") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseDefinitionNameLikeIgnoreCase("none%").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseDefinitionNameLikeIgnoreCase("none%").caseInstanceId("undefined").endOr().list()).hasSize(0); + } @Test public void getCaseInstanceByCaseDefinitionId() { @@ -325,6 +475,62 @@ public void getCaseInstanceByBusinessKey() { .singleResult().getId()).isEqualTo(caseInstance.getId()); } + @Test + public void getCaseInstanceByBusinessKeyLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .businessKey("businessKey") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLike("business%").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLike("business%").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLike("business%").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLike("business%") + .caseDefinitionName("undefinedId") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLike("business%") + .caseDefinitionName("undefinedId") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLike("none%").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseInstanceBusinessKeyLike("none%").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + + @Test + public void getCaseInstanceByBusinessKeyLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .businessKey("businessKey") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%key").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLikeIgnoreCase("%key") + .caseDefinitionName("undefinedId") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessKeyLikeIgnoreCase("%key") + .caseDefinitionName("undefinedId") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessKeyLikeIgnoreCase("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseInstanceBusinessKeyLikeIgnoreCase("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + @Test public void getCaseInstanceByBusinessStatus() { CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() @@ -356,6 +562,64 @@ public void getCaseInstanceByBusinessStatus() { .endOr() .singleResult()).isNull(); } + + @Test + public void getCaseInstanceByBusinessStatusLike() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + cmmnRuntimeService.updateBusinessStatus(caseInstance.getId(), "businessStatus"); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLike("%Status").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLike("%Status") + .caseDefinitionName("undefinedId") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLike("%Status") + .caseDefinitionName("undefinedId") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLike("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseInstanceBusinessStatusLike("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } + + @Test + public void getCaseInstanceByBusinessStatusLikeIgnoreCase() { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .start(); + + cmmnRuntimeService.updateBusinessStatus(caseInstance.getId(), "businessStatus"); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLikeIgnoreCase("%status").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLikeIgnoreCase("%status").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLikeIgnoreCase("%status").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLikeIgnoreCase("%status") + .caseDefinitionName("undefinedId") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceBusinessStatusLikeIgnoreCase("%status") + .caseDefinitionName("undefinedId") + .endOr() + .list()).hasSize(1); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceBusinessStatusLikeIgnoreCase("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseInstanceBusinessStatusLikeIgnoreCase("%none").caseDefinitionName("undefinedId").endOr().list()).hasSize(0); + } @Test public void getCaseInstanceByStartedBefore() { @@ -726,6 +990,51 @@ public void getCaseInstanceByTenantIdLike() { cmmnRepositoryService.deleteDeployment(tempDeploymentId, true); } } + + @Test + public void getCaseInstanceByTenantIdLikeIgnoreCase() { + String tempDeploymentId = cmmnRepositoryService.createDeployment() + .addClasspathResource("org/flowable/cmmn/test/runtime/CaseTaskTest.testBasicBlocking.cmmn") + .addClasspathResource("org/flowable/cmmn/test/runtime/oneTaskCase.cmmn") + .tenantId("tenantId") + .deploy() + .getId(); + try { + CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder() + .caseDefinitionKey("oneTaskCase") + .tenantId("tenantId") + .start(); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceTenantIdLikeIgnoreCase("%id").count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceTenantIdLikeIgnoreCase("%id").list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceTenantIdLikeIgnoreCase("%id").singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceTenantIdLikeIgnoreCase("%id") + .caseDefinitionName("undefinedId") + .endOr() + .count()).isEqualTo(1); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceTenantIdLikeIgnoreCase("%id") + .caseDefinitionName("undefinedId") + .endOr() + .list().get(0).getId()).isEqualTo(caseInstance.getId()); + assertThat(cmmnRuntimeService.createCaseInstanceQuery() + .or() + .caseInstanceTenantIdLikeIgnoreCase("%id") + .caseDefinitionId("undefined") + .endOr() + .singleResult().getId()).isEqualTo(caseInstance.getId()); + + assertThat(cmmnRuntimeService.createCaseInstanceQuery().caseInstanceTenantIdLikeIgnoreCase("%none").list()).hasSize(0); + assertThat(cmmnRuntimeService.createCaseInstanceQuery().or().caseInstanceTenantIdLikeIgnoreCase("%none").caseDefinitionId("undefined").endOr().list()).hasSize(0); + + } finally { + cmmnRepositoryService.deleteDeployment(tempDeploymentId, true); + } + } @Test public void getCaseInstanceWithoutTenantId() { diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java index 60f5b37ab23..7a7d2e9020b 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceBaseResource.java @@ -77,6 +77,12 @@ protected DataResponse getQueryResponse(HistoricCa if (queryRequest.getCaseDefinitionKey() != null) { query.caseDefinitionKey(queryRequest.getCaseDefinitionKey()); } + if (queryRequest.getCaseDefinitionKeyLike() != null) { + query.caseDefinitionKeyLike(queryRequest.getCaseDefinitionKeyLike()); + } + if (queryRequest.getCaseDefinitionKeyLikeIgnoreCase() != null) { + query.caseDefinitionKeyLikeIgnoreCase(queryRequest.getCaseDefinitionKeyLikeIgnoreCase()); + } if (queryRequest.getCaseDefinitionKeys() != null && !queryRequest.getCaseDefinitionKeys().isEmpty()) { query.caseDefinitionKeys(queryRequest.getCaseDefinitionKeys()); } @@ -86,9 +92,21 @@ protected DataResponse getQueryResponse(HistoricCa if (queryRequest.getCaseDefinitionCategory() != null) { query.caseDefinitionCategory(queryRequest.getCaseDefinitionCategory()); } + if (queryRequest.getCaseDefinitionCategoryLike() != null) { + query.caseDefinitionCategoryLike(queryRequest.getCaseDefinitionCategoryLike()); + } + if (queryRequest.getCaseDefinitionCategoryLikeIgnoreCase() != null) { + query.caseDefinitionCategoryLikeIgnoreCase(queryRequest.getCaseDefinitionCategoryLikeIgnoreCase()); + } if (queryRequest.getCaseDefinitionName() != null) { query.caseDefinitionName(queryRequest.getCaseDefinitionName()); } + if (queryRequest.getCaseDefinitionNameLike() != null) { + query.caseDefinitionNameLike(queryRequest.getCaseDefinitionNameLike()); + } + if (queryRequest.getCaseDefinitionNameLikeIgnoreCase() != null) { + query.caseDefinitionNameLikeIgnoreCase(queryRequest.getCaseDefinitionNameLikeIgnoreCase()); + } if (queryRequest.getCaseBusinessKey() != null) { query.caseInstanceBusinessKey(queryRequest.getCaseBusinessKey()); } @@ -110,9 +128,21 @@ protected DataResponse getQueryResponse(HistoricCa if (queryRequest.getCaseInstanceBusinessKey() != null) { query.caseInstanceBusinessKey(queryRequest.getCaseInstanceBusinessKey()); } + if (queryRequest.getCaseInstanceBusinessKeyLike() != null) { + query.caseInstanceBusinessKeyLike(queryRequest.getCaseInstanceBusinessKeyLike()); + } + if (queryRequest.getCaseInstanceBusinessKeyLikeIgnoreCase() != null) { + query.caseInstanceBusinessKeyLikeIgnoreCase(queryRequest.getCaseInstanceBusinessKeyLikeIgnoreCase()); + } if (queryRequest.getCaseInstanceBusinessStatus() != null) { query.caseInstanceBusinessStatus(queryRequest.getCaseInstanceBusinessStatus()); } + if (queryRequest.getCaseInstanceBusinessStatusLike() != null) { + query.caseInstanceBusinessStatusLike(queryRequest.getCaseInstanceBusinessStatusLike()); + } + if (queryRequest.getCaseInstanceBusinessStatusLikeIgnoreCase() != null) { + query.caseInstanceBusinessStatusLikeIgnoreCase(queryRequest.getCaseInstanceBusinessStatusLikeIgnoreCase()); + } if (queryRequest.getCaseInstanceParentId() != null) { query.caseInstanceParentId(queryRequest.getCaseInstanceParentId()); } @@ -179,6 +209,12 @@ protected DataResponse getQueryResponse(HistoricCa if (queryRequest.getTenantId() != null) { query.caseInstanceTenantId(queryRequest.getTenantId()); } + if (queryRequest.getTenantIdLike() != null) { + query.caseInstanceTenantIdLike(queryRequest.getTenantIdLike()); + } + if (queryRequest.getTenantIdLikeIgnoreCase() != null) { + query.caseInstanceTenantIdLikeIgnoreCase(queryRequest.getTenantIdLikeIgnoreCase()); + } if (Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) { query.caseInstanceWithoutTenantId(); diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceCollectionResource.java index c14507b71bb..bb1d2e12060 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceCollectionResource.java @@ -47,16 +47,26 @@ public class HistoricCaseInstanceCollectionResource extends HistoricCaseInstance @ApiImplicitParams({ @ApiImplicitParam(name = "caseInstanceId", dataType = "string", value = "An id of the historic case instance.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionKey", dataType = "string", value = "The case definition key of the historic case instance.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionKeyLike", dataType = "string", value = "Only return historic case instances like the given case definition key.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionKeyLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given case definition key, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionId", dataType = "string", value = "The case definition id of the historic case instance.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionCategory", dataType = "string", value = "Only return historic case instances with the given case definition category.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionCategoryLike", dataType = "string", value = "Only return historic case instances like the given case definition category.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionCategoryLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given case definition category, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionName", dataType = "string", value = "Only return historic case instances with the given case definition name.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionNameLike", dataType = "string", value = "Only return historic case instances like the given case definition name.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionNameLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given case definition name, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return historic case instances with the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return historic case instances like the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given name ignoring case.", paramType = "query"), @ApiImplicitParam(name = "rootScopeId", dataType = "string", value = "Only return case instances which have the given root scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "parentScopeId", dataType = "string", value = "Only return case instances which have the given parent scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "businessKey", dataType = "string", value = "The business key of the historic case instance.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return historic case instances like the given business key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given business key, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "businessStatus", dataType = "string", value = "The business status of the historic case instance.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLike", dataType = "string", value = "Only return historic case instances like the given business status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLikeIgnoreCase", dataType = "string", value = "Only return historic case instances like the given business status, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "involvedUser", dataType = "string", value = "An involved user of the historic case instance.", paramType = "query"), @ApiImplicitParam(name = "finished", dataType = "boolean", value = "Indication if the historic case instance is finished.", paramType = "query"), @ApiImplicitParam(name = "finishedAfter", dataType = "string", format="date-time", value = "Return only historic case instances that were finished after this date.", paramType = "query"), @@ -74,7 +84,9 @@ public class HistoricCaseInstanceCollectionResource extends HistoricCaseInstance @ApiImplicitParam(name = "lastReactivatedAfter", dataType = "string", format = "date-time", value = "Only return historic case instances last reactivated after the given date.", paramType = "query"), @ApiImplicitParam(name = "activePlanItemDefinitionId", dataType = "string", value = "Only return historic case instances that have an active plan item instance with the given plan item definition id.", paramType = "query"), @ApiImplicitParam(name = "includeCaseVariables", dataType = "boolean", value = "An indication if the historic case instance variables should be returned as well.", paramType = "query"), - @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return instances with the given tenantId.", paramType = "query"), + @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return instances with the given tenant id.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return instances like the given tenant id.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLikeIgnoreCase", dataType = "string", value = "Only return instances like the given tenant id, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns instances without a tenantId set. If false, the withoutTenantId parameter is ignored.\n", paramType = "query"), @ApiImplicitParam(name = "withoutCaseInstanceParentId", dataType = "boolean", value = "If true, only returns instances without a parent set. If false, the withoutCaseInstanceParentId parameter is ignored.\n", paramType = "query"), @ApiImplicitParam(name = "withoutCaseInstanceCallbackId", dataType = "boolean", value = "If true, only returns instances without a callbackId set. If false, the withoutCaseInstanceCallbackId parameter is ignored.\n", paramType = "query") @@ -94,6 +106,14 @@ public DataResponse getHistoricCasenstances(@ApiPa if (allRequestParams.get("caseDefinitionKey") != null) { queryRequest.setCaseDefinitionKey(allRequestParams.get("caseDefinitionKey")); } + + if (allRequestParams.get("caseDefinitionKeyLike") != null) { + queryRequest.setCaseDefinitionKeyLike(allRequestParams.get("caseDefinitionKeyLike")); + } + + if (allRequestParams.get("caseDefinitionKeyLikeIgnoreCase") != null) { + queryRequest.setCaseDefinitionKeyLikeIgnoreCase(allRequestParams.get("caseDefinitionKeyLikeIgnoreCase")); + } if (allRequestParams.get("caseDefinitionId") != null) { queryRequest.setCaseDefinitionId(allRequestParams.get("caseDefinitionId")); @@ -103,10 +123,26 @@ public DataResponse getHistoricCasenstances(@ApiPa queryRequest.setCaseDefinitionCategory(allRequestParams.get("caseDefinitionCategory")); } + if (allRequestParams.get("caseDefinitionCategoryLike") != null) { + queryRequest.setCaseDefinitionCategoryLike(allRequestParams.get("caseDefinitionCategoryLike")); + } + + if (allRequestParams.get("caseDefinitionCategoryLikeIgnoreCase") != null) { + queryRequest.setCaseDefinitionCategoryLikeIgnoreCase(allRequestParams.get("caseDefinitionCategoryLikeIgnoreCase")); + } + if (allRequestParams.get("caseDefinitionName") != null) { queryRequest.setCaseDefinitionName(allRequestParams.get("caseDefinitionName")); } + if (allRequestParams.get("caseDefinitionNameLike") != null) { + queryRequest.setCaseDefinitionNameLike(allRequestParams.get("caseDefinitionNameLike")); + } + + if (allRequestParams.get("caseDefinitionNameLikeIgnoreCase") != null) { + queryRequest.setCaseDefinitionNameLikeIgnoreCase(allRequestParams.get("caseDefinitionNameLikeIgnoreCase")); + } + if (allRequestParams.get("name") != null) { queryRequest.setCaseInstanceName(allRequestParams.get("name")); } @@ -123,9 +159,25 @@ public DataResponse getHistoricCasenstances(@ApiPa queryRequest.setCaseInstanceBusinessKey(allRequestParams.get("businessKey")); } + if (allRequestParams.get("businessKeyLike") != null) { + queryRequest.setCaseInstanceBusinessKeyLike(allRequestParams.get("businessKeyLike")); + } + + if (allRequestParams.get("businessKeyLikeIgnoreCase") != null) { + queryRequest.setCaseInstanceBusinessKeyLikeIgnoreCase(allRequestParams.get("businessKeyLikeIgnoreCase")); + } + if (allRequestParams.get("businessStatus") != null) { queryRequest.setCaseInstanceBusinessStatus(allRequestParams.get("businessStatus")); } + + if (allRequestParams.get("businessStatusLike") != null) { + queryRequest.setCaseInstanceBusinessStatusLike(allRequestParams.get("businessStatusLike")); + } + + if (allRequestParams.get("businessStatusLikeIgnoreCase") != null) { + queryRequest.setCaseInstanceBusinessStatusLikeIgnoreCase(allRequestParams.get("businessStatusLikeIgnoreCase")); + } if (allRequestParams.containsKey("rootScopeId")) { queryRequest.setCaseInstanceRootScopeId(allRequestParams.get("rootScopeId")); @@ -206,6 +258,14 @@ public DataResponse getHistoricCasenstances(@ApiPa if (allRequestParams.get("tenantId") != null) { queryRequest.setTenantId(allRequestParams.get("tenantId")); } + + if (allRequestParams.get("tenantIdLike") != null) { + queryRequest.setTenantIdLike(allRequestParams.get("tenantIdLike")); + } + + if (allRequestParams.get("tenantIdLikeIgnoreCase") != null) { + queryRequest.setTenantIdLikeIgnoreCase(allRequestParams.get("tenantIdLikeIgnoreCase")); + } if (allRequestParams.get("withoutTenantId") != null) { queryRequest.setWithoutTenantId(Boolean.valueOf(allRequestParams.get("withoutTenantId"))); diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceQueryRequest.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceQueryRequest.java index 8832e157736..151bc54241e 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceQueryRequest.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceQueryRequest.java @@ -32,9 +32,15 @@ public class HistoricCaseInstanceQueryRequest extends PaginateRequest { private List caseInstanceIds; private String caseDefinitionId; private String caseDefinitionKey; + private String caseDefinitionKeyLike; + private String caseDefinitionKeyLikeIgnoreCase; private Set caseDefinitionKeys; private String caseDefinitionCategory; + private String caseDefinitionCategoryLike; + private String caseDefinitionCategoryLikeIgnoreCase; private String caseDefinitionName; + private String caseDefinitionNameLike; + private String caseDefinitionNameLikeIgnoreCase; private String caseBusinessKey; private String caseInstanceName; private String caseInstanceNameLike; @@ -42,7 +48,11 @@ public class HistoricCaseInstanceQueryRequest extends PaginateRequest { private String caseInstanceRootScopeId; private String caseInstanceParentScopeId; private String caseInstanceBusinessKey; + private String caseInstanceBusinessKeyLike; + private String caseInstanceBusinessKeyLikeIgnoreCase; private String caseInstanceBusinessStatus; + private String caseInstanceBusinessStatusLike; + private String caseInstanceBusinessStatusLikeIgnoreCase; private String caseInstanceParentId; private String caseInstanceState; private String caseInstanceCallbackId; @@ -64,6 +74,8 @@ public class HistoricCaseInstanceQueryRequest extends PaginateRequest { private Boolean includeCaseVariables; private List variables; private String tenantId; + private String tenantIdLike; + private String tenantIdLikeIgnoreCase; private Boolean withoutTenantId; private Boolean withoutCaseInstanceParentId; private Boolean withoutCaseInstanceCallbackId; @@ -100,6 +112,22 @@ public void setCaseDefinitionKey(String caseDefinitionKey) { this.caseDefinitionKey = caseDefinitionKey; } + public String getCaseDefinitionKeyLike() { + return caseDefinitionKeyLike; + } + + public void setCaseDefinitionKeyLike(String caseDefinitionKeyLike) { + this.caseDefinitionKeyLike = caseDefinitionKeyLike; + } + + public String getCaseDefinitionKeyLikeIgnoreCase() { + return caseDefinitionKeyLikeIgnoreCase; + } + + public void setCaseDefinitionKeyLikeIgnoreCase(String caseDefinitionKeyLikeIgnoreCase) { + this.caseDefinitionKeyLikeIgnoreCase = caseDefinitionKeyLikeIgnoreCase; + } + public Set getCaseDefinitionKeys() { return caseDefinitionKeys; } @@ -116,6 +144,22 @@ public void setCaseDefinitionCategory(String caseDefinitionCategory) { this.caseDefinitionCategory = caseDefinitionCategory; } + public String getCaseDefinitionCategoryLike() { + return caseDefinitionCategoryLike; + } + + public void setCaseDefinitionCategoryLike(String caseDefinitionCategoryLike) { + this.caseDefinitionCategoryLike = caseDefinitionCategoryLike; + } + + public String getCaseDefinitionCategoryLikeIgnoreCase() { + return caseDefinitionCategoryLikeIgnoreCase; + } + + public void setCaseDefinitionCategoryLikeIgnoreCase(String caseDefinitionCategoryLikeIgnoreCase) { + this.caseDefinitionCategoryLikeIgnoreCase = caseDefinitionCategoryLikeIgnoreCase; + } + public String getCaseDefinitionName() { return caseDefinitionName; } @@ -124,6 +168,22 @@ public void setCaseDefinitionName(String caseDefinitionName) { this.caseDefinitionName = caseDefinitionName; } + public String getCaseDefinitionNameLike() { + return caseDefinitionNameLike; + } + + public void setCaseDefinitionNameLike(String caseDefinitionNameLike) { + this.caseDefinitionNameLike = caseDefinitionNameLike; + } + + public String getCaseDefinitionNameLikeIgnoreCase() { + return caseDefinitionNameLikeIgnoreCase; + } + + public void setCaseDefinitionNameLikeIgnoreCase(String caseDefinitionNameLikeIgnoreCase) { + this.caseDefinitionNameLikeIgnoreCase = caseDefinitionNameLikeIgnoreCase; + } + public String getCaseBusinessKey() { return caseBusinessKey; } @@ -180,6 +240,22 @@ public void setCaseInstanceBusinessKey(String caseInstanceBusinessKey) { this.caseInstanceBusinessKey = caseInstanceBusinessKey; } + public String getCaseInstanceBusinessKeyLike() { + return caseInstanceBusinessKeyLike; + } + + public void setCaseInstanceBusinessKeyLike(String caseInstanceBusinessKeyLike) { + this.caseInstanceBusinessKeyLike = caseInstanceBusinessKeyLike; + } + + public String getCaseInstanceBusinessKeyLikeIgnoreCase() { + return caseInstanceBusinessKeyLikeIgnoreCase; + } + + public void setCaseInstanceBusinessKeyLikeIgnoreCase(String caseInstanceBusinessKeyLikeIgnoreCase) { + this.caseInstanceBusinessKeyLikeIgnoreCase = caseInstanceBusinessKeyLikeIgnoreCase; + } + public String getCaseInstanceBusinessStatus() { return caseInstanceBusinessStatus; } @@ -188,6 +264,22 @@ public void setCaseInstanceBusinessStatus(String caseInstanceBusinessStatus) { this.caseInstanceBusinessStatus = caseInstanceBusinessStatus; } + public String getCaseInstanceBusinessStatusLike() { + return caseInstanceBusinessStatusLike; + } + + public void setCaseInstanceBusinessStatusLike(String caseInstanceBusinessStatusLike) { + this.caseInstanceBusinessStatusLike = caseInstanceBusinessStatusLike; + } + + public String getCaseInstanceBusinessStatusLikeIgnoreCase() { + return caseInstanceBusinessStatusLikeIgnoreCase; + } + + public void setCaseInstanceBusinessStatusLikeIgnoreCase(String caseInstanceBusinessStatusLikeIgnoreCase) { + this.caseInstanceBusinessStatusLikeIgnoreCase = caseInstanceBusinessStatusLikeIgnoreCase; + } + public String getCaseInstanceParentId() { return caseInstanceParentId; } @@ -356,6 +448,22 @@ public String getTenantId() { public void setTenantId(String tenantId) { this.tenantId = tenantId; } + + public String getTenantIdLike() { + return tenantIdLike; + } + + public void setTenantIdLike(String tenantIdLike) { + this.tenantIdLike = tenantIdLike; + } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } + + public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } public Boolean getWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseCaseInstanceResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseCaseInstanceResource.java index f9bae3b8191..6538eb74246 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseCaseInstanceResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/BaseCaseInstanceResource.java @@ -76,6 +76,12 @@ protected DataResponse getQueryResponse(CaseInstanceQueryR if (queryRequest.getCaseDefinitionKey() != null) { query.caseDefinitionKey(queryRequest.getCaseDefinitionKey()); } + if (queryRequest.getCaseDefinitionKeyLike() != null) { + query.caseDefinitionKeyLike(queryRequest.getCaseDefinitionKeyLike()); + } + if (queryRequest.getCaseDefinitionKeyLikeIgnoreCase() != null) { + query.caseDefinitionKeyLikeIgnoreCase(queryRequest.getCaseDefinitionKeyLikeIgnoreCase()); + } if (queryRequest.getCaseDefinitionKeys() != null && !queryRequest.getCaseDefinitionKeys().isEmpty()) { query.caseDefinitionKeys(queryRequest.getCaseDefinitionKeys()); } @@ -85,9 +91,21 @@ protected DataResponse getQueryResponse(CaseInstanceQueryR if (queryRequest.getCaseDefinitionCategory() != null) { query.caseDefinitionCategory(queryRequest.getCaseDefinitionCategory()); } + if (queryRequest.getCaseDefinitionCategoryLike() != null) { + query.caseDefinitionCategoryLike(queryRequest.getCaseDefinitionCategoryLike()); + } + if (queryRequest.getCaseDefinitionCategoryLikeIgnoreCase() != null) { + query.caseDefinitionCategoryLikeIgnoreCase(queryRequest.getCaseDefinitionCategoryLikeIgnoreCase()); + } if (queryRequest.getCaseDefinitionName() != null) { query.caseDefinitionName(queryRequest.getCaseDefinitionName()); } + if (queryRequest.getCaseDefinitionNameLike() != null) { + query.caseDefinitionNameLike(queryRequest.getCaseDefinitionNameLike()); + } + if (queryRequest.getCaseDefinitionNameLikeIgnoreCase() != null) { + query.caseDefinitionNameLikeIgnoreCase(queryRequest.getCaseDefinitionNameLikeIgnoreCase()); + } if (queryRequest.getCaseBusinessKey() != null) { query.caseInstanceBusinessKey(queryRequest.getCaseBusinessKey()); } @@ -109,9 +127,21 @@ protected DataResponse getQueryResponse(CaseInstanceQueryR if (queryRequest.getCaseInstanceBusinessKey() != null) { query.caseInstanceBusinessKey(queryRequest.getCaseInstanceBusinessKey()); } + if (queryRequest.getCaseInstanceBusinessKeyLike() != null) { + query.caseInstanceBusinessKeyLike(queryRequest.getCaseInstanceBusinessKeyLike()); + } + if (queryRequest.getCaseInstanceBusinessKeyLikeIgnoreCase() != null) { + query.caseInstanceBusinessKeyLikeIgnoreCase(queryRequest.getCaseInstanceBusinessKeyLikeIgnoreCase()); + } if (queryRequest.getCaseInstanceBusinessStatus() != null) { query.caseInstanceBusinessStatus(queryRequest.getCaseInstanceBusinessStatus()); } + if (queryRequest.getCaseInstanceBusinessStatusLike() != null) { + query.caseInstanceBusinessStatusLike(queryRequest.getCaseInstanceBusinessStatusLike()); + } + if (queryRequest.getCaseInstanceBusinessStatusLikeIgnoreCase() != null) { + query.caseInstanceBusinessStatusLikeIgnoreCase(queryRequest.getCaseInstanceBusinessStatusLikeIgnoreCase()); + } if (queryRequest.getInvolvedUser() != null) { query.involvedUser(queryRequest.getInvolvedUser()); } @@ -175,6 +205,10 @@ protected DataResponse getQueryResponse(CaseInstanceQueryR if (queryRequest.getTenantIdLike() != null) { query.caseInstanceTenantIdLike(queryRequest.getTenantIdLike()); } + + if (queryRequest.getTenantIdLikeIgnoreCase() != null) { + query.caseInstanceTenantIdLikeIgnoreCase(queryRequest.getTenantIdLikeIgnoreCase()); + } if (Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) { query.caseInstanceWithoutTenantId(); diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java index fddd15935a5..180fa421ab5 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java @@ -62,16 +62,26 @@ public class CaseInstanceCollectionResource extends BaseCaseInstanceResource { @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return models with the given version.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionKey", dataType = "string", value = "Only return case instances with the given case definition key.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionKeyLike", dataType = "string", value = "Only return case instances like given case definition key.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionKeyLikeIgnoreCase", dataType = "string", value = "Only return case instances like given case definition key, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionId", dataType = "string", value = "Only return case instances with the given case definition id.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionCategory", dataType = "string", value = "Only return case instances with the given case definition category.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionCategoryLike", dataType = "string", value = "Only return case instances like the given case definition category.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionCategoryLikeIgnoreCase", dataType = "string", value = "Only return case instances like the given case definition category, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "caseDefinitionName", dataType = "string", value = "Only return case instances with the given case definition name.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionNameLike", dataType = "string", value = "Only return case instances like the given case definition name.", paramType = "query"), + @ApiImplicitParam(name = "caseDefinitionNameLikeIgnoreCase", dataType = "string", value = "Only return case instances like the given case definition name, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return case instances with the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return case instances like the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLikeIgnoreCase", dataType = "string", value = "Only return case instances like the given name ignoring case.", paramType = "query"), @ApiImplicitParam(name = "rootScopeId", dataType = "string", value = "Only return case instances which have the given root scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "parentScopeId", dataType = "string", value = "Only return case instances which have the given parent scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "businessKey", dataType = "string", value = "Only return case instances with the given business key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return case instances like the given business key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLikeIgnoreCase", dataType = "string", value = "Only return case instances like the given business key, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "businessStatus", dataType = "string", value = "Only return case instances with the given business status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLike", dataType = "string", value = "Only return case instances like the given business status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLikeIgnoreCase", dataType = "string", value = "Only return case instances like the given business status, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "caseInstanceParentId", dataType = "string", value = "Only return case instances with the given parent id.", paramType = "query"), @ApiImplicitParam(name = "startedBy", dataType = "string", value = "Only return case instances started by the given user.", paramType = "query"), @ApiImplicitParam(name = "startedBefore", dataType = "string", format = "date-time", value = "Only return case instances started before the given date.", paramType = "query"), @@ -88,6 +98,7 @@ public class CaseInstanceCollectionResource extends BaseCaseInstanceResource { @ApiImplicitParam(name = "activePlanItemDefinitionId", dataType = "string", value = "Only return case instances that have an active plan item instance with the given plan item definition id.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return case instances with the given tenantId.", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return case instances with a tenantId like the given value.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLikeIgnoreCase", dataType = "string", value = "Only return case instances with a tenantId like the given value, ignoring case.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns case instances without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,caseDefinitionId,tenantId,caseDefinitionKey", paramType = "query"), }) @@ -107,6 +118,14 @@ public DataResponse getCaseInstances(@ApiParam(hidden = tr if (allRequestParams.containsKey("caseDefinitionKey")) { queryRequest.setCaseDefinitionKey(allRequestParams.get("caseDefinitionKey")); } + + if (allRequestParams.containsKey("caseDefinitionKeyLike")) { + queryRequest.setCaseDefinitionKeyLike(allRequestParams.get("caseDefinitionKeyLike")); + } + + if (allRequestParams.containsKey("caseDefinitionKeyLikeIgnoreCase")) { + queryRequest.setCaseDefinitionKeyLikeIgnoreCase(allRequestParams.get("caseDefinitionKeyLikeIgnoreCase")); + } if (allRequestParams.containsKey("caseDefinitionId")) { queryRequest.setCaseDefinitionId(allRequestParams.get("caseDefinitionId")); @@ -116,10 +135,26 @@ public DataResponse getCaseInstances(@ApiParam(hidden = tr queryRequest.setCaseDefinitionCategory(allRequestParams.get("caseDefinitionCategory")); } + if (allRequestParams.containsKey("caseDefinitionCategoryLike")) { + queryRequest.setCaseDefinitionCategoryLike(allRequestParams.get("caseDefinitionCategoryLike")); + } + + if (allRequestParams.containsKey("caseDefinitionCategoryLikeIgnoreCase")) { + queryRequest.setCaseDefinitionCategoryLikeIgnoreCase(allRequestParams.get("caseDefinitionCategoryLikeIgnoreCase")); + } + if (allRequestParams.containsKey("caseDefinitionName")) { queryRequest.setCaseDefinitionName(allRequestParams.get("caseDefinitionName")); } + if (allRequestParams.containsKey("caseDefinitionNameLike")) { + queryRequest.setCaseDefinitionNameLike(allRequestParams.get("caseDefinitionNameLike")); + } + + if (allRequestParams.containsKey("caseDefinitionNameLikeIgnoreCase")) { + queryRequest.setCaseDefinitionNameLikeIgnoreCase(allRequestParams.get("caseDefinitionNameLikeIgnoreCase")); + } + if (allRequestParams.containsKey("name")) { queryRequest.setCaseInstanceName(allRequestParams.get("name")); } @@ -144,9 +179,25 @@ public DataResponse getCaseInstances(@ApiParam(hidden = tr queryRequest.setCaseInstanceBusinessKey(allRequestParams.get("businessKey")); } + if (allRequestParams.containsKey("businessKeyLike")) { + queryRequest.setCaseInstanceBusinessKeyLike(allRequestParams.get("businessKeyLike")); + } + + if (allRequestParams.containsKey("businessKeyLikeIgnoreCase")) { + queryRequest.setCaseInstanceBusinessKeyLikeIgnoreCase(allRequestParams.get("businessKeyLikeIgnoreCase")); + } + if (allRequestParams.containsKey("businessStatus")) { queryRequest.setCaseInstanceBusinessStatus(allRequestParams.get("businessStatus")); } + + if (allRequestParams.containsKey("businessStatusLike")) { + queryRequest.setCaseInstanceBusinessStatusLike(allRequestParams.get("businessStatusLike")); + } + + if (allRequestParams.containsKey("businessStatusLikeIgnoreCase")) { + queryRequest.setCaseInstanceBusinessStatusLikeIgnoreCase(allRequestParams.get("businessStatusLikeIgnoreCase")); + } if (allRequestParams.containsKey("caseInstanceParentId")) { queryRequest.setCaseInstanceParentId(allRequestParams.get("caseInstanceParentId")); @@ -211,6 +262,10 @@ public DataResponse getCaseInstances(@ApiParam(hidden = tr if (allRequestParams.containsKey("tenantIdLike")) { queryRequest.setTenantIdLike(allRequestParams.get("tenantIdLike")); } + + if (allRequestParams.containsKey("tenantIdLikeIgnoreCase")) { + queryRequest.setTenantIdLikeIgnoreCase(allRequestParams.get("tenantIdLikeIgnoreCase")); + } if (allRequestParams.containsKey("withoutTenantId")) { if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceQueryRequest.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceQueryRequest.java index c988991bcbd..39e33e23050 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceQueryRequest.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceQueryRequest.java @@ -31,9 +31,15 @@ public class CaseInstanceQueryRequest extends PaginateRequest { private String caseInstanceId; private String caseDefinitionId; private String caseDefinitionKey; + private String caseDefinitionKeyLike; + private String caseDefinitionKeyLikeIgnoreCase; private Set caseDefinitionKeys; private String caseDefinitionCategory; + private String caseDefinitionCategoryLike; + private String caseDefinitionCategoryLikeIgnoreCase; private String caseDefinitionName; + private String caseDefinitionNameLike; + private String caseDefinitionNameLikeIgnoreCase; private String caseBusinessKey; private String caseInstanceName; private String caseInstanceNameLike; @@ -41,7 +47,11 @@ public class CaseInstanceQueryRequest extends PaginateRequest { private String caseInstanceRootScopeId; private String caseInstanceParentScopeId; private String caseInstanceBusinessKey; + private String caseInstanceBusinessKeyLike; + private String caseInstanceBusinessKeyLikeIgnoreCase; private String caseInstanceBusinessStatus; + private String caseInstanceBusinessStatusLike; + private String caseInstanceBusinessStatusLikeIgnoreCase; private String caseInstanceParentId; private String caseInstanceStartedBy; private Date caseInstanceStartedBefore; @@ -61,6 +71,7 @@ public class CaseInstanceQueryRequest extends PaginateRequest { private Set activePlanItemDefinitionIds; private String tenantId; private String tenantIdLike; + private String tenantIdLikeIgnoreCase; private Boolean withoutTenantId; public String getCaseInstanceId() { @@ -79,6 +90,22 @@ public void setCaseBusinessKey(String caseBusinessKey) { this.caseBusinessKey = caseBusinessKey; } + public String getCaseDefinitionKeyLike() { + return caseDefinitionKeyLike; + } + + public void setCaseDefinitionKeyLike(String caseDefinitionKeyLike) { + this.caseDefinitionKeyLike = caseDefinitionKeyLike; + } + + public String getCaseDefinitionKeyLikeIgnoreCase() { + return caseDefinitionKeyLikeIgnoreCase; + } + + public void setCaseDefinitionKeyLikeIgnoreCase(String caseDefinitionKeyLikeIgnoreCase) { + this.caseDefinitionKeyLikeIgnoreCase = caseDefinitionKeyLikeIgnoreCase; + } + public String getCaseDefinitionId() { return caseDefinitionId; } @@ -111,6 +138,22 @@ public void setCaseDefinitionCategory(String caseDefinitionCategory) { this.caseDefinitionCategory = caseDefinitionCategory; } + public String getCaseDefinitionCategoryLike() { + return caseDefinitionCategoryLike; + } + + public void setCaseDefinitionCategoryLike(String caseDefinitionCategoryLike) { + this.caseDefinitionCategoryLike = caseDefinitionCategoryLike; + } + + public String getCaseDefinitionCategoryLikeIgnoreCase() { + return caseDefinitionCategoryLikeIgnoreCase; + } + + public void setCaseDefinitionCategoryLikeIgnoreCase(String caseDefinitionCategoryLikeIgnoreCase) { + this.caseDefinitionCategoryLikeIgnoreCase = caseDefinitionCategoryLikeIgnoreCase; + } + public String getCaseDefinitionName() { return caseDefinitionName; } @@ -118,6 +161,22 @@ public String getCaseDefinitionName() { public void setCaseDefinitionName(String caseDefinitionName) { this.caseDefinitionName = caseDefinitionName; } + + public String getCaseDefinitionNameLike() { + return caseDefinitionNameLike; + } + + public void setCaseDefinitionNameLike(String caseDefinitionNameLike) { + this.caseDefinitionNameLike = caseDefinitionNameLike; + } + + public String getCaseDefinitionNameLikeIgnoreCase() { + return caseDefinitionNameLikeIgnoreCase; + } + + public void setCaseDefinitionNameLikeIgnoreCase(String caseDefinitionNameLikeIgnoreCase) { + this.caseDefinitionNameLikeIgnoreCase = caseDefinitionNameLikeIgnoreCase; + } public String getCaseInstanceName() { return caseInstanceName; @@ -167,6 +226,22 @@ public void setCaseInstanceBusinessKey(String caseInstanceBusinessKey) { this.caseInstanceBusinessKey = caseInstanceBusinessKey; } + public String getCaseInstanceBusinessKeyLike() { + return caseInstanceBusinessKeyLike; + } + + public void setCaseInstanceBusinessKeyLike(String caseInstanceBusinessKeyLike) { + this.caseInstanceBusinessKeyLike = caseInstanceBusinessKeyLike; + } + + public String getCaseInstanceBusinessKeyLikeIgnoreCase() { + return caseInstanceBusinessKeyLikeIgnoreCase; + } + + public void setCaseInstanceBusinessKeyLikeIgnoreCase(String caseInstanceBusinessKeyLikeIgnoreCase) { + this.caseInstanceBusinessKeyLikeIgnoreCase = caseInstanceBusinessKeyLikeIgnoreCase; + } + public String getCaseInstanceBusinessStatus() { return caseInstanceBusinessStatus; } @@ -174,6 +249,22 @@ public String getCaseInstanceBusinessStatus() { public void setCaseInstanceBusinessStatus(String caseInstanceBusinessStatus) { this.caseInstanceBusinessStatus = caseInstanceBusinessStatus; } + + public String getCaseInstanceBusinessStatusLike() { + return caseInstanceBusinessStatusLike; + } + + public void setCaseInstanceBusinessStatusLike(String caseInstanceBusinessStatusLike) { + this.caseInstanceBusinessStatusLike = caseInstanceBusinessStatusLike; + } + + public String getCaseInstanceBusinessStatusLikeIgnoreCase() { + return caseInstanceBusinessStatusLikeIgnoreCase; + } + + public void setCaseInstanceBusinessStatusLikeIgnoreCase(String caseInstanceBusinessStatusLikeIgnoreCase) { + this.caseInstanceBusinessStatusLikeIgnoreCase = caseInstanceBusinessStatusLikeIgnoreCase; + } public String getCaseInstanceStartedBy() { return caseInstanceStartedBy; @@ -335,4 +426,12 @@ public String getTenantIdLike() { public void setTenantIdLike(String tenantIdLike) { this.tenantIdLike = tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } + + public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } } diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/history/HistoricProcessInstanceQuery.java b/modules/flowable-engine/src/main/java/org/flowable/engine/history/HistoricProcessInstanceQuery.java index ef63654f253..d24c192c808 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/history/HistoricProcessInstanceQuery.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/history/HistoricProcessInstanceQuery.java @@ -61,12 +61,34 @@ public interface HistoricProcessInstanceQuery extends Query processDefinitionKeys); + + /** + * Select historic process instances whose process definition key is like the given value + */ + HistoricProcessInstanceQuery processDefinitionKeyLike(String processDefinitionKeyLike); + + /** + * Select historic process instances whose process definition key is like the given value, ignoring upper/lower case. + */ + HistoricProcessInstanceQuery processDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase); /** Only select historic process instances whose process definition category is processDefinitionCategory. */ HistoricProcessInstanceQuery processDefinitionCategory(String processDefinitionCategory); + + /** Only select historic process instances whose process definition category is like the given value. */ + HistoricProcessInstanceQuery processDefinitionCategoryLike(String processDefinitionCategoryLike); + + /** Only select historic process instances whose process definition category is like the given value, ignoring upper/lower case. */ + HistoricProcessInstanceQuery processDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase); /** Select process historic instances whose process definition name is processDefinitionName */ HistoricProcessInstanceQuery processDefinitionName(String processDefinitionName); + + /** Select process historic instances whose process definition name is like the given value */ + HistoricProcessInstanceQuery processDefinitionNameLike(String processDefinitionNameLike); + + /** Select process historic instances whose process definition name is like the given value, ignoring upper/lower case */ + HistoricProcessInstanceQuery processDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase); /** * Only select historic process instances with a certain process definition version. Particularly useful when used in combination with {@link #processDefinitionKey(String)} @@ -81,6 +103,11 @@ public interface HistoricProcessInstanceQuery extends Query processDefinitionKeys) { @@ -375,6 +529,19 @@ public ExecutionQueryImpl executionTenantIdLike(String tenantIdLike) { } return this; } + + @Override + public ExecutionQueryImpl executionTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + if (tenantIdLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("execution tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } else { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } + return this; + } @Override public ExecutionQueryImpl executionWithoutTenantId() { @@ -917,6 +1084,14 @@ public boolean getOnlyProcessInstances() { public String getProcessDefinitionKey() { return processDefinitionKey; } + + public String getProcessDefinitionKeyLike() { + return processDefinitionKeyLike; + } + + public String getProcessDefinitionKeyLikeIgnoreCase() { + return processDefinitionKeyLikeIgnoreCase; + } public String getProcessDefinitionId() { return processDefinitionId; @@ -925,10 +1100,26 @@ public String getProcessDefinitionId() { public String getProcessDefinitionCategory() { return processDefinitionCategory; } + + public String getProcessDefinitionCategoryLike() { + return processDefinitionCategoryLike; + } + + public String getProcessDefinitionCategoryLikeIgnoreCase() { + return processDefinitionCategoryLikeIgnoreCase; + } public String getProcessDefinitionName() { return processDefinitionName; } + + public String getProcessDefinitionNameLike() { + return processDefinitionNameLike; + } + + public String getProcessDefinitionNameLikeIgnoreCase() { + return processDefinitionNameLikeIgnoreCase; + } public Integer getProcessDefinitionVersion() { return processDefinitionVersion; @@ -962,6 +1153,10 @@ public String getBusinessKeyLike() { return businessKeyLike; } + public String getBusinessKeyLikeIgnoreCase() { + return businessKeyLikeIgnoreCase; + } + public String getBusinessStatus() { return null; } @@ -969,6 +1164,10 @@ public String getBusinessStatus() { public String getBusinessStatusLike() { return null; } + + public String getBusinessStatusLikeIgnoreCase() { + return null; + } public String getExecutionId() { return executionId; @@ -1070,6 +1269,10 @@ public String getTenantId() { public String getTenantIdLike() { return tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } public boolean isWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java index c059b00195e..7cc0c1750ca 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/HistoricProcessInstanceQueryImpl.java @@ -58,8 +58,10 @@ public class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl< protected String processDefinitionId; protected String businessKey; protected String businessKeyLike; + protected String businessKeyLikeIgnoreCase; protected String businessStatus; protected String businessStatusLike; + protected String businessStatusLikeIgnoreCase; protected String deploymentId; protected List deploymentIds; protected boolean finished; @@ -76,8 +78,14 @@ public class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl< protected Date finishedBefore; protected Date finishedAfter; protected String processDefinitionKey; + protected String processDefinitionKeyLike; + protected String processDefinitionKeyLikeIgnoreCase; protected String processDefinitionCategory; + protected String processDefinitionCategoryLike; + protected String processDefinitionCategoryLikeIgnoreCase; protected String processDefinitionName; + protected String processDefinitionNameLike; + protected String processDefinitionNameLikeIgnoreCase; protected Integer processDefinitionVersion; protected Set processInstanceIds; protected String activeActivityId; @@ -91,6 +99,7 @@ public class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl< protected boolean withJobException; protected String tenantId; protected String tenantIdLike; + protected String tenantIdLikeIgnoreCase; protected boolean withoutTenantId; protected String name; protected String nameLike; @@ -177,6 +186,26 @@ public HistoricProcessInstanceQuery processDefinitionKeyIn(List processD } return this; } + + @Override + public HistoricProcessInstanceQuery processDefinitionKeyLike(String processDefinitionKeyLike) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionKeyLike = processDefinitionKeyLike; + } else { + this.processDefinitionKeyLike = processDefinitionKeyLike; + } + return this; + } + + @Override + public HistoricProcessInstanceQuery processDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } else { + this.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } + return this; + } @Override public HistoricProcessInstanceQuery processDefinitionCategory(String processDefinitionCategory) { @@ -187,6 +216,26 @@ public HistoricProcessInstanceQuery processDefinitionCategory(String processDefi } return this; } + + @Override + public HistoricProcessInstanceQuery processDefinitionCategoryLike(String processDefinitionCategoryLike) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionCategoryLike = processDefinitionCategoryLike; + } else { + this.processDefinitionCategoryLike = processDefinitionCategoryLike; + } + return this; + } + + @Override + public HistoricProcessInstanceQuery processDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } else { + this.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } + return this; + } @Override public HistoricProcessInstanceQuery processDefinitionName(String processDefinitionName) { @@ -197,6 +246,26 @@ public HistoricProcessInstanceQuery processDefinitionName(String processDefiniti } return this; } + + @Override + public HistoricProcessInstanceQuery processDefinitionNameLike(String processDefinitionNameLike) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike; + } else { + this.processDefinitionNameLike = processDefinitionNameLike; + } + return this; + } + + @Override + public HistoricProcessInstanceQuery processDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } else { + this.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } + return this; + } @Override public HistoricProcessInstanceQuery processDefinitionVersion(Integer processDefinitionVersion) { @@ -228,6 +297,16 @@ public HistoricProcessInstanceQuery processInstanceBusinessKeyLike(String busine return this; } + @Override + public HistoricProcessInstanceQuery processInstanceBusinessKeyLikeIgnoreCase(String businessKeyLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase; + } else { + this.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase; + } + return this; + } + @Override public HistoricProcessInstanceQuery processInstanceBusinessStatus(String businessStatus) { if (inOrStatement) { @@ -247,6 +326,16 @@ public HistoricProcessInstanceQuery processInstanceBusinessStatusLike(String bus } return this; } + + @Override + public HistoricProcessInstanceQuery processInstanceBusinessStatusLikeIgnoreCase(String businessStatusLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.businessStatusLikeIgnoreCase = businessStatusLikeIgnoreCase; + } else { + this.businessStatusLikeIgnoreCase = businessStatusLikeIgnoreCase; + } + return this; + } @Override public HistoricProcessInstanceQuery processInstanceRootScopeId(String rootScopeId) { @@ -529,6 +618,19 @@ public HistoricProcessInstanceQuery processInstanceTenantIdLike(String tenantIdL } return this; } + + @Override + public HistoricProcessInstanceQuery processInstanceTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + if (tenantIdLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("process instance tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } else { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } + return this; + } @Override public HistoricProcessInstanceQuery processInstanceWithoutTenantId() { @@ -1082,6 +1184,10 @@ public String getBusinessKey() { public String getBusinessKeyLike() { return businessKeyLike; } + + public String getBusinessKeyLikeIgnoreCase() { + return businessKeyLikeIgnoreCase; + } public String getBusinessStatus() { return businessStatus; @@ -1090,6 +1196,10 @@ public String getBusinessStatus() { public String getBusinessStatusLike() { return businessStatusLike; } + + public String getBusinessStatusLikeIgnoreCase() { + return businessStatusLikeIgnoreCase; + } public boolean isOpen() { return unfinished; @@ -1102,6 +1212,14 @@ public String getProcessDefinitionId() { public String getProcessDefinitionKey() { return processDefinitionKey; } + + public String getProcessDefinitionKeyLike() { + return processDefinitionKeyLike; + } + + public String getProcessDefinitionKeyLikeIgnoreCase() { + return processDefinitionKeyLikeIgnoreCase; + } public List getProcessDefinitionKeyIn() { return processDefinitionKeyIn; @@ -1114,10 +1232,26 @@ public String getProcessDefinitionIdLike() { public String getProcessDefinitionName() { return processDefinitionName; } + + public String getProcessDefinitionNameLike() { + return processDefinitionNameLike; + } + + public String getProcessDefinitionNameLikeIgnoreCase() { + return processDefinitionNameLikeIgnoreCase; + } public String getProcessDefinitionCategory() { return processDefinitionCategory; } + + public String getProcessDefinitionCategoryLike() { + return processDefinitionCategoryLike; + } + + public String getProcessDefinitionCategoryLikeIgnoreCase() { + return processDefinitionCategoryLikeIgnoreCase; + } public Integer getProcessDefinitionVersion() { return processDefinitionVersion; @@ -1191,9 +1325,9 @@ public String getName() { public String getNameLike() { return nameLike; } - - public static long getSerialversionuid() { - return serialVersionUID; + + public String getNameLikeIgnoreCase() { + return nameLikeIgnoreCase; } public String getDeploymentId() { @@ -1235,14 +1369,14 @@ public String getTenantId() { public String getTenantIdLike() { return tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } public boolean isWithoutTenantId() { return withoutTenantId; } - - public String getNameLikeIgnoreCase() { - return nameLikeIgnoreCase; - } public String getCallbackId() { return callbackId; diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java index 090ad64dedc..e03b4fc5d98 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/ProcessInstanceQueryImpl.java @@ -51,16 +51,24 @@ public class ProcessInstanceQueryImpl extends AbstractVariableQueryImpl processDefinitionIds; protected String processDefinitionCategory; + protected String processDefinitionCategoryLike; + protected String processDefinitionCategoryLikeIgnoreCase; protected String processDefinitionName; + protected String processDefinitionNameLike; + protected String processDefinitionNameLikeIgnoreCase; protected Integer processDefinitionVersion; protected Set processInstanceIds; protected String processDefinitionKey; + protected String processDefinitionKeyLike; + protected String processDefinitionKeyLikeIgnoreCase; protected Set processDefinitionKeys; protected String processDefinitionEngineVersion; protected String deploymentId; @@ -92,6 +100,7 @@ public class ProcessInstanceQueryImpl extends AbstractVariableQueryImpl orQueryObjects = new ArrayList<>(); @@ -190,6 +199,16 @@ public ProcessInstanceQuery processInstanceBusinessKeyLike(String businessKeyLik return this; } + @Override + public ProcessInstanceQuery processInstanceBusinessKeyLikeIgnoreCase(String businessKeyLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase; + } else { + this.businessKeyLikeIgnoreCase = businessKeyLikeIgnoreCase; + } + return this; + } + @Override public ProcessInstanceQuery processInstanceBusinessStatus(String businessStatus) { if (businessStatus == null) { @@ -212,6 +231,16 @@ public ProcessInstanceQuery processInstanceBusinessStatusLike(String businessSta } return this; } + + @Override + public ProcessInstanceQuery processInstanceBusinessStatusLikeIgnoreCase(String businessStatusLikeIgnoreCase) { + if (inOrStatement) { + this.currentOrQueryObject.businessStatusLikeIgnoreCase = businessStatusLikeIgnoreCase; + } else { + this.businessStatusLikeIgnoreCase = businessStatusLikeIgnoreCase; + } + return this; + } @Override public ProcessInstanceQuery processInstanceTenantId(String tenantId) { @@ -238,6 +267,19 @@ public ProcessInstanceQuery processInstanceTenantIdLike(String tenantIdLike) { } return this; } + + @Override + public ProcessInstanceQuery processInstanceTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + if (tenantIdLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("process instance tenant id is null"); + } + if (inOrStatement) { + this.currentOrQueryObject.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } else { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } + return this; + } @Override public ProcessInstanceQuery processInstanceWithoutTenantId() { @@ -262,6 +304,34 @@ public ProcessInstanceQuery processDefinitionCategory(String processDefinitionCa } return this; } + + @Override + public ProcessInstanceQuery processDefinitionCategoryLike(String processDefinitionCategoryLike) { + if (processDefinitionCategoryLike == null) { + throw new FlowableIllegalArgumentException("Process definition category is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionCategoryLike = processDefinitionCategoryLike; + } else { + this.processDefinitionCategoryLike = processDefinitionCategoryLike; + } + return this; + } + + @Override + public ProcessInstanceQuery processDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase) { + if (processDefinitionCategoryLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("Process definition category is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } else { + this.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } + return this; + } @Override public ProcessInstanceQuery processDefinitionName(String processDefinitionName) { @@ -276,6 +346,34 @@ public ProcessInstanceQuery processDefinitionName(String processDefinitionName) } return this; } + + @Override + public ProcessInstanceQuery processDefinitionNameLike(String processDefinitionNameLike) { + if (processDefinitionNameLike == null) { + throw new FlowableIllegalArgumentException("Process definition name is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike; + } else { + this.processDefinitionNameLike = processDefinitionNameLike; + } + return this; + } + + @Override + public ProcessInstanceQuery processDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase) { + if (processDefinitionNameLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("Process definition name is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } else { + this.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } + return this; + } @Override public ProcessInstanceQuery processDefinitionVersion(Integer processDefinitionVersion) { @@ -335,6 +433,34 @@ public ProcessInstanceQueryImpl processDefinitionKey(String processDefinitionKey } return this; } + + @Override + public ProcessInstanceQueryImpl processDefinitionKeyLike(String processDefinitionKeyLike) { + if (processDefinitionKeyLike == null) { + throw new FlowableIllegalArgumentException("Process definition key is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionKeyLike = processDefinitionKeyLike; + } else { + this.processDefinitionKeyLike = processDefinitionKeyLike; + } + return this; + } + + @Override + public ProcessInstanceQueryImpl processDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase) { + if (processDefinitionKeyLikeIgnoreCase == null) { + throw new FlowableIllegalArgumentException("Process definition key is null"); + } + + if (inOrStatement) { + this.currentOrQueryObject.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } else { + this.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } + return this; + } @Override public ProcessInstanceQuery processDefinitionKeys(Set processDefinitionKeys) { @@ -937,6 +1063,10 @@ public String getBusinessKey() { public String getBusinessKeyLike() { return businessKeyLike; } + + public String getBusinessKeyLikeIgnoreCase() { + return businessKeyLikeIgnoreCase; + } public String getBusinessStatus() { return businessStatus; @@ -945,6 +1075,10 @@ public String getBusinessStatus() { public String getBusinessStatusLike() { return businessStatusLike; } + + public String getBusinessStatusLikeIgnoreCase() { + return businessStatusLikeIgnoreCase; + } public boolean isIncludeChildExecutionsWithBusinessKeyQuery() { return includeChildExecutionsWithBusinessKeyQuery; @@ -962,9 +1096,29 @@ public String getProcessDefinitionCategory() { return processDefinitionCategory; } + public String getProcessDefinitionCategoryLike() { + return processDefinitionCategoryLike; + } + + public String getProcessDefinitionCategoryLikeIgnoreCase() { + return processDefinitionCategoryLikeIgnoreCase; + } + + public String getParentScopeId() { + return parentScopeId; + } + public String getProcessDefinitionName() { return processDefinitionName; } + + public String getProcessDefinitionNameLike() { + return processDefinitionNameLike; + } + + public String getProcessDefinitionNameLikeIgnoreCase() { + return processDefinitionNameLikeIgnoreCase; + } public Integer getProcessDefinitionVersion() { return processDefinitionVersion; @@ -973,6 +1127,14 @@ public Integer getProcessDefinitionVersion() { public String getProcessDefinitionKey() { return processDefinitionKey; } + + public String getProcessDefinitionKeyLike() { + return processDefinitionKeyLike; + } + + public String getProcessDefinitionKeyLikeIgnoreCase() { + return processDefinitionKeyLikeIgnoreCase; + } public Set getProcessDefinitionKeys() { return processDefinitionKeys; @@ -1037,6 +1199,10 @@ public String getTenantId() { public String getTenantIdLike() { return tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } public boolean isWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstancesUsingBatchesCmd.java b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstancesUsingBatchesCmd.java index 408196479d9..45731490b78 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstancesUsingBatchesCmd.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/impl/delete/DeleteHistoricProcessInstancesUsingBatchesCmd.java @@ -179,8 +179,10 @@ protected void populateQueryNode(ObjectNode queryNode, HistoricProcessInstanceQu putIfNotNull(queryNode, "processDefinitionId", query.getProcessDefinitionId()); putIfNotNull(queryNode, "businessKey", query.getBusinessKey()); putIfNotNull(queryNode, "businessKeyLike", query.getBusinessKeyLike()); + putIfNotNull(queryNode, "businessKeyLikeIgnoreCase", query.getBusinessKeyLikeIgnoreCase()); putIfNotNull(queryNode, "businessStatus", query.getBusinessStatus()); putIfNotNull(queryNode, "businessStatusLike", query.getBusinessStatusLike()); + putIfNotNull(queryNode, "businessStatusLikeIgnoreCase", query.getBusinessStatusLikeIgnoreCase()); putIfNotNull(queryNode, "deploymentId", query.getDeploymentId()); putIfNotNullOrEmpty(queryNode, "deploymentIds", query.getDeploymentIds()); putIfTrue(queryNode, "finished", query.isFinished()); @@ -197,8 +199,14 @@ protected void populateQueryNode(ObjectNode queryNode, HistoricProcessInstanceQu putIfNotNull(queryNode, "finishedBefore", query.getFinishedBefore()); putIfNotNull(queryNode, "finishedAfter", query.getFinishedAfter()); putIfNotNull(queryNode, "processDefinitionKey", query.getProcessDefinitionKey()); + putIfNotNull(queryNode, "processDefinitionKeyLike", query.getProcessDefinitionKeyLike()); + putIfNotNull(queryNode, "processDefinitionKeyLikeIgnoreCase", query.getProcessDefinitionKeyLikeIgnoreCase()); putIfNotNull(queryNode, "processDefinitionCategory", query.getProcessDefinitionCategory()); + putIfNotNull(queryNode, "processDefinitionCategoryLike", query.getProcessDefinitionCategoryLike()); + putIfNotNull(queryNode, "processDefinitionCategoryLikeIgnoreCase", query.getProcessDefinitionCategoryLikeIgnoreCase()); putIfNotNull(queryNode, "processDefinitionName", query.getProcessDefinitionName()); + putIfNotNull(queryNode, "processDefinitionNameLike", query.getProcessDefinitionNameLike()); + putIfNotNull(queryNode, "processDefinitionNameLikeIgnoreCase", query.getProcessDefinitionNameLikeIgnoreCase()); putIfNotNull(queryNode, "processDefinitionVersion", query.getProcessDefinitionVersion()); putIfNotNullOrEmpty(queryNode, "processInstanceIds", query.getProcessInstanceIds()); putIfNotNull(queryNode, "activeActivityId", query.getActiveActivityId()); @@ -210,6 +218,7 @@ protected void populateQueryNode(ObjectNode queryNode, HistoricProcessInstanceQu putIfTrue(queryNode, "withJobException", query.isWithJobException()); putIfNotNull(queryNode, "tenantId", query.getTenantId()); putIfNotNull(queryNode, "tenantIdLike", query.getTenantIdLike()); + putIfNotNull(queryNode, "tenantIdLikeIgnoreCase", query.getTenantIdLikeIgnoreCase()); putIfTrue(queryNode, "withoutTenantId", query.isWithoutTenantId()); putIfNotNull(queryNode, "name", query.getName()); putIfNotNull(queryNode, "nameLike", query.getNameLike()); diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ExecutionQuery.java b/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ExecutionQuery.java index f821e4bd19d..3fc574e8f66 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ExecutionQuery.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ExecutionQuery.java @@ -28,6 +28,12 @@ public interface ExecutionQuery extends Query { /** Only select executions which have the given process definition key. **/ ExecutionQuery processDefinitionKey(String processDefinitionKey); + + /** Only select executions which have a process definition key like the given value. **/ + ExecutionQuery processDefinitionKeyLike(String processDefinitionKeyLike); + + /** Only select executions which have a process definition key like the given value, ignoring upper/lower case. **/ + ExecutionQuery processDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase); /** Only select executions which have process definitions with the given keys. **/ ExecutionQuery processDefinitionKeys(Set processDefinitionKeys); @@ -37,9 +43,21 @@ public interface ExecutionQuery extends Query { /** Only select executions which have the given process definition category. */ ExecutionQuery processDefinitionCategory(String processDefinitionCategory); + + /** Only select executions which have a process definition category like the given value. */ + ExecutionQuery processDefinitionCategoryLike(String processDefinitionCategoryLike); + + /** Only select executions which have a process definition category like the given value, ignoring upper/lower case. */ + ExecutionQuery processDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase); /** Only select executions which have the given process definition name. */ ExecutionQuery processDefinitionName(String processDefinitionName); + + /** Only select executions which have a process definition name like the given value. */ + ExecutionQuery processDefinitionNameLike(String processDefinitionNameLike); + + /** Only select executions which have a process definition name like the given value, ignoring upper/lower case. */ + ExecutionQuery processDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase); /** Only select executions which have the given process definition engine version. */ ExecutionQuery processDefinitionEngineVersion(String processDefinitionEngineVersion); @@ -67,6 +85,32 @@ public interface ExecutionQuery extends Query { * Only executions with the given business key. Similar to {@link #processInstanceBusinessKey(String)}, but allows to choose whether child executions are returned or not. */ ExecutionQuery processInstanceBusinessKey(String processInstanceBusinessKey, boolean includeChildExecutions); + + /** + * Only executions that have a business key like the given value. + * + * Note that only process instances have a business key and as such, child executions will NOT be returned. If you want to return child executions of the process instance with the given business + * key too, use the {@link #processInstanceBusinessKeyLike(String, boolean)} method with a boolean value of true instead. + */ + ExecutionQuery processInstanceBusinessKeyLike(String processInstanceBusinessKeyLike); + + /** + * Only executions that have a business key like the given value. Similar to {@link #processInstanceBusinessKeyLike(String)}, but allows to choose whether child executions are returned or not. + */ + ExecutionQuery processInstanceBusinessKeyLike(String processInstanceBusinessKeyLike, boolean includeChildExecutions); + + /** + * Only executions that have a business key like the given value, ignoring upper/lower case. + * + * Note that only process instances have a business key and as such, child executions will NOT be returned. If you want to return child executions of the process instance with the given business + * key too, use the {@link #processInstanceBusinessKeyLikeIgnoreCase(String, boolean)} method with a boolean value of true instead. + */ + ExecutionQuery processInstanceBusinessKeyLikeIgnoreCase(String processInstanceBusinessKeyLikeIgnoreCase); + + /** + * Only executions that have a business key like the given value, ignoring upper/lower case. Similar to {@link #processInstanceBusinessKeyLikeIgnoreCase(String)}, but allows to choose whether child executions are returned or not. + */ + ExecutionQuery processInstanceBusinessKeyLikeIgnoreCase(String processInstanceBusinessKeyLikeIgnoreCase, boolean includeChildExecutions); /** Only select executions with the given id. **/ ExecutionQuery executionId(String executionId); @@ -103,6 +147,11 @@ public interface ExecutionQuery extends Query { * Only select process instances with a tenant id like the given one. */ ExecutionQuery executionTenantIdLike(String tenantIdLike); + + /** + * Only select process instances with a tenant id like the given one, ignoring upper/lower case. + */ + ExecutionQuery executionTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase); /** * Only select process instances that do not have a tenant id. diff --git a/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ProcessInstanceQuery.java b/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ProcessInstanceQuery.java index b46808087ea..e2d5755149d 100644 --- a/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ProcessInstanceQuery.java +++ b/modules/flowable-engine/src/main/java/org/flowable/engine/runtime/ProcessInstanceQuery.java @@ -48,6 +48,11 @@ public interface ProcessInstanceQuery extends Query processDefinitionKeys); + + /** + * Select process instances whose process definition key is like the given value + */ + ProcessInstanceQuery processDefinitionKeyLike(String processDefinitionKeyLike); + + /** + * Select process instances whose process definition key is like the given value, ignoring upper/lower case. + */ + ProcessInstanceQuery processDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase); /** * Select the process instances which are defined by a process definition with the given id. diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml index 17ae1b2d572..dfcd67a6e94 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/Execution.xml @@ -679,6 +679,12 @@ and P.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} + + and P.KEY_ like #{processDefinitionKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(P.KEY_) like lower(#{processDefinitionKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and P.KEY_ in @@ -688,9 +694,21 @@ and P.CATEGORY_ = #{processDefinitionCategory, jdbcType=NVARCHAR} + + and P.CATEGORY_ like #{processDefinitionCategoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(P.CATEGORY_) like lower(#{processDefinitionCategoryLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and P.NAME_ = #{processDefinitionName, jdbcType=NVARCHAR} + + and P.NAME_ like #{processDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(P.NAME_) like lower(#{processDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and P.VERSION_ = #{processDefinitionVersion, jdbcType=INTEGER} @@ -712,7 +730,7 @@ #{processInstanceId, jdbcType=NVARCHAR} - + and exists ( @@ -726,6 +744,9 @@ and INST.BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(INST.BUSINESS_KEY_) like lower(#{businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + ) @@ -736,6 +757,9 @@ and RES.BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(RES.BUSINESS_KEY_) like lower(#{businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + @@ -745,6 +769,9 @@ and RES.BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(RES.BUSINESS_STATUS_) like lower(#{businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and RES.ACT_ID_ = #{activityId, jdbcType=NVARCHAR} and RES.IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN} @@ -790,13 +817,13 @@ - and CALLBACK_ID_ = #{callbackId, jdbcType=NVARCHAR} + and CALLBACK_ID_ = #{callbackId, jdbcType=NVARCHAR} and CALLBACK_TYPE_ = #{callbackType, jdbcType=NVARCHAR} - and REFERENCE_ID_ = #{referenceId, jdbcType=NVARCHAR} + and REFERENCE_ID_ = #{referenceId, jdbcType=NVARCHAR} and REFERENCE_TYPE_ = #{referenceType, jdbcType=NVARCHAR} @@ -807,6 +834,9 @@ and RES.TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(RES.TENANT_ID_) like lower(#{tenantIdLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) @@ -1009,6 +1039,12 @@ or P.KEY_ = #{orQueryObject.processDefinitionKey, jdbcType=NVARCHAR} + + or P.KEY_ like #{orQueryObject.processDefinitionKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(P.KEY_) like lower(#{orQueryObject.processDefinitionKeyLike, jdbcType=NVARCHAR})${wildcardEscapeClause} + or P.KEY_ in @@ -1018,9 +1054,21 @@ or P.CATEGORY_ = #{orQueryObject.processDefinitionCategory, jdbcType=NVARCHAR} + + or P.CATEGORY_ like #{orQueryObject.processDefinitionCategoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(P.CATEGORY_) like lower(#{orQueryObject.processDefinitionCategoryLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or P.NAME_ = #{orQueryObject.processDefinitionName, jdbcType=NVARCHAR} + + or P.NAME_ like #{orQueryObject.processDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(P.NAME_) like lower(#{orQueryObject.processDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or P.VERSION_ = #{orQueryObject.processDefinitionVersion, jdbcType=INTEGER} @@ -1042,12 +1090,21 @@ or RES.BUSINESS_KEY_ = #{orQueryObject.businessKey, jdbcType=NVARCHAR} + + or RES.BUSINESS_KEY_ like #{orQueryObject.businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(RES.BUSINESS_KEY_) like lower(#{orQueryObject.businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or RES.BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=NVARCHAR} or RES.BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + or lower(RES.BUSINESS_STATUS_) like lower(#{orQueryObject.businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or (RES.ACT_ID_ = #{orQueryObject.activityId, jdbcType=NVARCHAR} and RES.IS_ACTIVE_ = #{isActive, jdbcType=BOOLEAN}) @@ -1101,6 +1158,9 @@ or RES.TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + or lower(RES.TENANT_ID_) like lower(#{orQueryObject.tenantIdLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) diff --git a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricProcessInstance.xml b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricProcessInstance.xml index 53459c6123c..a8189e4115b 100644 --- a/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricProcessInstance.xml +++ b/modules/flowable-engine/src/main/resources/org/flowable/db/mapping/entity/HistoricProcessInstance.xml @@ -460,6 +460,12 @@ and DEF.KEY_ = #{processDefinitionKey, jdbcType=NVARCHAR} + + and DEF.KEY_ like #{processDefinitionKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(DEF.KEY_) like lower(#{processDefinitionKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and DEF.KEY_ IN and DEF.CATEGORY_ = #{processDefinitionCategory, jdbcType=NVARCHAR} + + and DEF.CATEGORY_ like #{processDefinitionCategoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(DEF.CATEGORY_) like lower(#{processDefinitionCategoryLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and DEF.NAME_ = #{processDefinitionName, jdbcType=NVARCHAR} + + and DEF.NAME_ like #{processDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + and lower(DEF.NAME_) like lower(#{processDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and DEF.DEPLOYMENT_ID_ = #{deploymentId, jdbcType=NVARCHAR} @@ -594,6 +612,12 @@ or DEF.KEY_ = #{orQueryObject.processDefinitionKey, jdbcType=NVARCHAR} + + or DEF.KEY_ like #{orQueryObject.processDefinitionKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(DEF.KEY_) like lower(#{orQueryObject.processDefinitionKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or DEF.KEY_ IN or DEF.CATEGORY_ = #{orQueryObject.processDefinitionCategory, jdbcType=NVARCHAR} + + or DEF.CATEGORY_ like #{orQueryObject.processDefinitionCategoryLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(DEF.CATEGORY_) like lower(#{orQueryObject.processDefinitionCategoryLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or DEF.NAME_ = #{orQueryObject.processDefinitionName, jdbcType=NVARCHAR} + + or DEF.NAME_ like #{orQueryObject.processDefinitionNameLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + + or lower(DEF.NAME_) like lower(#{orQueryObject.processDefinitionNameLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or DEF.DEPLOYMENT_ID_ = #{orQueryObject.deploymentId, jdbcType=NVARCHAR} @@ -759,12 +795,18 @@ and ${queryTablePrefix}BUSINESS_KEY_ like #{businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(${queryTablePrefix}BUSINESS_KEY_) like lower(#{businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and ${queryTablePrefix}BUSINESS_STATUS_ = #{businessStatus, jdbcType=NVARCHAR} and ${queryTablePrefix}BUSINESS_STATUS_ like #{businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(${queryTablePrefix}BUSINESS_STATUS_) like lower(#{businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and ${queryTablePrefix}START_TIME_ <= #{startedBefore, jdbcType=TIMESTAMP} @@ -857,6 +899,9 @@ and ${queryTablePrefix}TENANT_ID_ like #{tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + and lower(${queryTablePrefix}TENANT_ID_) like lower(#{tenantIdLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + and (${queryTablePrefix}TENANT_ID_ = '' or ${queryTablePrefix}TENANT_ID_ is null) @@ -903,12 +948,18 @@ or ${queryTablePrefix}BUSINESS_KEY_ like #{orQueryObject.businessKeyLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + or lower(${queryTablePrefix}BUSINESS_KEY_) like lower(#{orQueryObject.businessKeyLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or ${queryTablePrefix}BUSINESS_STATUS_ = #{orQueryObject.businessStatus, jdbcType=NVARCHAR} or ${queryTablePrefix}BUSINESS_STATUS_ like #{orQueryObject.businessStatusLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + or lower(${queryTablePrefix}BUSINESS_STATUS_) like lower(#{orQueryObject.businessStatusLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or ${queryTablePrefix}START_TIME_ <= #{orQueryObject.startedBefore, jdbcType=TIMESTAMP} @@ -1001,6 +1052,9 @@ or ${queryTablePrefix}TENANT_ID_ like #{orQueryObject.tenantIdLike, jdbcType=NVARCHAR}${wildcardEscapeClause} + + or lower(${queryTablePrefix}TENANT_ID_) like lower(#{orQueryObject.tenantIdLikeIgnoreCase, jdbcType=NVARCHAR})${wildcardEscapeClause} + or (${queryTablePrefix}TENANT_ID_ = '' or ${queryTablePrefix}TENANT_ID_ is null) diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/history/HistoryServiceTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/history/HistoryServiceTest.java index 0e77ec04e71..830740f0417 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/history/HistoryServiceTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/history/HistoryServiceTest.java @@ -186,6 +186,14 @@ public void testHistoricProcessInstanceQueryByProcessDefinitionKey() { assertThat(historicProcessInstance).isNotNull(); assertThat(historicProcessInstance.getProcessDefinitionKey()).isEqualTo(processDefinitionKey); assertThat(historicProcessInstance.getStartActivityId()).isEqualTo("theStart"); + + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLike(processDefinitionKey).list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLike("oneTask%").list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLike("none%").list()).hasSize(1); + + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase(processDefinitionKey).list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase("onetask%").list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase("none%").list()).hasSize(1); // now complete the task to end the process instance org.flowable.task.api.Task task = taskService.createTaskQuery().processDefinitionKey("checkCreditProcess").singleResult(); @@ -1079,6 +1087,24 @@ public void testHistoricProcessInstanceQueryByProcessDefinitionCategory() { .endOr().list()).hasSize(1); assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionCategory(processDefinitionCategory).processDefinitionId("invalid") .endOr().count()).isEqualTo(1); + + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLike("Examples%").list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLike("Examples%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLike("invalid").list()).isEmpty(); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLike("invalid").count()).isZero(); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionCategoryLike("Examples%").processDefinitionId("invalid") + .endOr().list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionCategoryLike("Examples%").processDefinitionId("invalid") + .endOr().count()).isEqualTo(1); + + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("examples%").list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("examples%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("invalid").list()).isEmpty(); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("invalid").count()).isZero(); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionCategoryLikeIgnoreCase("examples%").processDefinitionId("invalid") + .endOr().list()).hasSize(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionCategoryLikeIgnoreCase("examples%").processDefinitionId("invalid") + .endOr().count()).isEqualTo(1); } @Test diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/ProcessInstanceQueryTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/ProcessInstanceQueryTest.java index ddb08fdb43b..db7abf189b0 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/ProcessInstanceQueryTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/ProcessInstanceQueryTest.java @@ -154,6 +154,30 @@ public void testQueryByInvalidProcessDefinitionKeys() { assertThatThrownBy(() -> runtimeService.createProcessInstanceQuery().processDefinitionKeys(Collections.emptySet())) .isExactlyInstanceOf(FlowableIllegalArgumentException.class); } + + @Test + public void testQueryByProcessDefinitionKeyLike() { + ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKeyLike(PROCESS_DEFINITION_KEY_2); + assertThat(query.count()).isEqualTo(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(query.list()).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(query.singleResult()).isNotNull(); + + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKeyLike("oneTask%").list()).hasSize(5); + + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKeyLike("none%").list()).hasSize(0); + } + + @Test + public void testQueryByProcessDefinitionKeyLikeIgnoreCase() { + ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase(PROCESS_DEFINITION_KEY_2); + assertThat(query.count()).isEqualTo(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(query.list()).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(query.singleResult()).isNotNull(); + + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase("onetask%").list()).hasSize(5); + + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase("none%").list()).hasSize(0); + } @Test public void testQueryByProcessInstanceId() { @@ -198,6 +222,60 @@ public void testOrQueryByProcessDefinitionCategory() { assertThat(runtimeService.createProcessInstanceQuery().or().processDefinitionCategory(PROCESS_DEFINITION_CATEGORY_2).processDefinitionId("undefined") .endOr().count()).isEqualTo(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); } + + @Test + public void testQueryByProcessDefinitionCategoryLike() { + List instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLike(PROCESS_DEFINITION_CATEGORY).list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLike(PROCESS_DEFINITION_CATEGORY_2).list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLike("%Category").list(); + assertThat(instances).hasSize(5); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLike("%2Category").list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLike("%none").list(); + assertThat(instances).hasSize(0); + } + + @Test + public void testOrQueryByProcessDefinitionCategoryLike() { + List instances = runtimeService.createProcessInstanceQuery().or().processDefinitionCategoryLike(PROCESS_DEFINITION_CATEGORY).processDefinitionId("undefined").endOr().list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().or().processDefinitionCategoryLike(PROCESS_DEFINITION_CATEGORY_2).processDefinitionId("undefined").endOr().list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().or().processDefinitionCategoryLike("%Category").processDefinitionId("undefined").endOr().list(); + assertThat(instances).hasSize(5); + + instances = runtimeService.createProcessInstanceQuery().or().processDefinitionCategoryLike("%2Category").processDefinitionId("undefined").endOr().list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().or().processDefinitionCategoryLike("%none").processDefinitionId("undefined").endOr().list(); + assertThat(instances).hasSize(0); + } + + @Test + public void testQueryByProcessDefinitionCategoryLikeIgnoreCase() { + List instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase(PROCESS_DEFINITION_CATEGORY).list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase(PROCESS_DEFINITION_CATEGORY_2).list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("%category").list(); + assertThat(instances).hasSize(5); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("%2category").list(); + assertThat(instances).hasSize(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + + instances = runtimeService.createProcessInstanceQuery().processDefinitionCategoryLikeIgnoreCase("%none").list(); + assertThat(instances).hasSize(0); + } @Test public void testQueryByProcessInstanceName() { @@ -318,6 +396,18 @@ public void testQueryByBusinessKeyLike() { assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLike("%A%").count()).isEqualTo(2); assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLike("%B%").count()).isZero(); } + + @Test + public void testQueryByBusinessKeyLikeIgnoreCase() { + processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, "1A").getId()); + processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, "A1").getId()); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("%0").count()).isEqualTo(1); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("1%").count()).isEqualTo(3); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("%1").count()).isEqualTo(3); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("%1%").count()).isEqualTo(4); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("%a%").count()).isEqualTo(2); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("%b%").count()).isZero(); + } @Test public void testQueryByInvalidBusinessKey() { @@ -350,6 +440,24 @@ public void testQueryByBusinessStatusLike() { assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLike("%A%").count()).isEqualTo(2); assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLike("%B%").count()).isZero(); } + + @Test + public void testQueryByBusinessStatusLikeIgnoreCase() { + String processInstanceId = runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY).getId(); + processInstanceIds.add(processInstanceId); + runtimeService.updateBusinessStatus(processInstanceId, "1A"); + + processInstanceId = runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY).getId(); + processInstanceIds.add(processInstanceId); + runtimeService.updateBusinessStatus(processInstanceId, "A1"); + + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("%0").count()).isEqualTo(1); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("1%").count()).isEqualTo(3); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("%1").count()).isEqualTo(3); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("%1%").count()).isEqualTo(4); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("%a%").count()).isEqualTo(2); + assertThat(runtimeService.createProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("%b%").count()).isZero(); + } @Test public void testQueryByInvalidBusinessStatus() { @@ -425,6 +533,30 @@ public void testQueryByInvalidProcessDefinitionName() { assertThat(runtimeService.createProcessInstanceQuery().processDefinitionName("invalid").singleResult()).isNull(); assertThat(runtimeService.createProcessInstanceQuery().processDefinitionName("invalid").count()).isZero(); } + + @Test + public void testQueryByProcessDefinitionNameLike() { + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLike(PROCESS_DEFINITION_NAME).count()) + .isEqualTo(PROCESS_DEFINITION_KEY_DEPLOY_COUNT); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLike(PROCESS_DEFINITION_NAME_2).count()) + .isEqualTo(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLike("oneTask%").count()) + .isEqualTo(5); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLike("none%").count()) + .isEqualTo(0); + } + + @Test + public void testQueryByProcessDefinitionNameLikeIgnoreCase() { + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLikeIgnoreCase(PROCESS_DEFINITION_NAME).count()) + .isEqualTo(PROCESS_DEFINITION_KEY_DEPLOY_COUNT); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLikeIgnoreCase(PROCESS_DEFINITION_NAME_2).count()) + .isEqualTo(PROCESS_DEFINITION_KEY_2_DEPLOY_COUNT); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLikeIgnoreCase("onetask%").count()) + .isEqualTo(5); + assertThat(runtimeService.createProcessInstanceQuery().processDefinitionNameLikeIgnoreCase("none%").count()) + .isEqualTo(0); + } @Test public void testQueryByDeploymentId() { diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java index d74f71bf4ca..a62967da56d 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/HistoricDataDeleteTest.java @@ -1181,8 +1181,10 @@ void testDeleteHistoricInstancesWithAllQueryOptions() throws InvocationTargetExc methodNameToExpectedQueryPropertyName.put("processDefinitionKeyNotIn", "processKeyNotIn"); methodNameToExpectedQueryPropertyName.put("processInstanceBusinessKey", "businessKey"); methodNameToExpectedQueryPropertyName.put("processInstanceBusinessKeyLike", "businessKeyLike"); + methodNameToExpectedQueryPropertyName.put("processInstanceBusinessKeyLikeIgnoreCase", "businessKeyLikeIgnoreCase"); methodNameToExpectedQueryPropertyName.put("processInstanceBusinessStatus", "businessStatus"); methodNameToExpectedQueryPropertyName.put("processInstanceBusinessStatusLike", "businessStatusLike"); + methodNameToExpectedQueryPropertyName.put("processInstanceBusinessStatusLikeIgnoreCase", "businessStatusLikeIgnoreCase"); methodNameToExpectedQueryPropertyName.put("processInstanceCallbackType", "callbackType"); methodNameToExpectedQueryPropertyName.put("processInstanceCallbackId", "callbackId"); methodNameToExpectedQueryPropertyName.put("withoutProcessInstanceCallbackId", "withoutCallbackId"); @@ -1194,6 +1196,7 @@ void testDeleteHistoricInstancesWithAllQueryOptions() throws InvocationTargetExc methodNameToExpectedQueryPropertyName.put("processInstanceWithoutTenantId", "withoutTenantId"); methodNameToExpectedQueryPropertyName.put("processInstanceTenantId", "tenantId"); methodNameToExpectedQueryPropertyName.put("processInstanceTenantIdLike", "tenantIdLike"); + methodNameToExpectedQueryPropertyName.put("processInstanceTenantIdLikeIgnoreCase", "tenantIdLikeIgnoreCase"); Set methodsToIgnore = new HashSet<>(); methodsToIgnore.add("limitProcessInstanceVariables"); methodsToIgnore.add("includeProcessVariables"); diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/history/HistoricProcessInstanceTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/history/HistoricProcessInstanceTest.java index 3bfa21984bd..cc30a7a99af 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/history/HistoricProcessInstanceTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/history/HistoricProcessInstanceTest.java @@ -179,12 +179,27 @@ public void testHistoricProcessInstanceQuery() { assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionId(processInstance.getProcessDefinitionId()).count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("oneTaskProcess").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionKey("oneTaskProcess").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLike("oneTask%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionKeyLike("oneTask%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyLikeIgnoreCase("onetask%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processDefinitionKeyLikeIgnoreCase("onetask%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(Collections.singletonList("oneTaskProcess")).count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(Arrays.asList("undefined", "oneTaskProcess")).count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(Arrays.asList("undefined1", "undefined2")).count()).isZero(); assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey("businessKey123").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessKey("businessKey123").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKeyLike("businessKey%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessKeyLike("businessKey%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKeyLikeIgnoreCase("businesskey%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessKeyLikeIgnoreCase("businesskey%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessStatus("businessStatus123").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessStatus("businessStatus123").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessStatusLike("businessStatus%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessStatusLike("businessStatus%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().processInstanceBusinessStatusLikeIgnoreCase("businessstatus%").count()).isEqualTo(1); + assertThat(historyService.createHistoricProcessInstanceQuery().or().processInstanceBusinessStatusLikeIgnoreCase("businessstatus%").processDefinitionId("invalid").endOr().count()).isEqualTo(1); List excludeIds = new ArrayList<>(); excludeIds.add("unexistingProcessDefinition"); diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java index 44129e8a8fd..fd4b6a10997 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceBaseResource.java @@ -88,6 +88,12 @@ protected DataResponse getQueryResponse(Histori if (queryRequest.getProcessDefinitionKey() != null) { query.processDefinitionKey(queryRequest.getProcessDefinitionKey()); } + if (queryRequest.getProcessDefinitionKeyLike() != null) { + query.processDefinitionKeyLike(queryRequest.getProcessDefinitionKeyLike()); + } + if (queryRequest.getProcessDefinitionKeyLikeIgnoreCase() != null) { + query.processDefinitionKeyLikeIgnoreCase(queryRequest.getProcessDefinitionKeyLikeIgnoreCase()); + } if (queryRequest.getProcessDefinitionKeyIn() != null) { query.processDefinitionKeyIn(queryRequest.getProcessDefinitionKeyIn()); } @@ -100,12 +106,24 @@ protected DataResponse getQueryResponse(Histori if (queryRequest.getProcessDefinitionName() != null) { query.processDefinitionName(queryRequest.getProcessDefinitionName()); } + if (queryRequest.getProcessDefinitionNameLike() != null) { + query.processDefinitionNameLike(queryRequest.getProcessDefinitionNameLike()); + } + if (queryRequest.getProcessDefinitionNameLikeIgnoreCase() != null) { + query.processDefinitionNameLikeIgnoreCase(queryRequest.getProcessDefinitionNameLikeIgnoreCase()); + } if (queryRequest.getProcessDefinitionVersion() != null) { query.processDefinitionVersion(queryRequest.getProcessDefinitionVersion()); } if (queryRequest.getProcessDefinitionCategory() != null) { query.processDefinitionCategory(queryRequest.getProcessDefinitionCategory()); } + if (queryRequest.getProcessDefinitionCategoryLike() != null) { + query.processDefinitionCategoryLike(queryRequest.getProcessDefinitionCategoryLike()); + } + if (queryRequest.getProcessDefinitionCategoryLikeIgnoreCase() != null) { + query.processDefinitionCategoryLikeIgnoreCase(queryRequest.getProcessDefinitionCategoryLikeIgnoreCase()); + } if (queryRequest.getRootScopeId() != null) { query.processInstanceRootScopeId(queryRequest.getRootScopeId()); } @@ -124,6 +142,18 @@ protected DataResponse getQueryResponse(Histori if (queryRequest.getProcessBusinessKeyLike() != null) { query.processInstanceBusinessKeyLike(queryRequest.getProcessBusinessKeyLike()); } + if (queryRequest.getProcessBusinessKeyLikeIgnoreCase() != null) { + query.processInstanceBusinessKeyLikeIgnoreCase(queryRequest.getProcessBusinessKeyLikeIgnoreCase()); + } + if (queryRequest.getProcessBusinessStatus() != null) { + query.processInstanceBusinessStatus(queryRequest.getProcessBusinessStatus()); + } + if (queryRequest.getProcessBusinessStatusLike() != null) { + query.processInstanceBusinessStatusLike(queryRequest.getProcessBusinessStatusLike()); + } + if (queryRequest.getProcessBusinessStatusLikeIgnoreCase() != null) { + query.processInstanceBusinessStatusLikeIgnoreCase(queryRequest.getProcessBusinessStatusLikeIgnoreCase()); + } if (queryRequest.getActiveActivityId() != null) { query.activeActivityId(queryRequest.getActiveActivityId()); } @@ -186,6 +216,9 @@ protected DataResponse getQueryResponse(Histori if (queryRequest.getTenantIdLike() != null) { query.processInstanceTenantIdLike(queryRequest.getTenantIdLike()); } + if (queryRequest.getTenantIdLikeIgnoreCase() != null) { + query.processInstanceTenantIdLikeIgnoreCase(queryRequest.getTenantIdLikeIgnoreCase()); + } if (Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) { query.processInstanceWithoutTenantId(); diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java index d5d66255bb8..41aec52d8ae 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java @@ -50,15 +50,25 @@ public class HistoricProcessInstanceCollectionResource extends HistoricProcessIn @ApiImplicitParam(name = "processInstanceNameLike", dataType = "string", value = "A name of the historic process instance used in a like query.", paramType = "query"), @ApiImplicitParam(name = "processInstanceNameLikeIgnoreCase", dataType = "string", value = "A name of the historic process instance used in a like query ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionKey", dataType = "string", value = "The process definition key of the historic process instance.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionKeyLike", dataType = "string", value = "The process definition key used in a like query.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionKeyLikeIgnoreCase", dataType = "string", value = "The process definition key used in a like query ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionId", dataType = "string", value = "The process definition id of the historic process instance.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionName", dataType = "string", value = "The process definition name of the historic process instance.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionNameLike", dataType = "string", value = "The process definition name used in a like query.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionNameLikeIgnoreCase", dataType = "string", value = "The process definition name used in a like query ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionCategory", dataType = "string", value = "The process definition category of the historic process instance.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionCategoryLike", dataType = "string", value = "The process definition category used in a like query.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionCategoryLikeIgnoreCase", dataType = "string", value = "The process definition category used in a like query ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionVersion", dataType = "string", value = "The process definition version of the historic process instance.", paramType = "query"), @ApiImplicitParam(name = "deploymentId", dataType = "string", value = "The deployment id of the historic process instance.", paramType = "query"), @ApiImplicitParam(name = "rootScopeId", dataType = "string", value = "Only return process instances which have the given root scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "parentScopeId", dataType = "string", value = "Only return process instances which have the given parent scope id (that can be a process or case instance ID).", paramType = "query"), @ApiImplicitParam(name = "businessKey", dataType = "string", value = "The business key of the historic process instance.", paramType = "query"), - @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return instances with a businessKey like this key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return instances with a business key like this key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLikeIgnoreCase", dataType = "string", value = "Only return instances with a business key like this key ignoring case.", paramType = "query"), + @ApiImplicitParam(name = "businessStatus", dataType = "string", value = "The business status of the historic process instance.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLike", dataType = "string", value = "Only return instances with a business status like this status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLikeIgnoreCase", dataType = "string", value = "Only return instances with a business status like this status ignoring case.", paramType = "query"), @ApiImplicitParam(name = "activeActivityId", dataType = "string", value = "Only return instances which have an active activity instance with the provided activity id.", paramType = "query"), @ApiImplicitParam(name = "involvedUser", dataType = "string", value = "An involved user of the historic process instance.", paramType = "query"), @ApiImplicitParam(name = "finished", dataType = "boolean", value = "Indication if the historic process instance is finished.", paramType = "query"), @@ -74,7 +84,8 @@ public class HistoricProcessInstanceCollectionResource extends HistoricProcessIn @ApiImplicitParam(name = "callbackType", dataType = "string", value = "Only return instances with the given callbackType.", paramType = "query"), @ApiImplicitParam(name = "withoutCallbackId", dataType = "boolean", value = "Only return instances that do not have a callbackId.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return instances with the given tenantId.", paramType = "query"), - @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return instances with a tenantId like the given value.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return instances with a tenant id like the given value.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLikeIgnoreCase", dataType = "string", value = "Only return instances with a tenant id like the given value ignoring case.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns instances without a tenantId set. If false, the withoutTenantId parameter is ignored.\n", paramType = "query"), }) @ApiResponses(value = { @@ -104,6 +115,14 @@ public DataResponse getHistoricProcessInstances if (allRequestParams.get("processDefinitionKey") != null) { queryRequest.setProcessDefinitionKey(allRequestParams.get("processDefinitionKey")); } + + if (allRequestParams.get("processDefinitionKeyLike") != null) { + queryRequest.setProcessDefinitionKeyLike(allRequestParams.get("processDefinitionKeyLike")); + } + + if (allRequestParams.get("processDefinitionKeyLikeIgnoreCase") != null) { + queryRequest.setProcessDefinitionKeyLikeIgnoreCase(allRequestParams.get("processDefinitionKeyLikeIgnoreCase")); + } if (allRequestParams.get("processDefinitionId") != null) { queryRequest.setProcessDefinitionId(allRequestParams.get("processDefinitionId")); @@ -113,10 +132,26 @@ public DataResponse getHistoricProcessInstances queryRequest.setProcessDefinitionName(allRequestParams.get("processDefinitionName")); } + if (allRequestParams.get("processDefinitionNameLike") != null) { + queryRequest.setProcessDefinitionNameLike(allRequestParams.get("processDefinitionNameLike")); + } + + if (allRequestParams.get("processDefinitionNameLikeIgnoreCase") != null) { + queryRequest.setProcessDefinitionNameLikeIgnoreCase(allRequestParams.get("processDefinitionNameLikeIgnoreCase")); + } + if (allRequestParams.get("processDefinitionCategory") != null) { queryRequest.setProcessDefinitionCategory(allRequestParams.get("processDefinitionCategory")); } + if (allRequestParams.get("processDefinitionCategoryLike") != null) { + queryRequest.setProcessDefinitionCategoryLike(allRequestParams.get("processDefinitionCategoryLike")); + } + + if (allRequestParams.get("processDefinitionCategoryLikeIgnoreCase") != null) { + queryRequest.setProcessDefinitionCategoryLikeIgnoreCase(allRequestParams.get("processDefinitionCategoryLikeIgnoreCase")); + } + if (allRequestParams.get("processDefinitionVersion") != null) { queryRequest.setProcessDefinitionVersion(Integer.valueOf(allRequestParams.get("processDefinitionVersion"))); } @@ -141,6 +176,22 @@ public DataResponse getHistoricProcessInstances queryRequest.setProcessBusinessKeyLike(allRequestParams.get("businessKeyLike")); } + if (allRequestParams.get("businessKeyLikeIgnoreCase") != null) { + queryRequest.setProcessBusinessKeyLikeIgnoreCase(allRequestParams.get("businessKeyLikeIgnoreCase")); + } + + if (allRequestParams.get("businessStatus") != null) { + queryRequest.setProcessBusinessStatus(allRequestParams.get("businessStatus")); + } + + if (allRequestParams.get("businessStatusLike") != null) { + queryRequest.setProcessBusinessStatusLike(allRequestParams.get("businessStatusLike")); + } + + if (allRequestParams.get("businessStatusLikeIgnoreCase") != null) { + queryRequest.setProcessBusinessStatusLikeIgnoreCase(allRequestParams.get("businessStatusLikeIgnoreCase")); + } + if (allRequestParams.get("activeActivityId") != null) { queryRequest.setActiveActivityId(allRequestParams.get("activeActivityId")); } @@ -203,6 +254,10 @@ public DataResponse getHistoricProcessInstances if (allRequestParams.get("tenantIdLike") != null) { queryRequest.setTenantIdLike(allRequestParams.get("tenantIdLike")); } + + if (allRequestParams.get("tenantIdLikeIgnoreCase") != null) { + queryRequest.setTenantIdLikeIgnoreCase(allRequestParams.get("tenantIdLikeIgnoreCase")); + } if (allRequestParams.get("withoutTenantId") != null) { queryRequest.setWithoutTenantId(Boolean.valueOf(allRequestParams.get("withoutTenantId"))); diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceQueryRequest.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceQueryRequest.java index f3c2c4661bd..f29bfc126bb 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceQueryRequest.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceQueryRequest.java @@ -35,13 +35,23 @@ public class HistoricProcessInstanceQueryRequest extends PaginateRequest { private String processInstanceNameLikeIgnoreCase; private String processBusinessKey; private String processBusinessKeyLike; + private String processBusinessKeyLikeIgnoreCase; + private String processBusinessStatus; + private String processBusinessStatusLike; + private String processBusinessStatusLikeIgnoreCase; private String processDefinitionId; private String processDefinitionKey; + private String processDefinitionKeyLike; + private String processDefinitionKeyLikeIgnoreCase; private List processDefinitionKeyIn; private List processDefinitionKeyNotIn; private String processDefinitionName; + private String processDefinitionNameLike; + private String processDefinitionNameLikeIgnoreCase; private Integer processDefinitionVersion; private String processDefinitionCategory; + private String processDefinitionCategoryLike; + private String processDefinitionCategoryLikeIgnoreCase; private String deploymentId; private List deploymentIdIn; private String superProcessInstanceId; @@ -62,6 +72,7 @@ public class HistoricProcessInstanceQueryRequest extends PaginateRequest { private Boolean withoutCallbackId; private String tenantId; private String tenantIdLike; + private String tenantIdLikeIgnoreCase; private Boolean withoutTenantId; private String rootScopeId; private String parentScopeId; @@ -121,6 +132,38 @@ public String getProcessBusinessKeyLike() { public void setProcessBusinessKeyLike(String processBusinessKeyLike) { this.processBusinessKeyLike = processBusinessKeyLike; } + + public String getProcessBusinessKeyLikeIgnoreCase() { + return processBusinessKeyLikeIgnoreCase; + } + + public void setProcessBusinessKeyLikeIgnoreCase(String processBusinessKeyLikeIgnoreCase) { + this.processBusinessKeyLikeIgnoreCase = processBusinessKeyLikeIgnoreCase; + } + + public String getProcessBusinessStatus() { + return processBusinessStatus; + } + + public void setProcessBusinessStatus(String processBusinessStatus) { + this.processBusinessStatus = processBusinessStatus; + } + + public String getProcessBusinessStatusLike() { + return processBusinessStatusLike; + } + + public void setProcessBusinessStatusLike(String processBusinessStatusLike) { + this.processBusinessStatusLike = processBusinessStatusLike; + } + + public String getProcessBusinessStatusLikeIgnoreCase() { + return processBusinessStatusLikeIgnoreCase; + } + + public void setProcessBusinessStatusLikeIgnoreCase(String processBusinessStatusLikeIgnoreCase) { + this.processBusinessStatusLikeIgnoreCase = processBusinessStatusLikeIgnoreCase; + } public String getProcessDefinitionId() { return processDefinitionId; @@ -161,6 +204,54 @@ public String getProcessDefinitionName() { public void setProcessDefinitionName(String processDefinitionName) { this.processDefinitionName = processDefinitionName; } + + public String getProcessDefinitionKeyLike() { + return processDefinitionKeyLike; + } + + public void setProcessDefinitionKeyLike(String processDefinitionKeyLike) { + this.processDefinitionKeyLike = processDefinitionKeyLike; + } + + public String getProcessDefinitionKeyLikeIgnoreCase() { + return processDefinitionKeyLikeIgnoreCase; + } + + public void setProcessDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase) { + this.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } + + public String getProcessDefinitionNameLike() { + return processDefinitionNameLike; + } + + public void setProcessDefinitionNameLike(String processDefinitionNameLike) { + this.processDefinitionNameLike = processDefinitionNameLike; + } + + public String getProcessDefinitionNameLikeIgnoreCase() { + return processDefinitionNameLikeIgnoreCase; + } + + public void setProcessDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase) { + this.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } + + public String getProcessDefinitionCategoryLike() { + return processDefinitionCategoryLike; + } + + public void setProcessDefinitionCategoryLike(String processDefinitionCategoryLike) { + this.processDefinitionCategoryLike = processDefinitionCategoryLike; + } + + public String getProcessDefinitionCategoryLikeIgnoreCase() { + return processDefinitionCategoryLikeIgnoreCase; + } + + public void setProcessDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase) { + this.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } public Integer getProcessDefinitionVersion() { return processDefinitionVersion; @@ -338,6 +429,14 @@ public String getTenantIdLike() { public void setTenantIdLike(String tenantIdLike) { this.tenantIdLike = tenantIdLike; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } + + public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } public Boolean getWithoutTenantId() { return withoutTenantId; diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java index d5f84ad5787..c3e4f6fc5a6 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/BaseProcessInstanceResource.java @@ -85,9 +85,24 @@ protected DataResponse getQueryResponse(ProcessInstance if (queryRequest.getProcessInstanceNameLikeIgnoreCase() != null) { query.processInstanceNameLikeIgnoreCase(queryRequest.getProcessInstanceNameLikeIgnoreCase()); } + if (queryRequest.getProcessDefinitionName() != null) { + query.processDefinitionName(queryRequest.getProcessDefinitionName()); + } + if (queryRequest.getProcessDefinitionNameLike() != null) { + query.processDefinitionNameLike(queryRequest.getProcessDefinitionNameLike()); + } + if (queryRequest.getProcessDefinitionNameLikeIgnoreCase() != null) { + query.processDefinitionNameLikeIgnoreCase(queryRequest.getProcessDefinitionNameLikeIgnoreCase()); + } if (queryRequest.getProcessDefinitionKey() != null) { query.processDefinitionKey(queryRequest.getProcessDefinitionKey()); } + if (queryRequest.getProcessDefinitionKeyLike() != null) { + query.processDefinitionKeyLike(queryRequest.getProcessDefinitionKeyLike()); + } + if (queryRequest.getProcessDefinitionKeyLikeIgnoreCase() != null) { + query.processDefinitionKeyLikeIgnoreCase(queryRequest.getProcessDefinitionKeyLikeIgnoreCase()); + } if (queryRequest.getProcessDefinitionKeys() != null) { query.processDefinitionKeys(queryRequest.getProcessDefinitionKeys()); } @@ -100,8 +115,11 @@ protected DataResponse getQueryResponse(ProcessInstance if (queryRequest.getProcessDefinitionCategory() != null) { query.processDefinitionCategory(queryRequest.getProcessDefinitionCategory()); } - if (queryRequest.getProcessDefinitionName() != null) { - query.processDefinitionName(queryRequest.getProcessDefinitionName()); + if (queryRequest.getProcessDefinitionCategoryLike() != null) { + query.processDefinitionCategoryLike(queryRequest.getProcessDefinitionCategoryLike()); + } + if (queryRequest.getProcessDefinitionCategoryLikeIgnoreCase() != null) { + query.processDefinitionCategoryLikeIgnoreCase(queryRequest.getProcessDefinitionCategoryLikeIgnoreCase()); } if (queryRequest.getProcessDefinitionVersion() != null) { query.processDefinitionVersion(queryRequest.getProcessDefinitionVersion()); @@ -127,6 +145,18 @@ protected DataResponse getQueryResponse(ProcessInstance if (queryRequest.getProcessBusinessKeyLike() != null) { query.processInstanceBusinessKeyLike(queryRequest.getProcessBusinessKeyLike()); } + if (queryRequest.getProcessBusinessKeyLikeIgnoreCase() != null) { + query.processInstanceBusinessKeyLikeIgnoreCase(queryRequest.getProcessBusinessKeyLikeIgnoreCase()); + } + if (queryRequest.getProcessBusinessStatus() != null) { + query.processInstanceBusinessStatus(queryRequest.getProcessBusinessStatus()); + } + if (queryRequest.getProcessBusinessStatusLike() != null) { + query.processInstanceBusinessStatusLike(queryRequest.getProcessBusinessStatusLike()); + } + if (queryRequest.getProcessBusinessStatusLikeIgnoreCase() != null) { + query.processInstanceBusinessStatusLikeIgnoreCase(queryRequest.getProcessBusinessStatusLikeIgnoreCase()); + } if (queryRequest.getStartedBy() != null) { query.startedBy(queryRequest.getStartedBy()); } @@ -183,6 +213,9 @@ protected DataResponse getQueryResponse(ProcessInstance if (queryRequest.getTenantIdLike() != null) { query.processInstanceTenantIdLike(queryRequest.getTenantIdLike()); } + if (queryRequest.getTenantIdLikeIgnoreCase() != null) { + query.processInstanceTenantIdLikeIgnoreCase(queryRequest.getTenantIdLikeIgnoreCase()); + } if (Boolean.TRUE.equals(queryRequest.getWithoutTenantId())) { query.processInstanceWithoutTenantId(); diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java index 806578d73ac..1cca070431d 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java @@ -68,17 +68,28 @@ public class ProcessInstanceCollectionResource extends BaseProcessInstanceResour @ApiOperation(value = "List process instances", nickname ="listProcessInstances", tags = { "Process Instances" }) @ApiImplicitParams({ - @ApiImplicitParam(name = "id", dataType = "string", value = "Only return models with the given version.", paramType = "query"), - @ApiImplicitParam(name = "name", dataType = "string", value = "Only return models with the given name.", paramType = "query"), - @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return models like the given name.", paramType = "query"), - @ApiImplicitParam(name = "nameLikeIgnoreCase", dataType = "string", value = "Only return models like the given name ignoring case.", paramType = "query"), + @ApiImplicitParam(name = "id", dataType = "string", value = "Only return process instances with the given version.", paramType = "query"), + @ApiImplicitParam(name = "name", dataType = "string", value = "Only return process instances with the given name.", paramType = "query"), + @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return process instances like the given name.", paramType = "query"), + @ApiImplicitParam(name = "nameLikeIgnoreCase", dataType = "string", value = "Only return process instances like the given name ignoring case.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionName", dataType = "string", value = "Only return process instances with the given process definition name.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionNameLike", dataType = "string", value = "Only return process instances like the given process definition name.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionNameLikeIgnoreCase", dataType = "string", value = "Only return process instances like the given process definition name ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionKey", dataType = "string", value = "Only return process instances with the given process definition key.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionKeyLike", dataType = "string", value = "Only return process instances like the given process definition key.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionKeyLikeIgnoreCase", dataType = "string", value = "Only return process instances like the given process definition key ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionId", dataType = "string", value = "Only return process instances with the given process definition id.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionCategory", dataType = "string", value = "Only return process instances with the given process definition category.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionCategoryLike", dataType = "string", value = "Only return process instances like the given process definition category.", paramType = "query"), + @ApiImplicitParam(name = "processDefinitionCategoryLikeIgnoreCase", dataType = "string", value = "Only return process instances like the given process definition category ignoring case.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionVersion", dataType = "integer", value = "Only return process instances with the given process definition version.", paramType = "query"), @ApiImplicitParam(name = "processDefinitionEngineVersion", dataType = "string", value = "Only return process instances with the given process definition engine version.", paramType = "query"), - @ApiImplicitParam(name = "businessKey", dataType = "string", value = "Only return process instances with the given businessKey.", paramType = "query"), - @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return process instances with the businessKey like the given key.", paramType = "query"), + @ApiImplicitParam(name = "businessKey", dataType = "string", value = "Only return process instances with the given business key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLike", dataType = "string", value = "Only return process instances with the business key like the given key.", paramType = "query"), + @ApiImplicitParam(name = "businessKeyLikeIgnoreCase", dataType = "string", value = "Only return process instances with the business key like the given key ignoring case.", paramType = "query"), + @ApiImplicitParam(name = "businessStatus", dataType = "string", value = "Only return process instances with the given business status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLike", dataType = "string", value = "Only return process instances with the business status like the given status.", paramType = "query"), + @ApiImplicitParam(name = "businessStatusLikeIgnoreCase", dataType = "string", value = "Only return process instances with the business status like the given status ignoring case.", paramType = "query"), @ApiImplicitParam(name = "startedBy", dataType = "string", value = "Only return process instances started by the given user.", paramType = "query"), @ApiImplicitParam(name = "startedBefore", dataType = "string", format = "date-time", value = "Only return process instances started before the given date.", paramType = "query"), @ApiImplicitParam(name = "startedAfter", dataType = "string", format = "date-time", value = "Only return process instances started after the given date.", paramType = "query"), @@ -93,8 +104,9 @@ public class ProcessInstanceCollectionResource extends BaseProcessInstanceResour @ApiImplicitParam(name = "includeProcessVariables", dataType = "boolean", value = "Indication to include process variables in the result.", paramType = "query"), @ApiImplicitParam(name = "callbackId", dataType = "string", value = "Only return process instances with the given callbackId.", paramType = "query"), @ApiImplicitParam(name = "callbackType", dataType = "string", value = "Only return process instances with the given callbackType.", paramType = "query"), - @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return process instances with the given tenantId.", paramType = "query"), - @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return process instances with a tenantId like the given value.", paramType = "query"), + @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return process instances with the given tenant id.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return process instances with a tenant id like the given value.", paramType = "query"), + @ApiImplicitParam(name = "tenantIdLikeIgnoreCase", dataType = "string", value = "Only return process instances with a tenant id like the given value ignoring case.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns process instances without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,processDefinitionId,tenantId,processDefinitionKey", paramType = "query"), }) @@ -122,10 +134,30 @@ public DataResponse getProcessInstances(@ApiParam(hidde if (allRequestParams.containsKey("nameLikeIgnoreCase")) { queryRequest.setProcessInstanceNameLikeIgnoreCase(allRequestParams.get("nameLikeIgnoreCase")); } + + if (allRequestParams.containsKey("processDefinitionName")) { + queryRequest.setProcessDefinitionName(allRequestParams.get("processDefinitionName")); + } + + if (allRequestParams.containsKey("processDefinitionNameLike")) { + queryRequest.setProcessDefinitionNameLike(allRequestParams.get("processDefinitionNameLike")); + } + + if (allRequestParams.containsKey("processDefinitionNameLikeIgnoreCase")) { + queryRequest.setProcessDefinitionNameLikeIgnoreCase(allRequestParams.get("processDefinitionNameLikeIgnoreCase")); + } if (allRequestParams.containsKey("processDefinitionKey")) { queryRequest.setProcessDefinitionKey(allRequestParams.get("processDefinitionKey")); } + + if (allRequestParams.containsKey("processDefinitionKeyLike")) { + queryRequest.setProcessDefinitionKeyLike(allRequestParams.get("processDefinitionKeyLike")); + } + + if (allRequestParams.containsKey("processDefinitionKeyLikeIgnoreCase")) { + queryRequest.setProcessDefinitionKeyLikeIgnoreCase(allRequestParams.get("processDefinitionKeyLikeIgnoreCase")); + } if (allRequestParams.containsKey("processDefinitionId")) { queryRequest.setProcessDefinitionId(allRequestParams.get("processDefinitionId")); @@ -135,6 +167,14 @@ public DataResponse getProcessInstances(@ApiParam(hidde queryRequest.setProcessDefinitionCategory(allRequestParams.get("processDefinitionCategory")); } + if (allRequestParams.containsKey("processDefinitionCategoryLike")) { + queryRequest.setProcessDefinitionCategoryLike(allRequestParams.get("processDefinitionCategoryLike")); + } + + if (allRequestParams.containsKey("processDefinitionCategoryLikeIgnoreCase")) { + queryRequest.setProcessDefinitionCategoryLikeIgnoreCase(allRequestParams.get("processDefinitionCategoryLikeIgnoreCase")); + } + if (allRequestParams.containsKey("processDefinitionVersion")) { queryRequest.setProcessDefinitionVersion(Integer.valueOf(allRequestParams.get("processDefinitionVersion"))); } @@ -151,6 +191,22 @@ public DataResponse getProcessInstances(@ApiParam(hidde queryRequest.setProcessBusinessKeyLike(allRequestParams.get("businessKeyLike")); } + if (allRequestParams.containsKey("businessKeyLikeIgnoreCase")) { + queryRequest.setProcessBusinessKeyLikeIgnoreCase(allRequestParams.get("businessKeyLikeIgnoreCase")); + } + + if (allRequestParams.containsKey("businessStatus")) { + queryRequest.setProcessBusinessStatus(allRequestParams.get("businessStatus")); + } + + if (allRequestParams.containsKey("businessStatusLike")) { + queryRequest.setProcessBusinessStatusLike(allRequestParams.get("businessStatusLike")); + } + + if (allRequestParams.containsKey("businessStatusLikeIgnoreCase")) { + queryRequest.setProcessBusinessStatusLikeIgnoreCase(allRequestParams.get("businessStatusLikeIgnoreCase")); + } + if (allRequestParams.containsKey("startedBy")) { queryRequest.setStartedBy(allRequestParams.get("startedBy")); } @@ -214,6 +270,10 @@ public DataResponse getProcessInstances(@ApiParam(hidde if (allRequestParams.containsKey("tenantIdLike")) { queryRequest.setTenantIdLike(allRequestParams.get("tenantIdLike")); } + + if (allRequestParams.containsKey("tenantIdLikeIgnoreCase")) { + queryRequest.setTenantIdLikeIgnoreCase(allRequestParams.get("tenantIdLikeIgnoreCase")); + } if (allRequestParams.containsKey("withoutTenantId")) { if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceQueryRequest.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceQueryRequest.java index 41905c2839c..570383f80da 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceQueryRequest.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceQueryRequest.java @@ -35,12 +35,22 @@ public class ProcessInstanceQueryRequest extends PaginateRequest { private String processInstanceNameLikeIgnoreCase; private String processBusinessKey; private String processBusinessKeyLike; + private String processBusinessKeyLikeIgnoreCase; + private String processBusinessStatus; + private String processBusinessStatusLike; + private String processBusinessStatusLikeIgnoreCase; private String processDefinitionId; private Set processDefinitionIds; private String processDefinitionKey; + private String processDefinitionKeyLike; + private String processDefinitionKeyLikeIgnoreCase; private Set processDefinitionKeys; private String processDefinitionName; + private String processDefinitionNameLike; + private String processDefinitionNameLikeIgnoreCase; private String processDefinitionCategory; + private String processDefinitionCategoryLike; + private String processDefinitionCategoryLikeIgnoreCase; private Integer processDefinitionVersion; private String processDefinitionEngineVersion; private String rootScopeId; @@ -63,6 +73,7 @@ public class ProcessInstanceQueryRequest extends PaginateRequest { private String callbackType; private String tenantId; private String tenantIdLike; + private String tenantIdLikeIgnoreCase; private Boolean withoutTenantId; public String getProcessInstanceId() { @@ -104,6 +115,54 @@ public String getProcessInstanceNameLikeIgnoreCase() { public void setProcessInstanceNameLikeIgnoreCase(String processInstanceNameLikeIgnoreCase) { this.processInstanceNameLikeIgnoreCase = processInstanceNameLikeIgnoreCase; } + + public String getProcessDefinitionNameLike() { + return processDefinitionNameLike; + } + + public void setProcessDefinitionNameLike(String processDefinitionNameLike) { + this.processDefinitionNameLike = processDefinitionNameLike; + } + + public String getProcessDefinitionNameLikeIgnoreCase() { + return processDefinitionNameLikeIgnoreCase; + } + + public void setProcessDefinitionNameLikeIgnoreCase(String processDefinitionNameLikeIgnoreCase) { + this.processDefinitionNameLikeIgnoreCase = processDefinitionNameLikeIgnoreCase; + } + + public String getProcessDefinitionCategoryLike() { + return processDefinitionCategoryLike; + } + + public void setProcessDefinitionCategoryLike(String processDefinitionCategoryLike) { + this.processDefinitionCategoryLike = processDefinitionCategoryLike; + } + + public String getProcessDefinitionCategoryLikeIgnoreCase() { + return processDefinitionCategoryLikeIgnoreCase; + } + + public void setProcessDefinitionCategoryLikeIgnoreCase(String processDefinitionCategoryLikeIgnoreCase) { + this.processDefinitionCategoryLikeIgnoreCase = processDefinitionCategoryLikeIgnoreCase; + } + + public String getProcessDefinitionKeyLike() { + return processDefinitionKeyLike; + } + + public void setProcessDefinitionKeyLike(String processDefinitionKeyLike) { + this.processDefinitionKeyLike = processDefinitionKeyLike; + } + + public String getProcessDefinitionKeyLikeIgnoreCase() { + return processDefinitionKeyLikeIgnoreCase; + } + + public void setProcessDefinitionKeyLikeIgnoreCase(String processDefinitionKeyLikeIgnoreCase) { + this.processDefinitionKeyLikeIgnoreCase = processDefinitionKeyLikeIgnoreCase; + } public String getProcessBusinessKey() { return processBusinessKey; @@ -121,6 +180,38 @@ public void setProcessBusinessKeyLike(String processBusinessKeyLike) { this.processBusinessKeyLike = processBusinessKeyLike; } + public String getProcessBusinessKeyLikeIgnoreCase() { + return processBusinessKeyLikeIgnoreCase; + } + + public void setProcessBusinessKeyLikeIgnoreCase(String processBusinessKeyLikeIgnoreCase) { + this.processBusinessKeyLikeIgnoreCase = processBusinessKeyLikeIgnoreCase; + } + + public String getProcessBusinessStatus() { + return processBusinessStatus; + } + + public void setProcessBusinessStatus(String processBusinessStatus) { + this.processBusinessStatus = processBusinessStatus; + } + + public String getProcessBusinessStatusLike() { + return processBusinessStatusLike; + } + + public void setProcessBusinessStatusLike(String processBusinessStatusLike) { + this.processBusinessStatusLike = processBusinessStatusLike; + } + + public String getProcessBusinessStatusLikeIgnoreCase() { + return processBusinessStatusLikeIgnoreCase; + } + + public void setProcessBusinessStatusLikeIgnoreCase(String processBusinessStatusLikeIgnoreCase) { + this.processBusinessStatusLikeIgnoreCase = processBusinessStatusLikeIgnoreCase; + } + public String getProcessDefinitionId() { return processDefinitionId; } @@ -321,6 +412,14 @@ public void setTenantId(String tenantId) { public String getTenantId() { return tenantId; } + + public String getTenantIdLikeIgnoreCase() { + return tenantIdLikeIgnoreCase; + } + + public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { + this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; + } public void setWithoutTenantId(Boolean withoutTenantId) { this.withoutTenantId = withoutTenantId;