Name
global.SLAConditionSimple
Description
Override the SLAConditionBase methods, with a simple variation that interprets conditions purely for the transition. (affecting attach, reattach, and cancel.) An SLA instance can still be cancelled if the start_condition and the pause_condition are both false. (set com.snc.sla.default_conditionclass property to SLAConditionSimple , to use by default for SLA condition tests when not overridden by the SLA definition);
Script
var SLAConditionSimple = Class.create();
SLAConditionSimple.prototype = Object.extendsObject(SLAConditionBase, {
// start if start_condition is true
// (without testing stop_condition)
attach: function() {
this.lu.logInfo('SLAConditionSimple.attach called');
return this._conditionMatches(this.sla.start_condition);
},
// reattach if reset_condition is true
// (without testing start_condition)
reattach: function() {
this.lu.logInfo('SLAConditionSimple.reattach called');
return this._conditionMatches(this.sla.reset_condition);
},
// cancel only if the attach (start_condition) is false *and* we're not paused
// or if the task is switched to a different CI from the existing active service-offering SLA
// (NB. tested after, and only if (complete() || reattach()) is false)
cancel: function() {
this.lu.logInfo('SLAConditionSimple.cancel called');
return ((!this.attach() && !this.pause()) || this._cancelServiceOffering());
},
type: 'SLAConditionSimple'
});
Sys ID
9f7ff0a70a0a2c8979dcbebc2e2a3a1c