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

Activity Filter in API Not Filtering as Expected #5109

Closed
sfmskywalker opened this issue Mar 20, 2024 · 0 comments · Fixed by #5110
Closed

Activity Filter in API Not Filtering as Expected #5109

sfmskywalker opened this issue Mar 20, 2024 · 0 comments · Fixed by #5110
Assignees
Labels
bug Something isn't working elsa 3 This issue is specific to Elsa 3
Milestone

Comments

@sfmskywalker
Copy link
Member

We've encountered an issue where the ActivityFilter does not seem to be functioning as expected. Despite applying filters intended to yield no results under certain conditions, plans are being executed for instances that should ostensibly be filtered out.

Initial Conditions:

  • There are two workflow instances.

Steps to Reproduce:

  1. Create a plan with the following filter criteria:

    • hasIncidents: true (Expecting 2 instances to match this condition)
    • A filter with arbitrary values for an activity, which should theoretically result in 0 matching instances:
      "filter": {
        "hasIncidents": true,
        "activityFilters": [
          {
            "id": "1",
            "nodeId": "1",
            "name": "Ijustmadethisup",
            "status": "Pending"
          }
        ]
      }
  2. Expectation: No workflow instances should be found due to the specified activityFilters.

  3. Outcome: Despite the expectation, the plan is executed for the two instances.

Observed Behavior:

Upon reviewing the executed plan via {{elsaurl}}elsa/api/alterations/227522d98102f026, it's observed that the plan proceeded with alterations on both workflow instances that were supposed to be excluded by the filter.

"workflowInstanceFilter": {
  "hasIncidents": true,
  "activityFilters": [
    {
      "id": "1",
      "nodeId": "1",
      "name": "Ijustmadethisup",
      "status": "Pending"
    }
  ]
}

The status of both jobs is marked as "Completed", indicating that the filtering did not work as intended.

Expected Behavior:

The ActivityFilter should accurately filter out workflow instances that do not meet the specified criteria, in this case, not matching the arbitrary values specified for an activity.

Additional Context:

  • This issue directly impacts the ability to selectively perform operations on workflow instances, potentially affecting performance and the accuracy of workflow alterations.
  • Further investigation into how filters are applied and processed in the API might be necessary to identify the root cause of this discrepancy.
@sfmskywalker sfmskywalker added bug Something isn't working elsa 3 This issue is specific to Elsa 3 labels Mar 20, 2024
@sfmskywalker sfmskywalker added this to the Elsa 3.1 milestone Mar 20, 2024
@sfmskywalker sfmskywalker self-assigned this Mar 20, 2024
@elsa-workflows elsa-workflows deleted a comment from glime-ai bot Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working elsa 3 This issue is specific to Elsa 3
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant