Skip to content

Editing Rulesets

Updated pdexter 2024-01-29

See also Editing Rulesets MSV

Ruleset scripts can be edited within the Formbird system itself, using the following RuleSet Template.

RulesetEditorScreen

Suggested Name (Object Event Descriptor) format

The following format is the recommended way to name the Ruleset (via the Name/Object Event Descriptor field).

{App Acronym}[ -] {businessType} - {Event}

where
* {App Acronym} = The client application acronym, eg "CGD" * {businessType} = The general type of the document, eg "Inspection" * {Event} = The event or scheduled action name being processed, eg "OnLoad"

Examples

CGD Inspection - OnLoad

NRC MonitoringTask - OnFieldChange

There may be cases where some further nomenclature is needed. This is only a guideline.

Structure of a Ruleset Script

For this edition of the Ruleset Development Guide it is encouraged to use the "JayRule" method/format of scripting.

To implement JayRule simply include the RuleSetInclude "JayRule Ruleset Overlay JS" at the top of your ruleset, then define the "ruleset" object below this, thus:

{
#include "JayRule Ruleset Overlay JS",

    ruleset : {

        name : 'name-of-ruleset',

        rule-name : {
            runCondition : run-condition-function,

            runAction : run-action-function
        },

        rule-name : { 
            ...
        }, 
        ...
    }
}

If your environment doesn't have the rulesetInclude "JayRule Ruleset Overlay JS", see Formbird (pd) for latest version.

RuleSet Includes

Common RuleSet scripting can be saved to a RuleSet Include document, and then included into a ruleset.

Eg

#include "Basic Functions JS",

placed inside the first open bracket of the script (eg the line after #include "JayRule Ruleset Overlay",)

See Creating and Using RulesetIncludes.