RT::Scrip - an RT Scrip object
use RT::Scrip;
Creates a new entry in the Scrips table. Takes a paramhash with:
Queue => 0,
Description => undef,
Template => undef,
ScripAction => undef,
ScripCondition => undef,
CustomPrepareCode => undef,
CustomCommitCode => undef,
CustomIsApplicableCode => undef,
Returns (retval, msg); retval is 0 for failure or scrip id. msg is a textual description of what happened.
Delete this object
Retuns an RT::Queue object with this Scrip's queue
Retuns an RT::Action object with this Scrip's Action
Retuns an RT::ScripCondition object with this Scrip's IsApplicable
Loads scrip's condition and action modules.
Retuns an RT::Template object with this Scrip's Template
This method instantiates the ScripCondition and ScripAction objects for a single execution of this scrip. it then calls the IsApplicable method of the ScripCondition. If that succeeds, it calls the Prepare method of the ScripAction. If that succeeds, it calls the Commit method of the ScripAction.
Usually, the ticket and transaction objects passed to this method should be loaded by the SuperUser role
Calls the Condition object's IsApplicable method
Upon success, returns the applicable Transaction object. Otherwise, undef is returned.
If the Scrip is in the TransactionCreate Stage (the usual case), only test the associated Transaction object to see if it is applicable.
For Scrips in the TransactionBatch Stage, test all Transaction objects created during the Ticket object's lifetime, and returns the first one that is applicable.
Calls the action object's prepare method
Calls the action object's commit method
Helper menthod for HasRight. Presets Principal to CurrentUser then calls HasRight.
Takes a param-hash consisting of "Right" and "Principal" Principal is an RT::User object or an RT::CurrentUser object. "Right" is a textual Right string that applies to Scrips.
This routine compile-checks the custom prepare, commit, and is-applicable code to see if they are syntactically valid Perl. We eval them in a codeblock to avoid actually executing the code.
If one of the fields has a compile error, only the first is reported.
Returns an (ok, message) pair.
Returns the current value of id. (In the database, id is stored as int(11).)
Returns the current value of Description. (In the database, Description is stored as varchar(255).)
Set Description to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Description will be stored as a varchar(255).)
Returns the current value of ScripCondition. (In the database, ScripCondition is stored as int(11).)
Set ScripCondition to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ScripCondition will be stored as a int(11).)
Returns the ScripCondition Object which has the id returned by ScripCondition
Returns the current value of ScripAction. (In the database, ScripAction is stored as int(11).)
Set ScripAction to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ScripAction will be stored as a int(11).)
Returns the ScripAction Object which has the id returned by ScripAction
Returns the current value of ConditionRules. (In the database, ConditionRules is stored as text.)
Set ConditionRules to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ConditionRules will be stored as a text.)
Returns the current value of ActionRules. (In the database, ActionRules is stored as text.)
Set ActionRules to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ActionRules will be stored as a text.)
Returns the current value of CustomIsApplicableCode. (In the database, CustomIsApplicableCode is stored as text.)
Set CustomIsApplicableCode to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, CustomIsApplicableCode will be stored as a text.)
Returns the current value of CustomPrepareCode. (In the database, CustomPrepareCode is stored as text.)
Set CustomPrepareCode to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, CustomPrepareCode will be stored as a text.)
Returns the current value of CustomCommitCode. (In the database, CustomCommitCode is stored as text.)
Set CustomCommitCode to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, CustomCommitCode will be stored as a text.)
Returns the current value of Stage. (In the database, Stage is stored as varchar(32).)
Set Stage to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Stage will be stored as a varchar(32).)
Returns the current value of Queue. (In the database, Queue is stored as int(11).)
Set Queue to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Queue will be stored as a int(11).)
Returns the current value of Template. (In the database, Template is stored as int(11).)
Set Template to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Template will be stored as a int(11).)
Returns the current value of Creator. (In the database, Creator is stored as int(11).)
Returns the current value of Created. (In the database, Created is stored as datetime.)
Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).)
Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.)
← Back to index