com.telelogic.cs.api

Class TransitionEvent

  • All Implemented Interfaces:
    CollectibleEvent


    public class TransitionEvent
    extends TriggerEvent
    implements CollectibleEvent
    Sent when a change request is submitted or transitioned.

    A transition trigger is defined within the Change lifecycle for individual transitions. Transition triggers can be fired when an a Change Request is submitted or transitioned. Submissions are considered to be a type of transition.

    Since:
    4.7 06
    • Constructor Summary

      Constructors 
      Constructor and Description
      TransitionEvent(User triggerUser, User adminUser, java.lang.String objectId, java.lang.String objectType, java.lang.String fromState, java.lang.String toState, Attribute[] attributes, Attribute[] requestedAttributes, boolean isPreTrigger) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      User getAdminUser()
      Gets the User object for the admin user.
      Attribute[] getAttributes()
      Gets an array of (Attributes that were modified during the submission, transition or attribute modification.
      java.lang.String getFromState()
      Gets the state that the object is coming from (i.e, START_HERE, entered, assigned, etc)
      java.lang.String getObjectId()
      Gets the object id (problem_number) of the object which caused the trigger to fire.
      java.lang.String getObjectType()
      Gets the type of object that this trigger is firing for.
      Attribute[] getRequestedAttributes()
      Gets an array of Attributes for all the attributes requested to be sent to the trigger.
      java.lang.String getStoppedTransitionMessage()
      Gets the message passed to stopTransition.
      java.lang.String getToState()
      Gets the state that the object is going to (i.e, entered, assigned, etc)
      java.lang.String getTriggerType()
      Gets the type of this trigger, that is the type of action the spawned this trigger.
      User getTriggerUser()
      Gets the User object of the user which caused the trigger to fire.
      boolean isPostTrigger()
      Gets if this trigger is a post-trigger or not, true if a post-trigger false otherwise.
      boolean isPreTrigger()
      Gets if this trigger is a pre-trigger or not, true if a pre-trigger false otherwise.
      boolean isTransitionStopped()
      Checks if the transition has been stopped by a trigger.
      void stopTransition(java.lang.String withMessage)
      Pre-transition triggers can call this to prevent a transition from occurring.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TransitionEvent

        public TransitionEvent(User triggerUser,
                               User adminUser,
                               java.lang.String objectId,
                               java.lang.String objectType,
                               java.lang.String fromState,
                               java.lang.String toState,
                               Attribute[] attributes,
                               Attribute[] requestedAttributes,
                               boolean isPreTrigger)
    • Method Detail

      • getFromState

        public java.lang.String getFromState()
        Gets the state that the object is coming from (i.e, START_HERE, entered, assigned, etc)
        Returns:
        The state that object is coming from.
      • getToState

        public java.lang.String getToState()
        Gets the state that the object is going to (i.e, entered, assigned, etc)
        Returns:
        The state that object is going to.
      • getAttributes

        public Attribute[] getAttributes()
        Gets an array of (Attributes that were modified during the submission, transition or attribute modification.
        Specified by:
        getAttributes in interface CollectibleEvent
        Returns:
        An array of Attribute objects for the modified attributes.
      • getObjectId

        public java.lang.String getObjectId()
        Gets the object id (problem_number) of the object which caused the trigger to fire. This will return an empty string on a pre-submission trigger.
        Specified by:
        getObjectId in interface CollectibleEvent
        Returns:
        The id of the object.
      • getObjectType

        public java.lang.String getObjectType()
        Gets the type of object that this trigger is firing for. The only current valid value for this is CCM_PROBLEM.
        Returns:
        The type of object the trigger is firing on.
      • getRequestedAttributes

        public Attribute[] getRequestedAttributes()
        Gets an array of Attributes for all the attributes requested to be sent to the trigger. These are attributes that were specifically marked to be sent to all triggers in the lifecycle.
        Specified by:
        getRequestedAttributes in interface CollectibleEvent
        Returns:
        Array of all requested extra attributes.
      • getAdminUser

        public User getAdminUser()
        Gets the User object for the admin user. This is the admin user object from the same database as the user object.
        Specified by:
        getAdminUser in class TriggerEvent
        Returns:
        The admin user object for the database the user object was from.
      • getTriggerUser

        public User getTriggerUser()
        Gets the User object of the user which caused the trigger to fire.
        Specified by:
        getTriggerUser in class TriggerEvent
        Returns:
        The User object of the user which caused the trigger to fire.
      • stopTransition

        public void stopTransition(java.lang.String withMessage)
        Pre-transition triggers can call this to prevent a transition from occurring. This will both prevent the transition from being shown in the interface, and prevent the actual transition if the transition is attempted in another manner. For example, this is used in the "verify_associated_task_states.js" script to prevent the resolution of CRs that have non-completed tasks.

        This method only affects pre-transition, non-async triggers. Other triggers aren't guaranteed to finish before the transition is done, and thus can't stop the transition in time.

        Parameters:
        withMessage - a message about why the transition was stopped. This message will be shown to the user when the transition fails.
      • isTransitionStopped

        public boolean isTransitionStopped()
        Checks if the transition has been stopped by a trigger.
        Returns:
        true if stopTransition was called, otherwise false.
      • getStoppedTransitionMessage

        public java.lang.String getStoppedTransitionMessage()
        Gets the message passed to stopTransition.
        Returns:
        the message about why the transition was stopped. Empty string if the message hasn't been stopped yet.
      • getTriggerType

        public java.lang.String getTriggerType()
        Description copied from class: TriggerEvent
        Gets the type of this trigger, that is the type of action the spawned this trigger. Can be used to determine what kind of trigger is firing if the same trigger script is reused for multiple trigger types.
        Specified by:
        getTriggerType in class TriggerEvent
        Returns:
        a name for the type of operation this trigger is for.
      • isPreTrigger

        public boolean isPreTrigger()
        Description copied from class: TriggerEvent
        Gets if this trigger is a pre-trigger or not, true if a pre-trigger false otherwise.
        Specified by:
        isPreTrigger in class TriggerEvent
        Returns:
        True if a pre-trigger, false otherwise.
      • isPostTrigger

        public boolean isPostTrigger()
        Description copied from class: TriggerEvent
        Gets if this trigger is a post-trigger or not, true if a post-trigger false otherwise.
        Specified by:
        isPostTrigger in class TriggerEvent
        Returns:
        True if a post-trigger, false otherwise.

© Copyright IBM Corporation 2000, 2009
US Government Users Restricted Rights--Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Notices