/
Offering Rule Matrix and Offering Rule Generator
Table of Contents

Introduction

This document and sub-documents describe 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 Customer Specific Processes below describes any customer specific requirements.

Workflow to Create and Update Offering Rules

  1. The customer would get a pre-filled Offering Rule Matrix (with courses and OrgProfileField values) which has been extracted from the LMS via Core command GetOfferingRuleMatrix

    • The Offering Rule Matrix can be split into sub-matrices so only a portion of the courses' offering rules are replaced.
      Important: if a course has multiple rules a sub-matrix must contain all rules for that course - rules for one course can’t be split across multiple sub-matrices (this is automatically considered by the Core command GetOfferingRuleMatrix).

  2. Generate the offering rules (either instructor or registrations) using the Offering Rule Generator

  3. Pause the offering rule background thread via command PauseAutomaticOfferingRuleProcessing. Check the status of the background thread with the command GetOfferingRuleStatus to make sure the thread is paused and not in the middle of processing. It may take a bit to finish if the background thread is paused in the middle of processing.

  4. Remove previous offering rules for courses (the commands to remove offering rules is created by the Offering Rule Generator) by executing the commands provided by the Offering Rule Generator

  5. Add new offering rules - commands created by the Offering Rule Generator
    Note: The commands to add new offering rules automatically checks if the OPF single choice values exist

  6. Re-evaluate the rules for courses for which the rules have been changed (student and/or instructor) via command ReEvaluateOfferingRulesByCoursePathMatch (task https://rippleops.atlassian.net/browse/PSDEV-760 will add the proper commands to the output file of the Offering Rule Generator)
    Note: while re-evaluation is being executed you can check the progress of the re-eval command by executing GetOfferingRuleStatus in a new pages/dev client window.

  7. Continue rule background thread via command ContinueAutomaticOfferingRuleProcessing once all re-eval commands have finished.

  8. Check the that the background thread is not paused anymore with GetOfferingRuleStatus


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 comand GetOfferingRuleMatrix

Since release v3.0.5+ any updated offering rules need to be re-evaluated 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 re-eval 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 offering rules have been updated (i.e. by the rule generator) and doesn’t make any attempt to determine if offering 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 offering rule the rule engine needs to be paused.

Commands to pause/continue/check status of the automatic offering rule processing:

  • PauseAutomaticOfferingRuleProcessing

  • getOfferingRuleStatus

  • ContinueAutomaticOfferingRuleProcessing


Offering Rule Matrix (general information)

The Offering Rule Matrix (aka Registration Rule Matrix) is a csv representation of registration and instructor rules for courses. The instructor and registration rules matrix’s format are slightly different.

In general, one column determines one rule for a course. Multiple columns for the same course are allowed - a user gets registered/added as instructor if at least one rule applies to the user.

The offering rule matrix may change over time/LMS versions as the offering rules' capabilities are being extended. Please refer to the corresponding LMS version in sub documents for format references.

Rows specify the requirements for a user to get registered/added as instructor.

See sub-document with proper version for details.

De-Registration and Remove Instructor Rules

Offering rules are able to add registrations for users or add the user as instructor. You can also specify offering rules to remove registrations or instructors from a course, as soon as the offering rule requirements doesn’t apply for a user anymore (i.e. due to a vessel change). The matrix usually contains a row similar to De-Registration or Remove Instructor. Adding an 'x' in this row and course (column) will add de-registration/remove instructor rules.

Multiple columns for one course must have all the same value - either an ‘x' or nothing. Multiple offering rules for the same course can’t be mixed.

OPFs as Offering Rule Requirement

Org Profile Fields (OPFs) and values can be specified as offering rule requirement as well. An ‘x' in a course column and OPF value row specifies that a user requires that OPF value in order to get registered. ‘!x' specifies that a user gets registered/added as instructor if they DON’T have that specific value - see Invert OPF Selection for more details on '!'.

Invert OPF Selection

If you need the opposite of an OPF value as registration/instructor requirement you can invert the selected OPF value. In order to do that we use the Boolean NOT character '!' in front of 'x'.
OPF values selections can be marked with an ‘x' or ‘!x' (for the inverse) for a course (column). Selected values of one OPF name must have either all ‘x' or all '!x' within one course. You can't have a mix of 'x' and '!x' in one column within one OPF name. The Offering Rule Generator will throw an exception if '!x' and 'x' are mixed within one column and OPF name.

Example

For example, if all users should be registered who are NOT assigned to Vessel: Shore use '!x' for OPF value Shore. This will result in a simpler offering rule which uses !ProfileValueIn(Vessel,Shore) instead of ProfileValueIn(Vessel,[list all vessels])


Course Name

TRG-OHS-2205 Working at Height Training for Workers


Course Path

/Root/Carnival/CMG/HESS/WorkingHeightWorker


Registration Type

OneTime


Re-Registration Before Certificate Expiry



Certificate Short Id



De-Registration





OPF Name

OPF Value


Vessel

Shore

!x

Vessel

AIDAblue


Vessel

Costa Atlantica


Rank

Captain


Rank

Engineer

x

Rank

Environmental Officer


Registration Rule Matrix

See sub-document with proper version for matrix details.

Instructor Rule Matrix

See sub-document with proper version for matrix details.

Example Offering Rule Matrices

See sub-document with proper version for matrix examples.

Get Offering Rule Matrix via GetOfferingRuleMatrix (general information)

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.

See sub-document with proper version for command details.

Limitations for GetOfferingRuleMatrix

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. 

Offering Rule Generator (general information)

The Offering Rule Generator (aka Registration Rule Generator) creates LMS Core commands to replace and add new offering rules based on an Offering Rule Matrix. The DOS prompt tool input can be the old (deprecated) or new transposed (preferred) format of an Offering Rule Matrix. The tool generates LMS Core 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.
The Offering Rule Generator tool itself can be found attached to the sub-document with the proper version. Unzip the latest version to a local folder and run DOS prompt (Ctrl+R, type 'cmd' and hit enter).

See sub-document with proper version for details (e.g. parameters).

The code for the Offering Rule Generator can be found in Git PS repository MarineLS\RegistrationRuleGenerator

Customer Specific Processes (deprecated?)

Some customers will have certain workflows how the Offering Rule Matrix will be updated. 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/EiPxFVLmbhlBlo4XITf3dhcB_ZrEtzDsriaCGiVRMDBiMg?e=5%3aTmOPYT&at=9

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 (Content by label)




Related issues





Page Properties