Skip to end of banner
Go to start of banner

Registration Rule Generator - How To Use (deprecated)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Version History

« Previous Version 19 Next »

This document is outdated and has been marked as deprecated - please use Offering Rule Matrix and Offering Rule Generator instead

This page will discuss how to use the Registration Rule Generator.

What does the Registration Rule Generator do?

The Registration Rule Generator is run through cmd. Every row generates one registration rule. All ticked OrgProfileValues of one OrgProfileField converts into one predicate ProfileValueIn(fieldName,val1|val2|val3|...). This will give you a list of predicates - one predicate per OrgProfileField. Combine all predicates into one registration rule expression which logically ANDs the predicate together.


NOTE: You Cannot have the following special characters in OrgProfileValues: The special characters for rules are '(' ')' ',' ':' '|' '$' ':'

Depending on the ticks which are checked in the excel file, the Registration Rule Generator can add in certificate predicates. If the registration rule only ever should register a user once in a lifetime for a course replace the predicate !HasActiveRegistrations() with HasNoRegistrations(). For now, the Registration Rule Generator will always use !HasActiveRegistrations(). 

 addRegisterStudentRule -- Usage addRegisterStudentRule [string: orgPath] [string: coursePath] [string: filterExpression] [string actionType]

Rules

Student Rules

  • Row 1:
    • Course Name [column A]: Full course name for readability purpose only
    • Course Path [column B]: i.e. /Root/MarineLS/Course1

Notes 

The course path is case sensitive until  COREDEV-3161 - Getting issue details... STATUS  is released. Currently, paths within registration rules are case-sensitive and wouldn't get executed if the casing is different. For example course /Root/Org/Course1 and registration rule RegisterStudent(/Root/Org/course1):ProfileValueIn(Role,OED Line-boat operator|OED Line-handler);HasNoRegistration() would not get executed

    • Re-Registration [column C]: Set ‘x’ to enable re-registration. Column D is mandatory if column C is ticked.
    • Re-Registration Before Certificate Expiry [column D]: This optional column is used in combination with Re-Registration (column C). It 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. The format of the cell is a duration value in days, months or years (i.e. like 1d, 2m or 3y)

Notes
The OrgProfileField requirements must match and the current date is greater than (expiry date - duration) before a user gets re-registered
Assumptions
The certificate will be awarded on completion (via certificate rule)
The certificate has a ValidityDuration. If no ValidityDuration is set, the user will never be re-registered because the certificate doesn’t expire
Only one certificate (template) per course exists (Certificate Short Id in column E). If multiple certificate templates are used for one course, we need additional discussions on how to determine when to re-register a user

    • Certificate Short Id [column E]: Mandatory if Re-Registration (column C) is ticked. Certificate short Id (name) which is used to determine the re-registration date according to certificate’s ValidityDuration
    • De-Registration [column F]: Set ‘x’ to de-register users from course if any of the OrgProfileField’s value doesn’t match the users’ profile. If the cell is empty, the user will be left registered in the course even if the requirements to get registered in this course don’t match anymore
    • OrgProfileField Names (Column G+): OrgProfileField names used in any of the rules. The column spans across all OrgProfileValues in row 2
      • Note: The OrgProfileField names must not contain '(' or ')' because they don't work with parsing rules in Core. Use '[' and ']' instead.
  • Row 2:
    • OrgProfileFieldValues starting from column G. Every OrgProfileFieldValue of one OrgProfileField occupies one column.
      • Note: The OrgProfileField values must not contain '(' or ')' because they don't work with parsing rules in Core. Use '[' and ']' instead.
  • Row 3+:
    • One or multiple rows per course. Place an ‘x’ into a column to enable registration according to the OrgProfileField’s value.

Instructor Rules

The instructor rules work almost like the registration and de-registration rules (see Registration Rule and De-Registration Rule) - just omit the use of predicates HasActiveRegistration() and HasNoRegistrations(). There is no Re-Registration for instructors.

  • Row 1:
    • Course Name [column A]: Full course name for readability purpose only
    • Course Path [column B]: i.e. /Root/MarineLS/Course1

