Introduction
This document describes the processes how offering rules (for registrations and instructors) are generated and updated using the Offering Rule Matrix (aka Registration Rule Generator) and the Offering Rule Generator (aka Registration Rule Generator) DOS prompt tool in combination with the Core client command GetOfferingRuleMatrix.
The Offering Rule Matrix is usually extracted with the Core client command GetOfferingRuleMatrix before any changes are made to the existing rules. This ensures an accurate picture of what is in the system before any change is made. The section Offering Rule Matrix and Offering Rule Generator#Customer Specific Processes below describes any customer specific requirements.
Workflow to Create and Update Offering Rules
- The customer would get a pre-filled Offering Rule Matrix (courses/OrgProfileField values) which has been extracted from the LMS via GetOfferingRuleMatrix command
- Instead of a complete Offering Rule Matrix, it is possible to only send an partial Offering Rule Matrix to the customer which only contains courses which need a rule update
- Generate the offering rules (either instructor or registrations) using the Offering Rule Generator
- Pause the rule background thread via command PauseAutomaticOfferingRuleProcessing. Check the status of the background thread with GetOfferingRuleStatus to make sure the thread is paused and not in the middle of processing.
- Remove previous offering rules for courses (the set of rules to be removed is created by the Offering Rule Generator)
- Create the new offering rules - commands created by the Offering Rule Generator
Note: The commands to add new rules automatically checks if the OPF single choice values exist - Re-evaluate the rules for courses for which the rules have been changed (student and/or instructor) via command ReEvaluateOfferingRulesByCoursePathMatch (task
-
PSDEV-760Getting issue details...
STATUS
will add the proper commands to the output file of the Offering Rule Generator)
Note: you can check the progress of the re-eval command by executing GetOfferingRuleStatus in a new pages/dev client window. - Continue rule background thread via command ContinueAutomaticOfferingRuleProcessing once all re-eval commands finished.
- Check the that the background thread is not paused anymore with GetOfferingRuleStatus
Note: It is not required to keep the Offering Rule Matrix on file because if the customer asks for an Offering Rule Matrix the next time we will freshly export a new matrix via GetOfferingRuleMatrix
Offering Rule Matrix
The Offering Rule Matrix (a.k.a. Registration Rule Matrix) is a csv representation of registration or instructor rules for courses. The instructor and registration rules matrix format is slightly different.
Get Offering Rule Matrix via GetOfferingRuleMatrix
The command GetOfferingRuleMatrix is able to extract registration/instructor rules into an Offering Rule Matrix (csv format) accepted by the Offering Rule Generator and makes it easy to update any rules.
GetOfferingRuleMatrix [orgPath] [type: 'Registration' (student) or 'Instructor'] [Optional: IsTransposed (Default to true for new format, false for original matrix format] [Optional: CsvOutputPath (Note: if not provided, outputs to command line)] [optional: -includeOpfs:"OPFName1|OPFName2|…|OPFNameX"] [optional: -includeAllOpfValues]
All OPFs and OPF values which are being used in rules are automatically included in the matrix. That means if an OPF 'Rank' contains values Captain, Engineer and Deckhand and the rules only use Captain, only Captain is included in the matrix.
Note: switch parameters can be placed in any order - they are identified by the parameter name like '-includeAllOpfValues'
mandatory: orgPath
The organization path to extract the offering rules from
mandatory: type
The offering rule type to export - Registration or Instructor rules
semi-optional: IsTransposed
By default we only export transposed Offering Rule Matrices (IsTransposed=true). That is, csv rows for OPF values and columns for courses. Use false to get the old Offering Rule Matrix format
Note: if parameter CsvOutputPath is used, this parameter is mandatory
optional: CsvOutputPath
The Offering Rule Matrix output will be written directly into a file on the hosting server. The Offering Rule Matrix is also output to the client command window.
Note: the parameter IsTransposed must be set if this parameter is used (order of parameters is important)
optional switch parameter -includeAllOpfValues
This option will include all OPF values of an SCS OPF in case the OPF is referenced in a rule (order all OPF values alphabetically).
Example:
An OPF 'Rank' single-choice-string contains 3 values Captain, Engineer and Deckhand. If the rules only referenced Rank values Captain and Deckhand, the option -includeAllOpfValues would also include the not used OPF value Engineer in the Offering Rule Matrix.
optional switch parameter -includeOpfs:OPFName1|OPFName2|…|OPFNameX
This parameter includes all listed OPFs in the Offering Rule Matrix even if they are not referenced in any rule. All OPFs listed must be single-choice-strings. The list is still valid if an OPF is already referenced by a rule. The Offering Rule Matrix would contain all available OPF values.
If an OPF name contains white spaces, enclose the whole OPF list with double quotes - example: -includeOpfs:"Rank|Functional Position|Vessel"
Current Client Command Limitations
All limitations for the client command also apply to the Offering Rule Generator:
- some rule predicates are not supported and can't be extracted. If a rule does contain one of those not (yet) supported predicates it will list them in the command output
- Manual rules are not included in the matrix - in order to include in the matrix the rule needs to be marked as AUTO
- De-registration rules are interpreted as inverts of registration rules. Therefore, asymmetric registration/de-registration rules pair will loose the asymmetry, using the registration rule as truth.
Generate Registration Rules via Registration Rule Generator Tool
The Registration Rule Generator can be found here. Unzip the latest version to a local folder and run DOS prompt (Ctrl+R, type 'cmd' and hit enter).
The Offering Rule Generator takes old and new (transposed) formats of Offering Rule Matrices as input. The output of the tool are client commands to remove any old registration/instructor rules for which the Offering Rule Matrix has a course for and commands to add the new registration/instructor rules.
Example
Student -f "D:\CMG\cmgtestRegRulesTest.csv" -o "D:\Stefan_Data\CMG\SD-2057\CmgTestRegistrationRule_Commands.txt" -p /Root/Carnival/CMG -v
Instructor -f "D:\CMG\cmgtestInstructorRulesTest.csv" -o "D:\CMG\CmgTestInstructorRule_Commands.txt" -p /Root/Carnival/CMG -v
Replace/Upload Offering Rules in LMS
TODO: add full manual on how to replace/upload registration rules created by the Offering Rule Generator.
Since release v3.0.5+ any updated registration rule needs to be run manually to bring the rule engine up to date. The rules need to be run because rule changes/invalidate the ‘from’ date that the new rule engine uses internally to scan for changes. If you just let the engine run normally after rule updates it might miss people who are: (a) affected by the new rule, and (b) have not changed since the internal from date the engine records.
There are command lines to run the rules only for specific courses, so if you have only changed the rules for a small set you can just run the rules for those (i.e. reEvaluateOfferingRulesByCoursePathMatch (-logOnly, -debug) [RuleType (Registration, Instructor, All)] [string: startPath] [string: terminalElement] [batchSize: optional, default Core.OfferingRuleEvaluatorBatchSize])
The rule engine doesn’t care that the attributes have been updated (i.e. by the rule generator) and doesn’t make any attempt to determine if rules have changed. So its up to a human in this case to decide what rules have changed semantically and ensure to manually run the rules for those courses.
Before updating any registration rule the rule engine needs to be paused.
Commands to pause/continue/check status of the automatic registration rule processing:
PauseAutomaticOfferingRuleProcessing
getOfferingRuleStatus
ContinueAutomaticOfferingRuleProcessing
Customer Specific Processes
Some customers will have certain workflows how the Offering Rule Matrix will be updated and where the file will be maintained. This section contains a list and description of the common process for customers.
Moran Tug
Moran Tug usually provides an updated Offering Rule Matrix file on their shared OneDrive: https://morantug-my.sharepoint.com/:f:/p/louisew/ElaWorMNr_9FkAfKd4mu6LoBfqE4pwv-8hT8p4WE0i_D8g?e=5%3ab6a80c75e1bf4883bed19030ccb784c5
Login as support@marinels.com
New Courses
Provide Moran with an empty Offering Rule Matrix extracted from the system whenever they need to add new courses. We will check correctness and add the courses to the full Offering Rule Matrix on their OneDrive.
Update Existing Courses
Moran will use the full Offering Rule Matrix to update any existing courses. After the changes we will check correctness and upload the new registration rules to the LMS.
Related articles
Filter by label
There are no items with the selected labels at this time.
0 Comments