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

4587 add incident id in filter to historic process instance query #4590

Merged

Conversation

venetrius
Copy link
Member

related to: #4587

@venetrius venetrius added the ci:rest-api Runs extra builds for the REST API (currently only WLS compatibility builds). label Sep 9, 2024
@venetrius venetrius self-assigned this Sep 9, 2024
@venetrius venetrius added the ci:e2e Runs the frontend end-to-end tests. label Sep 13, 2024
@venetrius venetrius force-pushed the 4587-Add-IncidentIdIn-filter-to-HistoricProcessInstanceQuery branch from 50f6241 to c696020 Compare September 17, 2024 17:59
@venetrius venetrius force-pushed the 4587-Add-IncidentIdIn-filter-to-HistoricProcessInstanceQuery branch from c696020 to c0f2170 Compare September 18, 2024 06:08
@venetrius venetrius removed the ci:e2e Runs the frontend end-to-end tests. label Sep 18, 2024
@yanavasileva yanavasileva added ci:default-build Runs the builds that have no explicit trigger (e.g. different history levels). ci:all-db Runs the builds for all databases. labels Sep 18, 2024
Copy link
Member

@yanavasileva yanavasileva left a 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 &amp;&amp; (query.withIncidents || query.withRootIncidents || query.incidentStatus != null || query.incidentMessage != null || query.incidentMessageLike != null || query.incidentType != null)">
<if test="query != null &amp;&amp; (query.withIncidents || query.withRootIncidents || query.incidentStatus != null || query.incidentMessage != null || query.incidentMessageLike != null || query.incidentType != null || (incidentIds != null &amp;&amp; incidentIds.length > 0))">
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Are they excluded? 🤔

Copy link
Member

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() {
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

@venetrius venetrius Sep 19, 2024

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

Copy link
Member Author

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.

Copy link
Member

@tasso94 tasso94 left a 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.

@venetrius venetrius merged commit 5d02cd3 into master Sep 20, 2024
3 of 4 checks passed
@venetrius venetrius deleted the 4587-Add-IncidentIdIn-filter-to-HistoricProcessInstanceQuery branch September 20, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:all-db Runs the builds for all databases. ci:default-build Runs the builds that have no explicit trigger (e.g. different history levels). ci:rest-api Runs extra builds for the REST API (currently only WLS compatibility builds).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants