Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4074

Heritage listeners can't be referred to by file path

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 5.6.11.1-p5, 5.9.1-p5
    • Fix Version/s: 6.16.0
    • Component/s: Listeners
    • Labels:
    • Sprint:
      SR4J Sprint 71, SR4J Sprint 87, SR4J Sprint 88, SR4J Sprint 89
    • Critical Points:
      10

      Description

      Listener 'script' files that use the old approach of declaring a class that implements workflowEvent will not be properly invoked if the listener config refers to them by path. This is because we assume that any script identifier (file path or FQCN) which ends in .groovy must be pointing to a regular Groovy script, rather than a class.

      To reproduce:

      • Create a .groovy file under one of SR's roots that defines a class with the workflowEvent method. (Make sure the relative path/filename matches the package/class name respectively.)
      • Create a custom scripted listener that uses the path of the file you just created (i.e. my/file/path/MyClass.groovy, rather than my.file.path.MyClass).
      • Do something that will trigger the listener.

      Checking the logs will show that the listener was not successfully invoked because SR couldn't find a run method for it, i.e. it thought it was a script rather than a class. Replacing the path with the corresponding FCQN in the listener config will resolve this.

        Attachments

          Activity

            People

            Assignee:
            twozniak Tomasz Wozniak
            Reporter:
            jchoules Joanna Choules
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: