Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-8630

Fix inverted event handler EL expression evaluation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5
    • Fix Version/s: 5.7.1
    • Component/s: Automation
    • Backlog priority:
      300
    • Impact type:
      Configuration format change
    • Upgrade notes:
      Hide

      Use the new parameter "condition" instead of "expression" when migrating event handlers

      Show
      Use the new parameter "condition" instead of "expression" when migrating event handlers

      Description

      For instance,

      If we have an expression like

      !Document.hasFacet("Folderish")
      

      It will execute the event handler only if the document DOES HAVE the facet folderish

      From org.nuxeo.ecm.automation.core.events.EventHandler:250

              if (expression != null) {
                  if (expr == null) {
                      expr = Scripting.newExpression(expression);
                  }
                  if ((Boolean) expr.eval(ctx)) {
                      return false;
                  }
              }
              return true;
      

      is wrong and should be

              if (expression != null) {
                  if (expr == null) {
                      expr = Scripting.newExpression(expression);
                  }
                  if (!(Boolean) expr.eval(ctx)) {
                      return false;
                  }
              }
              return true;
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.