Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Place rules in the frame rule flow whenever you can and the window rule flow whenever you have to, for the purpose of dividing the rules into many simple frame rule flows instead of one big and complicated window rule flow (see creating vocabularies).

  • Divide the rules into the following rule sheets and rule sheet names (unless they have no rules. There's no need for empty rule sheets) -

    • <window or frame>_Fixed.ers - Fixed property settings.
    • <window or frame>_IsEnabled.ers - Rules for enabling form fields.
    • <window or frame>_IsVisible.ers - Form fields visibility rules.
    • <window or frame>_Pages.ers - Pages (tabs) visiblity rules and enabling or disabling pages.
    • <window or frame>_Messages.ers - Message rules (errors, warnings and info messages).

  • Complicated rules with conditions containing more than 5 to 10 fields and more than 5 to 10 combinations should be put in a separate rule sheets with their own descriptive name suffix.
    For example: EntscheidDetailBasisFrame_IsUnUpdatable.ers

  • Use the vocabulary fields not expressions in the condition and action panes unless you have to.
    For example: In the condition pane, do not use EntscheidDSO.Visum_Dat = null. Use EntscheidDSO.Visum_dat and null in the cell value.
    For example: In the action pabepane, do not use EntscheidDSO.isAvailable = true. Use EntscheidDSO.isAvailable and T in the cell value.

  • A specific property (like a form field is enabled property or any other property) must be set in one place and one place only. The property must be set in one rule sheet covering all the combinations. In either the frame or window rules but never both. Setting the same property in different rule sheets increases the risk of conflicts.

  • Use the default action column whenever possible to decrease the number of combinations and simplify rule sheets.
    For example: if you set the default for the is enabled property to false then you only need to specify the condition combination when it is true.

  • Use an AND condition in combination with the default column instead of an OR condition for setting properties to decrease the number of combinations and simplify rule sheets (because AND conditions use a single combination column while OR conditions use multiple combination columns). 

  • The fixed rule sheet should only be used for properties that have a fixed or constant value and should not be used for default values.
    For example: if the specification says this form field is always enabled.

  • The fixed rule sheet can also be used for setting custom properties by calling the custom JavaScript functions to fetch values (see incorporating code).

  • In the messages rule sheet, place the message text values in the cell action column and use the cellValue for the message parameter.
    For example: Message.new[type='info', entity='EntscheidDetailWindow', message=cellValue]

  • Every rule action should have a rule statement with a simple description (the descriptions will not be shown to the user) used internally for debugging and understanding what rules were triggered (see rule tests design). No need to add a rule statement for the default column (column 0).

  • Avoid dependencies - Avoid using calculated values from rule sheets. Only use values coming from the vocabulary.
    With the exception of Custom properties set with JavaScript functions (see incorporating code).

...

  • Every rule sheet should have a rule test (except for the fixed rule sheet) with the same name of their rule sheet and a _Test suffix.
    For example: EntscheidDetailWindow_IsEnabled_Test.ert

  • Include the entities used for conditions and actions. If the entities used for condition are not included then you cannot set them. If the entities used for actions are not included then you will not see their changes. Except for entities the action creates new instances, like messages. New instances will be included.

  • Remove unused fields that have no conditions when copying entities to the input column, to keep the rule tests simple and readable (keeping in mind that some forms and datasources can have tens or even hundreds of fields).

  • Check all the rules work and including cases when they should not work.

  • Currently only use a single object instance in your test sheet. If you need multiple instances, you most likely need another test sheet (tab).
    For example: do not use multiple instances of EntscheidDSO with different values to test multiple cases. Use multiple test sheets with a single EntscheidDSO in each one.

...