/
Offering Rule Matrix and Offering Rule Generator (4.7+)
Table of Contents

Registration Rule Matrix


Course Name

TRG-OHS-2205 Working at Height Training for Workers

EO Costa Atlantica PDR - Technical Training Qualification Card

Confined Spaces


Course Path

/Root/Carnival/CMG/HESS/WorkingHeightWorker

/Root/Carnival/CMG/PDRs/EO/CostaAtlantica/PDR3

/Root/Carnival/CMG/EOT/ConfinedSpaces


Registration Type

OneTime

ReRegistration

Deactivated


De-Registration





Re-Registration Before Certificate Expiry


30d



Re-Registration Certificate Short Id


CourseCompleted1Y



Course-Prerequisite (latest registration is completed)
MostRecentRegistrationCompletedFor


/Root/Carnival/CMG/HESS/WorkingHeightWorker

/Root/Carnival/CMG/HESS/WorkingHeightWorker|

!/Root/Carnival/CMG/HESS/WorkingUndergroundWorker


Course-Prerequisite (completed after current completion)
CompletedForSinceCurrentCompletion


/Root/Carnival/CMG/HESS/WorkingHeightWorker|

/Root/Carnival/CMG/HESS/WorkingUndergroundWorker




CertificateWillExpireInCourse (coursePath;certificateShortId;beforeExpiryDuration)


/Root/Carnival/CMG/HESS/WorkingHeightWorker;CourseCompleted3Y;30d



OrgProfileFieldChanged (since latest completion)
ProfileChangedSinceLastCompletion


Vessel



Users (UserNames)





IsInUserSet(userSet)

AllCaptains




OrgProfileDateWithin(OPF;days)

Embarkment Date;30|Contract Start Date;5




Type of latest completed Registration (Unknown|Historical|Auto|Imported|Self|Manual) TypeOfMostRecentlyCompletedRegistration


Historical|Auto|Manual







OPF Name

OPF Value




Vessel

Shore



!x

Vessel

AIDAblue

x



Vessel

Costa Atlantica

x

x


Rank

Captain




Rank

Engineer

x


x

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. 1d2m 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:

Type of latest completed Registration (Unknown|Historical|Auto|Imported|Self|Manual) TypeOfMostRecentlyCompletedRegistration (row 14)

Add the type for the previously and most recently completed registration. Valid values (pipe '|' separated) are:

  • Unknown

  • Historical

  • Auto

  • Imported

  • Self

  • Manual

Notes:

This field must be left blank if RegistrationType (row 3) is ‘OneTime'. This is due to 'OneTime’ registrations never having a previously completed registration.

OPF Name (rows 16+)

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 16+)

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


Course Name

TRG-1701 - EFFECTIVE SUPERVISION

TRG-1701 - EFFECTIVE SUPERVISION

TRG-1701 - EFFECTIVE SUPERVISION


Course Path

/Root/Carnival/CMG/HESS/PubHealth1

/Root/Carnival/CMG/HESS/PubHealth1

/Root/Carnival/CMG/HESS/OnBoarding


Instructor Rule Status

Active

Active

Active


Remove Instructor

x

x

x


Users (UserNames)

stefan|alastair




IsInUserSet(userSet)



AllEngineers


OrgProfileDateWithin(OPF;days)



EmbarkmentDate;30|ContractStartDate;5



 Course-Prerequisite (latest registration is completed)
MostRecentRegistrationCompletedFor

/Root/Carnival/CMG/HESS/WorkingHeightWorker

/Root/Carnival/CMG/HESS/WorkingHeightWorker|

!/Root/Carnival/CMG/HESS/WorkingUndergroundWorker


 

Course-Prerequisite (completed after current completion)
CompletedForSinceCurrentCompletion

 

/Root/Carnival/CMG/HESS/WorkingHeightWorker|

/Root/Carnival/CMG/HESS/WorkingUndergroundWorker

 

 






OPF Name

OPF Value




Vessel

Shore


 


Vessel

AIDAblue

x

 


Vessel

Costa Atlantica

x



Rank

Captain

 

x


Rank

Engineer

 

x


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:

Course-Prerequisite (latest registration is completed) MostRecentRegistrationCompletedFor (row 8)

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 9)

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.

OPF Name (rows 12+)

Org profile name which can be used in instructor rules.

Row 11 at column 1 must contain OPF Name. Any values below are OPF names.

OPF Value (rows 12+)

Org profile value which can be used in instructor rules.

Row 11 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 - TODO update this with new version of OfferingRuleGenerator when merged. https://gitlab.com/m8284/psdev/-/merge_requests/412

Attachments

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.

1GetOfferingRuleMatrix [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

Unzip the attached version to a local folder and run DOS prompt (Ctrl+R, type 'cmd' and hit enter).

TODO attach new version of OfferingRuleGenerator when merged. https://gitlab.com/m8284/psdev/-/merge_requests/412

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

1Student -f "D:\CMG\cmgtestRegRulesTest.csv" -o "D:\CMG\CmgTestRegistrationRule_Commands.txt" -p /Root/Carnival/CMG -v

Example for Instructor Rules

1Instructor -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