Creating and maintaining stored procedure rules
See page overview.
Enter the “Maintain Stored Procedure" page, by selecting a hyperlink from the required page. For example, you can select the “Define Prorata Rule” hyperlink from the “Create Leave Type” page.
The “Maintain Stored Procedure" page appears. The system displays the following field.
Rule For |
The name of the business process chain, in combination with the name of the pertinent business function. Using the example above, this field will show “Leave Management - Prorata Rule”, where Leave Management is the business process chain and Prorata Rule is the business function. |
The “Parameters” multiline displays the input and output parameters for the combination of business process chain and business function
The “Database Variables” multiline displays the variables specific to the business process cycle.
To define a new stored procedure rule
Enter the following
Rule ID |
The identification number or code that uniquely identifies the stored procedure rule. |
Rule Description |
The description of the rule. |
Type in the new stored procedure rule, in the “Stored Procedure” text box. Ensure that the stored procedure rule uses only parameters that are listed in the “Parameters” multiline.
Select the “Compile” pushbutton, to compile the rule.
The system compiles the new stored procedure rule. If there are no syntax errors, this rule is written to the database. See Example.
To edit an existing stored procedure rule
Enter the code of the stored procedure rule to be edited, in the “Rule ID” field.
Select the “Get” pushbutton.
The system displays the rule description, the existing code of the stored procedure, the parameters and the database variables specific to the business function.
Edit the details of the rule, in the “Stored Procedure” text box,
Select the “Compile” pushbutton, to recompile the rule.
If there are no syntax errors, the edited stored procedure rule overwrites the previous one, in the database.
To delete an existing stored procedure rule
Select the “Get” pushbutton, to retrieve the stored procedure rule to delete.
Select the “Delete” pushbutton.
The stored procedure rule is deleted from the database.
Select the “Business Rules Security Permissions” hyperlink, to set permissions for executing this stored procedure rule and for editing it.
6 Hyperlinked topics below
Use this page to create, edit and delete stored procedure rules.
To define a new stored procedure rule
To edit an existing stored procedure rule
To delete an existing stored procedure rule
Through this page, you can create one or more stored procedure rules for each combination of Business Process Chain and Business Function. For instance, you can create one for the Business Process Chain “Leave Management” and The Business Function “Entitlement”.
When you enter the “Maintain Stored Procedure” page by selecting a hyperlink from any other page, the “Rule For” drop-down list box inherits the pertinent business function from the calling page. For example, you may choose “Rule” from the “Entitlement” drop-down list box of the “Create Leave Type” page; when you do, the system activates the “Define Rule Entitlement” hyperlink that is alongside. Once you select this hyperlink, the “Maintain Stored Procedure” page appears, with the “Rule For” drop-down list box showing the following: Leave Management – Entitlement Rule. Tell me more.
The system also shows the entire list of parameters predefined for the combination of Business Process Chain and Business Function. You can view whether each parameter is an input or output, and the parameter type and length. Additionally, the system shows the exhaustive list of database variables under the business process chain.
You can now carry out one of the following:
Select the “Get” pushbutton, to retrieve the stored procedure rule that was already defined for the combination of business process chain and business function. After the system retrieves it, you can either edit it, or delete it.
Type in a name to identify a new stored procedure rule, in the “Rule ID” field, and then specify the stored procedure rule in the text box below. You are to specify the rule using the input/output parameters and the database variables.
After creating or editing the rule, you are to compile it. If there are no syntax errors, the rule is written into the database.
Given below is the example of a rule to define an employee’s entitlement for a leave type. The input parameter is the employee code, and the output parameter is the number of units of leave to which the employee is entitled.
The database variables of Job, Department, Grade etc. will be used to calculate the eligibility of the employee, as follows:
Rulefor: Leave Entitlement
RuleID: Ent_CL1
Rule Name: Entitlement rule for Casual Leave
Input Parameter: @Employee_code (Employee code)
Output Parameter: @Days (Entitlement Days)
Database variable: @Dept (Employee’s Department)
If the entitlement units depended on the employee’s department, the rule will be written as shown below:
If @dept=’DEPT1’
Select @days=10
ELSE if @dept=’DEPT2’
SELECT @days=12
This rule will be executed when the business function “Calculation of Leave Entitlement” calls it.
The “Parameters” multiline displays the following
Parameter Name |
The name of each parameter applicable for the combination of business process chain and business function |
Input/Output |
Whether the parameter is an input or an output. |
Type |
The type of parameter, whether integer, character or date. |
Length |
The length of the parameter |
“Database Variables” multiline
The “Database Variables” multiline displays the following.
Database Variable |
Each variable specific to the combination of business process chain and business function |
Database Variable Details |
The exact meaning of the variable. |