-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
4587 add incident id in filter to historic process instance query #4590
4587 add incident id in filter to historic process instance query #4590
Conversation
50f6241
to
c696020
Compare
c696020
to
c0f2170
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing only tests coverage feedback.
@@ -409,7 +409,7 @@ | |||
<bind name="JOIN_TYPE" value="'left join'" /> | |||
</if> | |||
|
|||
<if test="query != null && (query.withIncidents || query.withRootIncidents || query.incidentStatus != null || query.incidentMessage != null || query.incidentMessageLike != null || query.incidentType != null)"> | |||
<if test="query != null && (query.withIncidents || query.withRootIncidents || query.incidentStatus != null || query.incidentMessage != null || query.incidentMessageLike != null || query.incidentType != null || (incidentIds != null && incidentIds.length > 0))"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Do we need to extend to docs that incidentIds are excluded for Or queries here: https://docs.camunda.org/manual/develop/user-guide/process-engine/process-engine-api/#or-queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I added a note to Start date filter for modify operation - Documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Are they excluded? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can just add a test to verify this.
@@ -1988,6 +1990,32 @@ public void shouldQueryByVariableValue_12() { | |||
.containsExactlyInAnyOrder(processInstanceIdOne, processInstanceIdTwo); | |||
} | |||
|
|||
@Test | |||
@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/failingProcessCreateOneIncident.bpmn20.xml"}) | |||
public void shouldQueryByVariableValue_13() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ please find a more appropriate name for the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use a meaningful name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✍️ the test case here is 2 incidents we query, we fetch two instances. Test cases that we need to consider covering:
- query for incidents in instances that don't have incidents => 0
- mix query for 2 incidents in instances with one incident => 1
null
input => exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In this test we already have 3 incidents but only 2 of them are queried, it might not be apparent because for the third the returned process instance is ignored.
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("failingProcess");
runtimeService.startProcessInstanceByKey("failingProcess");
-
I added a test for the case when: null input => exception
-
I am adding a test where only some instances have incidents, Work in Progress
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test when not all process instances have incidents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks already very good. 👍
Added one more test for sub processes.
related to: #4587