Routines for rrulp_wf.kb


R_AddApprovalsToOldChange

File Name

rrulp_wf.kb

Syntax

R_AddApprovalsToOldChange IS

Parameters

None

Returns

Nothing

Side Effects

None

Description

This routine adds approval records to the corresponding change on the AChanges stack.

Dialog Forms Called

None


R_ApplyRuleActionsToChange

File Name

rrulp_wf.kb

Syntax

R_ApplyRuleActionsToChange(VAL w: WINDOW): INTEGER IS

Parameters

w - Current window

Returns

Integer

Side Effects

None

Description

This routine applies rule actions to a change.

Dialog Forms Called

None


R_ApprovalInList

File Name

rrulp_wf.kb

Syntax

R_ApprovalInList(VAL approvals: LIST OF R_APPROVAL_REC, VAL approver_ID: INTEGER): BOOLEAN IS

Parameters

approvals - List of approval requirements [users, groups, or organizations]

approver_id - An approver ID.

Returns

Boolean

Side Effects

None

Description

This routine determins if an approval requirement is already in a given list.

Dialog Forms Called

None


R_ChangeWithinRuleTimeCriteria

File Name

rrulp_wf.kb

Syntax

R_ChangeWithinRuleTimeCriteria: BOOLEAN IS

Parameters

None

Returns

Boolean

Side Effects

None

Description

This routine checks to see if time dependent rule falls within the time window.

Dialog Forms Called

None


R_EvalPhrase

File Name

rrulp_wf.kb

Syntax

R_EvalPhrase(VAL FieldValue: STRING, VAL Operator: STRING, VAL GivenValue: STRING): BOOLEAN IS

Parameters

FieldValue - The change request value for this field

Operator - The operator as defined in the rule definition

GivenValue - The rule value being compared against

Returns

Boolean

Side Effects

None

Description

This function evaluates a rule definition phrase to determine if * it is true or false. Based on that answer, the rule will * be applied.

Dialog Forms Called

None


R_EvalRule

File Name

rrulp_wf.kb

Syntax

R_EvalRule(VAL ruleBody: STRING): BOOLEAN IS

Parameters

ruleBody - Rule definition to evaluate

Returns

Boolean

Side Effects

None

Description

This routine evaluates a rule to determine whether it is true or false.

Dialog Forms Called

None


R_EvaluateChangeAgainstRule

File Name

rrulp_wf.kb

Syntax

R_EvaluateChangeAgainstRule: BOOLEAN IS

Parameters

None

Returns

Boolean

Side Effects

None

Description

This routine evaluates a change against a rule to determine the rule condition's truth.

Dialog Forms Called

None


R_ExecuteCallActionFromRule

File Name

rrulp_wf.kb

Syntax

R_ExecuteCallActionFromRule(VAL this_Action: R_ACTIONS_REC): INTEGER IS

Parameters

this_Action - Current action record

Returns

Integer

Side Effects

None

Description

This routine calls a system command from a rule action.

Dialog Forms Called

None


R_FireRulesAgainstChange

File Name

rrulp_wf.kb

Syntax

R_FireRulesAgainstChange(VAL w: WINDOW, REF Item_String: STRING): INTEGER;

Parameters

w - Current window

Item_String - List of items which were modified by the rules.

Returns

Integer

Side Effects

?

Description

This routine fires rules against a change request.

Dialog Forms Called

None


R_FireTimeDependentRulesForChanges

File Name

rrulp_wf.kb

Syntax

R_FireTimeDependentRulesForChanges(VAL w: WINDOW): INTEGER IS

Parameters

w - Window handle

Returns

Integer

Side Effects

None

Description

This routine executes time-dependent rules against changes.

Dialog Forms Called

None


R_GetPhraseBetweenParens

File Name

rrulp_wf.kb

Syntax

R_GetPhraseBetweenParens(REF ruleBody: STRING): STRING IS

Parameters

ruleBody - Rule definition that is being worked with.

Returns

String

Side Effects

None

Description

This routine returns a rule definition phrase existing between parentheses.

Dialog Forms Called

None


R_GetScheduleDateForChange

File Name

rrulp_wf.kb

Syntax

R_GetScheduleDateForChange(VAL type: INTEGER): DATE IS

Parameters

type - A 'yes' or 'no' value

Returns

Date

Side Effects

None

Description

This routine returns the schedule date for a given change.

Dialog Forms Called

None


R_LoadChangeApprovalFromRule

File Name

rrulp_wf.kb

Syntax

R_LoadChangeApprovalFromRule(VAL w: WINDOW, VAL this_Action: R_ACTIONS_REC) IS

Parameters

w - Current window

this_Action - Current action record

Returns

Nothing

Side Effects

None

Description

This routine creates an approval from a rule action.

Dialog Forms Called

None


R_LoadChangeScheduleFromRule

File Name

rrulp_wf.kb

