Name
global.ChangeRequestStateModel_standard
Description
This script include represents the state model for standard changes. The script include ChangeRequestStateHandler controls the transitioning between states using this model to determine what transitions are allowed. The script include ChangeRequestStateModelSNC_standard , which this one extends, contains the implementation for all the moving and canMove functions. Model structure using the first property draft draft - current state the change request is in nextState - the state the change request can move to without specifying a state scheduled - a state the change request can move to when in draft if this.toScheduled_canMove() returns true - when the change request moves to assess, this.toScheduled_moving() is called canceled - works in the exact same way that scheduled does ChangeRequestStateHandler keeps a mapping of these friendly state names with their respective numeric value STATE_NAMES { -5 draft , -4 assess , -3 authorize , -2 scheduled , -1 implement , 0 review , 3 closed , 4 canceled }
Script
var ChangeRequestStateModel_standard = Class.create();
ChangeRequestStateModel_standard.prototype = Object.extendsObject(ChangeRequestStateModelSNC_standard, {
draft: {
nextState: [ "scheduled" ],
scheduled: {
moving: function() {
return this.toScheduled_moving();
},
canMove: function() {
return this.toScheduled_canMove();
}
},
canceled: {
moving: function() {
return this.toCanceled_moving();
},
canMove: function() {
return this.toCanceled_canMove();
}
}
},
scheduled: {
nextState: [ "implement" ],
implement: {
moving: function() {
return this.toImplement_moving();
},
canMove: function() {
return this.toImplement_canMove();
}
},
canceled: {
moving: function() {
return this.toCanceled_moving();
},
canMove: function() {
return this.toCanceled_canMove();
}
}
},
implement: {
nextState: [ "review" ],
review: {
moving: function() {
return this.toReview_moving();
},
canMove: function() {
return this.toReview_canMove();
}
},
canceled: {
moving: function() {
return this.toCanceled_moving();
},
canMove: function() {
return this.toCanceled_canMove();
}
}
},
review: {
nextState: [ "closed" ],
closed: {
moving: function() {
return this.toClosed_moving();
},
canMove: function() {
return this.toClosed_canMove();
}
}
},
closed: {},
canceled: {},
type: "ChangeRequestStateModel_standard"
});
Sys ID
a36b27f1cb200200d71cb9c0c24c9c21