Offering Rule Matrix and Offering Rule Generator (4.6.x)
- 1 Registration Rule Matrix
- 1.1 Matrix Rows
- 1.1.1 Course Name (row 1)
- 1.1.2 Course Path (row 2)
- 1.1.3 Registration Type (row 3)
- 1.1.4 De-Registration (row 4)
- 1.1.5 Re-Registration Before Certificate Expiry (row 5)
- 1.1.6 Re-Registration Certificate Short Id (row 6)
- 1.1.7 Course-Prerequisite (latest registration is completed) MostRecentRegistrationCompletedFor (row 7)
- 1.1.8 Course-Prerequisite (completed after current completion) CompletedForSinceCurrentCompletion (row 8)
- 1.1.9 CertificateWillExpireInCourse (coursePath;certificateShortId;beforeExpiryDuration) (row 9)
- 1.1.10 OrgProfileFieldChanged (since latest completion) ProfileChangedSinceLastCompletion (row 10)
- 1.1.11 Users (UserNames) (row 11)
- 1.1.12 IsInUserSet(userSet) (row 12)
- 1.1.13 OrgProfileDateWithin(OPF;days) (row 13)
- 1.1.14 OPF Name (rows 15+)
- 1.1.15 OPF Value (rows 15+)
- 1.2 General Notes
- 1.1 Matrix Rows
- 2 Instructor Rule Matrix
- 2.1 Matrix Rows
- 2.2 General Notes
- 3 Offering Rule Matrix Examples
- 4 Get Offering Rule Matrix via GetOfferingRuleMatrix
- 5 Offering Rule Generator
Registration Rule Matrix
1 |
| Course Name | TRG-OHS-2205 Working at Height Training for Workers | EO Costa Atlantica PDR - Technical Training Qualification Card | Confined Spaces |
2 |
| Course Path | /Root/Carnival/CMG/HESS/WorkingHeightWorker | /Root/Carnival/CMG/PDRs/EO/CostaAtlantica/PDR3 | /Root/Carnival/CMG/EOT/ConfinedSpaces |
3 |
| Registration Type | OneTime | ReRegistration | Deactivated |
4 |
| De-Registration |
|
|
|
5 |
| Re-Registration Before Certificate Expiry |
| 30d |
|
6 |
| Re-Registration Certificate Short Id |
| CourseCompleted1Y |
|
7 |
| Course-Prerequisite (latest registration is completed) |
| /Root/Carnival/CMG/HESS/WorkingHeightWorker | /Root/Carnival/CMG/HESS/WorkingHeightWorker| !/Root/Carnival/CMG/HESS/WorkingUndergroundWorker |
8 |
| Course-Prerequisite (completed after current completion) |
| /Root/Carnival/CMG/HESS/WorkingHeightWorker| /Root/Carnival/CMG/HESS/WorkingUndergroundWorker
|
|
9 |
| CertificateWillExpireInCourse (coursePath;certificateShortId;beforeExpiryDuration) |
| /Root/Carnival/CMG/HESS/WorkingHeightWorker;CourseCompleted3Y;30d |
|
10 |
| OrgProfileFieldChanged (since latest completion) |
| Vessel |
|
11 |
| Users (UserNames) |
|
|
|
12 |
| IsInUserSet(userSet) | AllCaptains |
|
|
13 |
| OrgProfileDateWithin(OPF;days) | Embarkment Date;30|Contract Start Date;5 |
|
|
14 |
|
|
|
|
|
15 | OPF Name | OPF Value |
|
|
|
16 | Vessel | Shore |
|
| !x |
17 | Vessel | AIDAblue | x |
|
|
18 | Vessel | Costa Atlantica | x | x |
|
19 | Rank | Captain |
|
|
|
20 | Rank | Engineer | x |
| x |
21 | Rank | Environmental Officer |
| x |
|
Matrix Rows
Course Name (row 1)
A human readable name of the course - this is not used in any rule creation (information only and optional).
Course Path (row 2)
Full LMS path to the course the rule applies to.
Registration Type (row 3)
A registration type determines the behaviour of the course like re-occurring or only one-time registration.
OneTime: one time registration - doesn't re-register as soon as a completed registration exists (uses predicate
HasNoRegistrations()
)ReRegistration: re-registers users if there is no active registration available and all predates return
true
. Usually this is used in combination with a certificate with expiry (row ‘Re-Registration Before Certificate Expiry’) or any prerequisite predicates like CompletedForSinceCurrentCompletion(coursePath). Uses predicate!HasActiveRegistrations()
.OnlyWithCompletedRegistration: registers and re-registers users who have already at least one completed registration. Uses predicates
HasCompletedRegistrations()
and!HasActiveRegistrations()
Deactivated: a course which was in use before but has been discontinued. This creates a delete registration Offering Rule command for that course (auto-rules only)
No value (empty cell): no rules or delete commands are generated. Columns with no Registration Type value can be used to prepare courses for the future
De-Registration (row 4)
Set an x
into a course column to add de-registration rules. An active registration would be removed as soon as the registration rule requirements won’t apply anymore (i.e. due to a vessel change).
Re-Registration Before Certificate Expiry (row 5)
Only used if a certificate is used for the rule. Determines the period of time a user should be re-registered before their certificate expires. If left empty the user is re-registered on the day their certificate expires.
Value format is duration in days, months or years (i.e. 1d
, 2m
or 3y
).
Re-Registration Certificate Short Id (row 6)
The LMS certificate short Id which is awarded for completing the course. The certificate is used to determine the re-registration date according to the certificate’s validity duration. Only makes sense if available for registration types ReRegistration
and OnlyWithCompletedRegistration
.
Course-Prerequisite (latest registration is completed) MostRecentRegistrationCompletedFor (row 7)
A course path which is prerequisite for the current course, using the predicate MostRecentRegistrationCompletedFor(coursePath)
. Full course path.
If multiple courses are prerequisite, separate the course paths with '|'.
Check https://rippleops.atlassian.net/wiki/spaces/CMD/pages/33356462/Registration+Rules+Current#Predicates for a full description about how the predicate MostRecentRegistrationCompletedFor
works exactly.
Notes:
!
can be used for any course path to negate the requirement.
Course-Prerequisite (completed after current completion) CompletedForSinceCurrentCompletion (row 8)
A course path which is prerequisite for the current course, using the predicate CompletedForSinceCurrentCompletion(coursePath)
. Full course path.
If multiple courses are prerequisite, separate the course paths with |
.
Check https://rippleops.atlassian.net/wiki/spaces/CMD/pages/33356462/Registration+Rules+Current#Predicates for a full description about how the predicate CompletedForSinceCurrentCompletion
works exactly.
Notes:
!
can be used for any course path to negate the requirement.
CertificateWillExpireInCourse (coursePath;certificateShortId;beforeExpiryDuration) (row 9)
A course path including certificate short Id and time before certificate expiry for re-registration which is prerequisite for the current course, using the predicate CertificateWillExpireInCourse (coursePath,certificateShortId,beforeExpiryDuration)
. Triple course path, certificate short Id and time before certificate expiry must be specified - use ';' as a parameter separator.
If multiple courses are prerequisite, separate the triple values with |
.
Notes:
!
can be used for any course path to negate the requirement.
OrgProfileFieldChanged (since latest completion) ProfileChangedSinceLastCompletion (row 10)
Specify OPF name(s) to check for changed OPF values as a prerequisite for registration. The predicate ProfileChangedSinceLastCompletion(opfName)
is used in the registration rule.
If multiple OPFs need to change for registration, separate the OPF names with |
.
Users (UserNames) (row 11)
Add a user name or orgLoginId to register a specific user. Any other requirements like ticked OPF values or pre-requisites are considered for the rule as well.
If multiple users are specified, separate the values with |
.
Notes:
If multiple users are specified, the Offering Rule Generator will create one rule per user name to accomplish a logical OR between the user names. Those rules are copies of themselves, having only one user name.
IsInUserSet(userSet) (row 12)
Add a user set name (one only) to register users who are in that user set. The inverse !
for this predicate is supported.
Notes:
The UserSet is used to create the de-registration rules.
OrgProfileDateWithin(OPF;days) (row 13)
Specify the OPFs and how many days before the OPF value date a user should get registered to the course. Multiple predicates can be specified - use |
as delimiter between the predicate configurations (e.g. EmbarkationDate;30|ContractStart;5
). The inverse !
for this predicate is supported.
If the days
value is less than 0, output a warning but create the rule.
Notes:
The predicate is not used for de-registration rules.
Registration rules with date ranges can be used as well (see https://rippleops.atlassian.net/browse/SUCO-832 for details)
OPF Name (rows 15+)
Org profile name which can be used in registration rules.
Row 15 at column 1 must contain OPF Name.
Any values below are OPF names
OPF Value (rows 15+)
Org profile value which can be used in registration rules.
Row 14 at column 2 must contain OPF Value
. Any values below are OPF values for the corresponding column 1 OPF.
General Notes
If no value is set for column
Registration Type
no registration rule is generated for this course. This would allow to create registration rule matrices which have more courses listed than used - possibly useful to prepare registration rules for not yet published courses.Commands to delete any 'registration rules' and 'de-registration rules' are generated if the column
Registration Type
has any value (e.g.OneTime
). This is to remove any existing (old) rules.
Instructor Rule Matrix
1 |
| Course Name | TRG-1701 - EFFECTIVE SUPERVISION | TRG-1701 - EFFECTIVE SUPERVISION | TRG-1701 - EFFECTIVE SUPERVISION |
2 |
| Course Path | /Root/Carnival/CMG/HESS/PubHealth1 | /Root/Carnival/CMG/HESS/PubHealth1 | /Root/Carnival/CMG/HESS/OnBoarding |
3 |
| Instructor Rule Status | Active | Active | Active |
4 |
| Remove Instructor | x | x | x |
5 |
| Users (UserNames) | stefan|alastair |
|
|
6 |
| IsInUserSet(userSet) |
|
| AllEngineers |
7 |
| OrgProfileDateWithin(OPF;days) |
|
| EmbarkmentDate;30|ContractStartDate;5 |
8 |
|
|
|
|
|
9 | OPF Name | OPF Value |
|
|
|
10 | Vessel | Shore |
|
|
|
11 | Vessel | AIDAblue | x |
|
|
12 | Vessel | Costa Atlantica | x |
|
|
13 | Rank | Captain |
| x |
|
14 | Rank | Engineer |
| x |
|
15 | Rank | Environmental Officer |
|
|
|
Matrix Rows
Course Name (row 1)
A human readable name of the course - this is not used in any rule creation (information only).
Course Path (row 2)
Full LMS path to the course the rule applies to.
Instructor Rule Status (row 3)
Active: Instructor rule is active
Deactivated: Instructor rule is deactivated - a course which was in use before but has been discontinued. This creates a delete instructor Offering Rule command for that course (auto-rules only).
no value (empty cell): no rules or delete commands are generated. Columns with no Registration Type value can be used to prepare courses for the future
Remove Instructor (row 4)
Set an x
into a course column to add a remove instructor rules. An instructor would be removed as soon as the instructor rule requirements wouldn’t apply anymore (i.e. due to a vessel change).
Users (UserNames) (row 5)
Add a user name or orgLoginId to add specific users as instructors. Any other requirements like ticked OPF values are considered for the rule as well.
If multiple users are specified, separate the values with |
.
Notes:
If multiple users are specified, the Offering Rule Generator will create one rule per user name to accomplish a logical OR between the user names. Those rules are copies of themselves, having only one user name.
IsInUserSet(userSet) (row 6)
Add a user set name (one only) to add users as instructors who are in that user set. The inverse !
for this predicate is supported.
Notes:
A UserSet is used to create the remove-instructor rules.
OrgProfileDateWithin(OPF;days) (row 7)
Specify the OPFs and how many days before the OPF value date a user should get added as instructor to the course. Multiple predicates can be specified - use |
as delimiter between the predicate configurations (e.g. EmbarkationDate;30|ContractStart;5
). The inverse !
for this predicate is supported.
If the days
value is less than 0
, output a warning but create the rule.
Notes:
The predicate is not used for remove-instructor rules.
Instructor rules with date ranges can be used as well (see https://rippleops.atlassian.net/browse/SUCO-832 for details - works the same for registration and instructor rules)
OPF Name (rows 9+)
Org profile name which can be used in instructor rules.
Row 7 at column 1 must contain OPF Name
. Any values below are OPF names.
OPF Value (rows 7+)
Org profile value which can be used in instructor rules.
Row 7 at column 2 must contain OPF Value
. Any values below are OPF values for the corresponding column 1 OPF.
General Notes
Commands to delete any ‘instructor rules' and ‘remove instructor rules’ are generated if the column
Instructor Rule Status
has any value (e.g.Deactivated
). This is to remove any existing (old) auto rules.
Offering Rule Matrix Examples
Get Offering Rule Matrix via GetOfferingRuleMatrix
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.
GetOfferingRuleMatrix [org] [type: 'Registration' (student) or 'Instructor'] (optional: -includeOpfs:"OPFName1|OPFName2|…|OPFNameX") (optional:-includeAllOpfValues) (optional:-includeAllCourses) [Optional: csvOutputPath (Note: if not provided, outputs to command line)]
By default all OPFs and OPF values which are actively 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. However, there are command parameters which allow to expand on that - see details below.
Switch parameters can be placed in any order - they are identified by the parameter name like '-includeAllOpfValues'
Command Parameters
mandatory: path
The path (must be inside an organization or the organization path itself) to extract the offering rules at that path and below
mandatory: type
The offering rule type to export - Registration or Instructor rules
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. If this parameter is not provided, the output will be only in the command window.
optional switch parameter: -includeAllOpfValues
This option will include all OPF values of a single-choice-string (SCS) OPF in case the OPF is referenced in any rule (OPF values are ordered alphabetically).
Example:
An OPF 'Rank' of type SCS contains 3 choices 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"
optional switch parameter: -includeAllCourses
This option will include any courses found at/below path
and don’t have any rules yet. The matrix would contain an empty rule column for that course - ready to be filled in.
Note: The course must have at least one active course offering to be included in the matrix. If the course does have an offering rule already, it would be automatically included in the matrix - independent of this switch parameter, even if the course doesn’t have any active course offering anymore.
Offering Rule Generator
Download the latest version of the Offering Rule Generator (2023.06.23_OfferingRuleGenerator_4.6+.zip
) attached to this document. Unzip to a local folder and run DOS prompt (Ctrl+R, type 'cmd' and hit enter).
Tool Parameters
mandatory: Student
/Instructor
The first parameter decides which rules should be created - student registration rules or instructor rules.
mandatory switch parameter: -f
The Offering Rule Matrix with registration/instructor rules as csv file incl. absolute file path
mandatory switch parameter: -o
Output file for the commands to replace and add the registration/instructor rules.
mandatory switch parameter: -p
Organization’s path of the courses in the matrix. Only one rules for the same organization are allowed within one matrix file.
optional switch parameter (deprecated): -v
If used, the DOS prompt output is more elaborate what the rule generator is doing.
Parameter Examples
Example for Registration Rules
Student -f "D:\CMG\cmgtestRegRulesTest.csv" -o "D:\CMG\CmgTestRegistrationRule_Commands.txt" -p /Root/Carnival/CMG -v
Example for Instructor Rules
Instructor -f "D:\CMG\cmgtestInstructorRulesTest.csv" -o "D:\CMG\CmgTestInstructorRule_Commands.txt" -p /Root/Carnival/CMG -v
The code for the Offering Rule Generator can be found in Git PS repository MarineLS\RegistrationRuleGenerator