Notes 

The course path is case sensitive until  COREDEV-3161 - Getting issue details... STATUS  is released. Currently, paths within registration rules are case-sensitive and wouldn't get executed if the casing is different. For example course /Root/Org/Course1 and registration rule RegisterStudent(/Root/Org/course1):ProfileValueIn(Role,OED Line-boat operator|OED Line-handler);HasNoRegistration() would not get executed

    • Remove Instructor [column C]: Set ‘x’ to remove instructor if any of the OrgProfileField’s values don’t match the user’s profile. If the cell is empty, the instructor will not be removed from the course even if the requirements to be instructor for that course don’t match anymore
    • OrgProfileField Names (Column D+): OrgProfileField names used in any of the rules. The column of row 1 spans across all OrgProfileValues for row 2
      • Note: The OrgProfileField names must not contain '(' or ')' because they don't work with parsing rules in Core. Use '[' and ']' instead.
  • Row 2:
    • OrgProfileFieldValues starting from column D. Every OrgProfileFieldValue of one OrgProfileField occupies one column.
      • Note: The OrgProfileField values must not contain '(' or ')' because they don't work with parsing rules in Core. Use '[' and ']' instead.
  • Row 3+:
    • One or multiple rows per course. Place an ‘x’ into a column to enable registration according to the OrgProfileField’s value

Re-Registration Rules

If Re-Registration is ticked certificates must be enabled for the course in order to work properly. Certificate rules must make sure that the user gets awarded a certificate on course completion. The certificate needs a ValidityDuration.

The column Re-Registration Before Certificate Expiry is optional and would re-register a user a set time period ahead of certificate expiry. If Re-Registration Before Certificate Expiry is left empty (use 0d as the default value) the user will get re-registered on the day of certificate expiry.

Add the predicate CertificateWillExpire([Certificate Short Id],[Re-Registration Before Certificate Expiry]) - with the appropriate values from the course row - to a registration rule with Re-Registration ticked.

Notes:

  • No Certificates or Certificate rules are generated by the Registration Rule Generator
  • If an awarded certificate doesn’t have a ValidityDuration the certificate will never expire and therefore, re-registration would never happen
  • Registration rules must be re-run manually to trigger re-registration. Automatically make sure to trigger re-registration is on Core’s roadmap
  • CertificateWillExpire(..) predicate description can be found here

How to Run the Registration Rule Generator

How to install the Generator

  1. Download the Registration Rule Generator from the following folder. Currently, it is located on the google drive under Operations → Professional Services → Moran Tug → Registration Rule Generator (Pre-release Version) or it can be found at the following link: https://drive.google.com/drive/u/0/folders/1Xc5v6y10wvmepZ8HJZw8B6WeDDGTSIWv

  1. Open CMD as an Administrator
  2. Navigate to the file location using cd / use the dir command to list everything in the folder. 
  3. C:\Users\Hayley.MARINELS\Desktop\2018.09.18-PreRelease-RegistrationRuleGenerator
  4. Type in RegistrationRuleGenerator.exe student to get a list of the options you have and that you need to include. Using the student will do registration rules for Students you can also do instructor.

