RT::Lifecycle - class to access and manipulate lifecycles
A lifecycle is a list of statuses that a ticket can have. There are three groups of statuses: initial, active and inactive. A lifecycle also defines possible transitions between statuses. For example, in the 'default' lifecycle, you may only change status from 'stalled' to 'open'.
It is also possible to define user-interface labels and the action a user should perform during a transition. For example, the "open -> stalled" transition would have a 'Stall' label and the action would be Comment. The action only defines what form is showed to the user, but actually performing the action is not required. The user can leave the comment box empty yet still Stall a ticket. Finally, the user can also just use the Basics or Jumbo form to change the status with the usual dropdown.
Simple constructor, takes no arguments.
Takes a name of the lifecycle and loads it. If only a Type is provided, loads the global lifecycle with statuses from all named lifecycles of that type.
Can be called as class method, returns a new object, for example:
my $lifecycle = RT::Lifecycle->Load( Name => 'default');
Returns an object which may be a subclass of RT::Lifecycle (RT::Lifecycle::Ticket, for example) depending on the type of the lifecycle in question.
List available lifecycles. This list omits RT's default approvals lifecycle.
Takes: An optional parameter for lifecycle types other than tickets. Defaults to 'ticket'.
Returns: A sorted list of available lifecycles.
Returns a list of all lifecycles, including approvals.
Takes: An optional parameter for lifecycle types other than tickets. Defaults to 'ticket'.
Returns: A sorted list of all available lifecycles.
Returns name of the loaded lifecycle.
Returns the type of the loaded lifecycle.
Methods to get statuses in different sets or validating them.
Returns an array of all valid statuses for the current lifecycle. Statuses are not sorted alphabetically, instead initial goes first, then active and then inactive.
Takes optional list of status types, from 'initial', 'active' or 'inactive'. For example:
$lifecycle->Valid('initial', 'active');
Takes a status and returns true if value is a valid status for the current lifecycle. Otherwise, returns false.
Takes optional list of status types after the status, so it's possible check validity in particular sets, for example:
# returns true if status is valid and from initial or active set
$lifecycle->IsValid('some_status', 'initial', 'active');
See also </valid>.
Takes a status and returns its type, one of 'initial', 'active' or 'inactive'.
Returns an array of all initial statuses for the current lifecycle.
Takes a status and returns true if value is a valid initial status. Otherwise, returns false.
Returns an array of all active statuses for this lifecycle.
Takes a value and returns true if value is a valid active status. Otherwise, returns false.
Returns an array of all inactive statuses for this lifecycle.
Takes a value and returns true if value is a valid inactive status. Otherwise, returns false.
In some cases when status is not provided a default values should be used.
Takes a situation name and returns value. Name should be spelled following spelling in the RT config file.
Returns the status that should be used by default when ticket is created.
Takes status and returns list of statuses it can be changed to.
Is status is empty or undefined then returns list of statuses for a new ticket.
If argument is ommitted then returns a hash with all possible transitions in the following format:
status_x => [ next_status, next_status, ... ],
status_y => [ next_status, next_status, ... ],
Takes two statuses (from -> to) and returns true if it's valid transition and false otherwise.
Takes two statuses (from -> to) and returns the right that should be checked on the ticket.
Returns hash with description of rights that are defined for particular transitions.
Takes a status and returns list of defined actions for the status. Each element in the list is a hash reference with the following key/value pairs:
Takes lifecycle as a name string or an object and returns a hash reference with move map from this cycle to provided.
Takes a lifecycle as a name string or an object and returns true if move map defined for move from this cycle to provided.
Takes no arguments and returns hash with pairs that has no move maps.
A class method that takes no arguments and returns list of strings that require translation.
Create a lifecycle. To clone from an existing lifecycle, pass its Name to Clone.
Returns (STATUS, MESSAGE). STATUS is true if succeeded, otherwise false.
Update passed lifecycle to the new configuration.
Returns (STATUS, MESSAGE). STATUS is true if succeeded, otherwise false.
Update lifecycle maps.
Returns (STATUS, MESSAGE). STATUS is true if succeeded, otherwise false.
Validate passed Lifecycle data structure.
Returns (STATUS, MESSAGE). STATUS is true if succeeded, otherwise false.
Validate lifecycle Maps.
Returns (STATUS, MESSAGES). STATUS is true if succeeded, otherwise false.
Update lifecycle's web admin layout.
Returns (STATUS, MESSAGE). STATUS is true if succeeded, otherwise false.
← Back to index