Syntax

R_LoadChangeScheduleFromRule(VAL w: WINDOW, VAL this_Action: R_ACTIONS_REC) IS

Parameters

w - Current window

this_Action - Current action record

Returns

Nothing

Side Effects

None

Description

This routine creates a scheduled task from a rule action.

Dialog Forms Called

None


R_ParseRule

File Name

rrulp_wf.kb

Syntax

R_ParseRule(VAL ruleBody: STRING): BOOLEAN IS

Parameters

ruleBody - Rule definition to parse

Returns

Boolean

Side Effects

None

Description

This routine parses a rule to determine if it is valid.

Dialog Forms Called

None


R_RuleCanFireagain

File Name

rrulp_wf.kb

Syntax

R_RuleCanFireagain: BOOLEAN

Parameters

None

Returns

Boolean

Side Effects

None

Description

A rule having "action types" of 'SET', 'ADD SCHEDULE', or 'CALL' will be applied eaCH time the corresponding rule evaluates True, and ONLY once for actions types of either 'ADD APPROVER' or 'NOTIFY' per change request. We want to abort the Rule Firing process as early as we can in order to optimize processing time. If we can find a rule that has only rule action types of 'ADD APPROVER' or 'NOTIFY' and this rule has already fired, then we can abort early. BUSINESS RULE: Applying Rule Actions - The actions of adding an approver or sending notifications via a rule will only occure the first time that rule evaluates to true. These two actions will not be applied for a given change request more than once.

Dialog Forms Called

None


R_SetChangeFieldBasedOnRule

File Name

rrulp_wf.kb

Syntax

R_SetChangeFieldBasedOnRule(VAL w: WINDOW, VAL this_Action: R_ACTIONS_REC) IS

Parameters

w - Current window

this_Action -

Returns

Nothing

Side Effects

Updates the R_G_SCHANGE.CStack field, * updates the Change_Mask, and * updates the appropriate dialog control.

Description

This routine sets a change request field based on a rule defined. * action.

Dialog Forms Called

None


R_SetRequesterFieldsForModification

File Name

rrulp_wf.kb

Syntax

R_SetRequesterFieldsForModification(VAL w: WINDOW) IS

Parameters

w - Current window

Returns

Nothing

Side Effects

None

Description

This routine sets base change fields which cannot be modified.

Dialog Forms Called

None


R_SubstituteTruthValue

File Name

rrulp_wf.kb

Syntax

R_SubstituteTruthValue(VAL givenRuleBody: STRING): STRING IS

Parameters

givenRuleBody - Rule condition

Returns

String

Side Effects

None

Description

Given the following element from a hypothetical rule condition, "$V1$G1 AND $V2$G2 AND $V3$G3," this routine parses out this string to the point that "R_EvalPhrase( valueFieldA, operator, valueFieldB )" may be called and return a value of TRUE or FALSE. * By the completion of this function, a rule definition of "$V1$G1 AND $V2$G2 AND $V3$G3..." returns a string in the following format: "TRUE AND TRUE AND TRUE". [ exact return values depend on the evaluation of each rule condition taking into consideration the use of conjuctions such as "AND", "OR" and other phraseology (for instance, "NOT",")","(", etc....] Note: Notice the "early-abort" logic coded below to minimize processing time. The benefits of this functionality are realized increasingly * with the number of complex rule conditions that * are being processed for a given change request.

Dialog Forms Called

None


R_TellRequesterofStatusChange

File Name

rrulp_wf.kb

Syntax

R_TellRequesterofStatusChange( VAL status_id: STRING ) IS

Parameters

status_id - Status id change request is being set to

Returns

Nothing

Side Effects

None

Description

This routine sends a notification to the requester that the status_id has been modified as the result of a rule firing.

Dialog Forms Called

None


R_UpdateRulesCache

File Name

rrulp_wf.kb

Syntax

R_UpdateRulesCache IS

Parameters

None

Returns

Nothing

Side Effects

None

Description

This routine takes a rule that has been parsed and updates the rule cache, R_G_SRule.ARules, so that the rule will not have to reparsed in the future. Beware, the rule cache is flushed whenever administrative actions are performed to any rule. History: This routine is being added as part of the Rules Caching enhancement for PTF 50204, a project initiated to decrease processing times.

Dialog Forms Called

None


R_ValidType

File Name

rrulp_wf.kb

Syntax

R_ValidType(REF InString:STRING, VAL Separator:STRING, VAL separatorsNeeded: INTEGER, VAL ConvertToType:STRING): BOOLEAN IS

Parameters

InString - Text string being passed-in

Separator - Decimal, date or time being sought

separatorsNeeded - Number of separators expected to be found

ConvertToType - Type to convert InString to if needed

Returns

Boolean

Side Effects

None

Description

This routine converts a string to the correct type based upon * parameters passed-in.

Dialog Forms Called

None