Class LocalTriggerManager.ScriptScheduleTriggerArgumentsBean

  • All Implemented Interfaces:
    mks.frame.triggers.ScriptExposableBean
    Enclosing class:
    LocalTriggerManager

    public static class LocalTriggerManager.ScriptScheduleTriggerArgumentsBean
    extends ScriptBaseBean
    implements mks.frame.triggers.ScriptExposableBean
    This bean is created for a Scheduled trigger. The query for the trigger is run, and the set of matching issues is passed to the trigger for that query in this imScheduleTriggerArgumentsBean.

    Scheduled triggers have a different transaction model from event triggers. Event triggers are only permitted to update issues from the PRE trigger. At that point, we are already in a transaction, and all PRE triggers along with all secondary issues that are modified by of the scripts or assignments or secondary PRE triggers, are part of the same transaction. Any failure stops all the triggers, and rolls back the entire transaction.

    For scheduled triggers however, we don't have a transaction. There is no concept of a primary issue, only secondary issues. Thus, each trigger rule starts a new transaction, which is committed if the rule completes successfully. PRE triggers will run for each secondary trigger becoming part of the same transaction. If the rule fails, the transaction for the single trigger rule is rolled back; the next scheduled trigger rule then runs.

    It is possible to change this methodology in your scheduled trigger to smaller transactions, see the commit() function on the imServerBean.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getExposedName()
      Get the name of this bean: imScheduleTriggerArgumentsBean
      int[] getIssues()
      Retrieve the list of issues that was matched by the query that was specified by this trigger rule.
      java.lang.String getTriggerName()
      Return the name of the scheduled trigger which caused this script to run.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface mks.frame.triggers.ScriptExposableBean

        getEnvironmentBean, setEnvironmentBean
    • Constructor Detail

      • ScriptScheduleTriggerArgumentsBean

        public ScriptScheduleTriggerArgumentsBean​(java.lang.String name,
                                                  java.util.List<mks.ci.server.engine.Issue> l)
    • Method Detail

      • getIssues

        public int[] getIssues()
        Retrieve the list of issues that was matched by the query that was specified by this trigger rule. The list may be zero length, if there were no matches.
        Returns:
        an array of integers, each one is an issue id number. Use the getIssue method on the server bean to actually obtain the issue bean for each issue.
      • getTriggerName

        public java.lang.String getTriggerName()
        Return the name of the scheduled trigger which caused this script to run.
      • getExposedName

        public java.lang.String getExposedName()
        Get the name of this bean: imScheduleTriggerArgumentsBean
        Specified by:
        getExposedName in interface mks.frame.triggers.ScriptExposableBean
        Specified by:
        getExposedName in class ScriptBaseBean
        Returns:
        the bean name: imScheduleTriggerArgumentsBean.