Add "not equals" string comparison operator

Created on 8 July 2024, 2 months ago
Updated 24 July 2024, about 2 months ago

Problem/Motivation

In my use case, I was asked to track user roles and send an email to site administrators when a user's role(s) changed. My first thought on doing this was to compare the user's original roles against the user's current roles, and if they didn't match, send the email. However, I found that the "Compare two scalar values" template didn't provide this operator. I found the Detect user role changes model in the documentation library, but for some reason couldn't get it to work.

Steps to reproduce

  1. Add a Sequence/MessageFlow or Association to a task.
  2. Client the Sequence/MessageFlow or Association arrow.
  3. Apply the "Compare two scalar values" template.
  4. In the Custom Properties tab, expand the "Comparison Operator" field. "Not equals" is not listed as an option.

Proposed resolution

Add a "Not equals" option to the list of comparison operators.

Remaining tasks

Patch incoming.

User interface changes

Patch will add an option to the list of comparison operators available in the "Custom Properties" tab in the "Compare two scalar values" template.

✨ Feature request
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jsutta United States

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jsutta
  • πŸ‡ΊπŸ‡ΈUnited States jsutta United States

    Attaching the following:

    • A patch for the 1.1.x branch (because this is the branch I'm currently using)
    • A patch for the 2.1.x branch
    • A copy of the model that led to this issue. It listens for updates to user entities and, if a role change is detected, sends an email to the site admins, which it finds via a view with the machine name userlist. Not sure if it has dependencies (like our user list view) that would prevent it from being imported... I'm happy to upload a simplified version if anyone's curious.
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    @jsutta thank you for your input. Contributions to this project are very welcome.

    In this particular case, the extra feature is not required, as the functionality is already available: for every condition, not only the arbitrary comparison, there is a flag Negate condition. If you set that to Yes, then you already get the "Not equal" condition. That is very flexible because you can use it with all the other comparison types as well, and of course with all other conditions in ECA.

  • πŸ‡ΊπŸ‡ΈUnited States jsutta United States

    Ah very true, I'd forgotten about Negate condition. I was able to test and verify that this is what I need. Thank you for your quick response @jurgenhaas, and for your work on this amazing functionality!

  • Status changed to Fixed about 2 months ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks a lot for your feedback.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024