Excel File

  1. You need to make sure the excel file is in the right format. 
    1. An example of an excel file that is in the right format can be found at https://docs.google.com/spreadsheets/d/137K9O9QuqsKt7Z3fk-3q2Y8A9QeroZgVV9czhcqm5gc/edit#gid=338886090
  2. Make sure you do not have extra rows in your excel file when you convert it, delete any unnecessary rows.
  3. Once you excel file is in the right format convert the excel file to a .csv file (save as .csv) put it in the same folder as the downloaded Reg Rule Generator. Do this through Google Docs - for some reason when you do it on excel 365 it will save the .csv files with ";" instead of "," and they need to be separated by "," (commas).
  4. Once the generator is running execute the following command in CMD. Note this example does not have the Re-register ticked in the excel file and does not include anything about certificates. 
    1. RegistrationRuleGenerator.exe student -f "2018.09.13 - RegistrationRulesCMG_Rev03.csv" -o "C:\Users\Hayley.MARINELS\Desktop\2018.09.18-PreRelease-RegistrationRuleGenerator\Results2" -p /Root/Carnival/CMG/ -v
    2. Note: This command is tailored to an example from an excel sheet. Make sure all of the proper flags are included if Re-register is needed. 
  5. This will export the list of the Registration Rules into the text document Results2 which you will then copy and run in /pages/dev. 
  6. Open the Text file and you will have a copy of your Registration Rules.
  7. The registration rules will be in the following format - addRegisterStudentRule [string: orgPath] [string: coursePath] [string: filterExpression] [string actionType]
  8. Go to the site you wish to put the Registration Rules on and go to /pages/dev to run the commands. 

What if you make a mistake?

If you make a mistake go to the home page (Example: /Root/Carnival/CMG) and go to Edit → Page Attributes and delete the Registration Rules (task COREDEV-3480 - Getting issue details... STATUS  will make deleting Registration rules easier). Fix your mistakes and re-run the generator and then reapply the new rules under /pages/dev

NavPage attribute keys for Registration Rules:

  • System.OfferingRule.Instructor.AutoGenerated: auto-generated instructor rules (add/remove instructors)
  • System.OfferingRule.Registration.AutoGenerated: auto-generated de-/registration rules

Suggestions for Using

BEFORE RUNNING REG RULE PROCESSOR

In CSV file, delete any & all empty columns at right and any & all empty rows at bottom of the file.

Delete any commas that appear in Course name in column A otherwise file will break when run through generator

Check for dupes in Course Path and delete if exact duplicate or merge is slightly different or go back to customer if major differences. Fine if dupes are logically separate.

Locking down the customer file to prevent customers adding more rows (duplicate course rows) or columns (unknown values for the registration variable/s) into file should be considered.


AFTER RUNNING REG RULE PROCESSOR

Check number of rules run and determine why less e.g. dupes not caught in above checks

Open /pages/dev window and run gnpa /Root/XXX and leave window to side (safety in case you later discover you accidentally deleted things you shouldn't have done)

Command to delete existing student reg rules: DeleteNavPageAttributes /Root/XXXX System.OfferingRule.Registration.AutoGenerated

Sample command (assumes CSV in same directory as processor): RegistrationRuleGenerator.exe student -f "BCF Reg Rule Matrix Mar25.csv" -o "BCF Reg Rule Matrix Mar25OUT.txt" -p /Root/BCF -v

Sample output from running command, which shows less rules generated than in file (differences due to some rows in sheet being empty i.e. no values to register for course):

** Parameter:
# Input file path: BCF Reg Rule Matrix Mar25.csv
# Output file path: BCF Reg Rule Matrix Mar25OUT.txt
# Verbosity: On

-- INFO: 84 StudentRules was read from BCF Reg Rule Matrix Mar25.csv

-- INFO: 84 StudentRules are valid for processing.

-- INFO: 0 invalid student rules was found.

-- INFO: 80 Student registration rule command lines was generated.

-- INFO: 0 Student de-registration rule command lines were generated

-- INFO: ** Writing Output to BCF Reg Rule Matrix Mar25OUT.txt

-- INFO: Total of 80 StudentRule command lines were written to output file

Scan outputted TXT file of rules for errors then when confirmed good, paste all commands into /pages/dev and run (lookout for odd characters such as long dash that don't translate well to the output file - i.e. /Root/Moran/RespondingToEmergencies–PersonalSurvival)

after running new reg commands, run   ReEvaluateOfferingRulesForAllUser Registration /Root/XXX (to update student rules) and/or  ReEvaluateOfferingRulesForAllUser Instructor /Root/XXX (to update Instructor rules)

Related articles

Filter by label

There are no items with the selected labels at this time.