Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(queryAPI): add filter for instances with jobs retrying in java API #4920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ public interface HistoricProcessInstanceQuery extends Query<HistoricProcessInsta
*/
HistoricProcessInstanceQuery incidentMessageLike(String incidentMessageLike);

/**
* Only select historic process instances which are associated with jobs that have exceptions and retries left.
*
* @return HistoricProcessInstanceQuery
*/
HistoricProcessInstanceQuery withJobsRetrying();

/**
* Only select historic process instances which are associated with the given case instance id.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class HistoricProcessInstanceQueryImpl extends AbstractVariableQueryImpl<
protected String businessKeyLike;
protected boolean finished = false;
protected boolean unfinished = false;
protected boolean withJobsRetrying = false;
protected boolean withIncidents = false;
protected boolean withRootIncidents = false;
protected String incidentType;
Expand Down Expand Up @@ -214,6 +215,12 @@ public HistoricProcessInstanceQuery incidentMessageLike(String incidentMessageLi
return this;
}

@Override
public HistoricProcessInstanceQuery withJobsRetrying(){
this.withJobsRetrying = true;
return this;
}

public HistoricProcessInstanceQuery startedBy(String userId) {
this.startedBy = userId;
return this;
Expand Down Expand Up @@ -655,6 +662,10 @@ public boolean getIsTenantIdSet() {
return isTenantIdSet;
}

public boolean isWithJobsRetrying(){
return withJobsRetrying;
}

public boolean isWithIncidents() {
return withIncidents;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,18 @@
)
</if>

<if test="query.withJobsRetrying">
${queryType} EXISTS (
SELECT 1
FROM ${prefix}ACT_RU_JOB
<where>
PROCESS_INSTANCE_ID_ = SELF.ID_
AND RETRIES_ > 0
AND (EXCEPTION_MSG_ IS NOT NULL OR EXCEPTION_STACK_ID_ IS NOT NULL)
</where>
)
</if>

<if test="query.isTenantIdSet">
<if test="query.tenantIds != null &amp;&amp; query.tenantIds.length > 0">
${queryType} SELF.TENANT_ID_ in
Expand Down
Loading