Class LocalTriggerManager.ScriptRelationshipBean

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

    public static class LocalTriggerManager.ScriptRelationshipBean
    extends ScriptBaseBean
    implements mks.frame.triggers.ScriptExposableBean
    Bean which describes a single link from one issue to another. Each such link has a set of bit flags; and a created timestamp.

    These beans are returned by getRelationshipFieldBeans and getNewRelationshipFieldBeans When you call the set methods on this bean, you are only updating your copy, until you invoke a method to update a particular relationship field. Thus, for example, you might have code which updated all of a particular relationship field's link flags:

     var fieldName = "Child Requirements";
     var issues = delta.getNewRelationshipFieldBeans(fieldName);
    
     for (var i = 0; i < issues.length; i++)
         issues[i].setFlag("suspect");
     delta.setRelationshipFieldValue(fieldName, issues);
     
    • Constructor Summary

      Constructors 
      Constructor Description
      ScriptRelationshipBean​(mks.ci.api.CIRelationship rv, mks.ci.server.engine.Field f)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearAllSuspectFlags()
      Clear all of the flags on this link that qualify as "suspect"
      void clearFlag​(java.lang.String flagname)
      Clear the flag named flagname on this link.
      java.util.Date getCreatedDate()
      Retrieve the date this link was created
      java.lang.String getExposedName()
      Get the name of this bean: imRelationshipBean
      int getIssue()
      Return the issue id number of the target of this link.
      int getLinkFlags()
      Returns the integer mask for the link flags on the current relationship.
      boolean isFlagSet​(java.lang.String flagname)
      Is the flag named flagname set on this link?
      boolean isSuspect()
      Returns true if at least one flag currently set on the relationship is a suspect flag.
      void setFlag​(java.lang.String flagname)
      Set the flag named flagname on this link.
      java.lang.String toString()
      For debugging purposes
      • Methods inherited from class java.lang.Object

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

        getEnvironmentBean, setEnvironmentBean
    • Constructor Detail

      • ScriptRelationshipBean

        public ScriptRelationshipBean​(mks.ci.api.CIRelationship rv,
                                      mks.ci.server.engine.Field f)
    • Method Detail

      • getIssue

        public int getIssue()
        Return the issue id number of the target of this link.
      • getLinkFlags

        public int getLinkFlags()
                         throws mks.frame.triggers.TriggerException
        Returns the integer mask for the link flags on the current relationship.
        Returns:
        int the bit mask
        Throws:
        mks.frame.triggers.TriggerException
      • isSuspect

        public boolean isSuspect()
                          throws mks.frame.triggers.TriggerException
        Returns true if at least one flag currently set on the relationship is a suspect flag.
        Returns:
        True if any one of the flags on the relationship is suspect
        Throws:
        mks.frame.triggers.TriggerException
      • isFlagSet

        public boolean isFlagSet​(java.lang.String flagname)
                          throws mks.frame.triggers.TriggerException
        Is the flag named flagname set on this link?
        Throws:
        mks.frame.triggers.TriggerException - if the named link flag doesn't exist
      • setFlag

        public void setFlag​(java.lang.String flagname)
                     throws mks.frame.triggers.TriggerException
        Set the flag named flagname on this link.
        Throws:
        mks.frame.triggers.TriggerException - if the named link flag doesn't exist
      • clearFlag

        public void clearFlag​(java.lang.String flagname)
                       throws mks.frame.triggers.TriggerException
        Clear the flag named flagname on this link.
        Throws:
        mks.frame.triggers.TriggerException - if the named link flag doesn't exist
      • clearAllSuspectFlags

        public void clearAllSuspectFlags()
                                  throws mks.frame.triggers.TriggerException
        Clear all of the flags on this link that qualify as "suspect"
        Throws:
        mks.frame.triggers.TriggerException - not thrown at this time, reserved for future use
      • getCreatedDate

        public java.util.Date getCreatedDate()
        Retrieve the date this link was created
      • getExposedName

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

        public java.lang.String toString()
        For debugging purposes
        Overrides:
        toString in class java.lang.Object