Skip to main content
Business rules are used to add logic to flows at a number of different levels:
  • Flows: when they are started, loaded, completed, or rejected.
  • Steps: when they are started, saved, or completed.
  • Questions: when they are updated.
  • Sub-questions: when they are updated.
The rules available depend on the level you’ve selected: for example, you cannot add a pass back rule on “question updated”. All rules are added from the flow designer. The UI changes depending on whether “Form preview” is on or off. If form preview is on, the Add rules section is displayed at the bottom left, under the question section. Adding rules with Form preview on If Form preview is off, the rules appear on the right-hand side. Adding rules with Form preview off
  • Form loaded rules are executed when you open the form. If you only want the rule to execute the first time a form loads, add conditions to ensure this.
  • Flow started rules are executed when you start a new flow. A flow is considered started only when the first step of the form is saved or submitted.
  • Flow completed rules are executed when all the steps in the flow have been completed.
  • Flow rejected rules are executed when a form is rejected; you can add conditions to further control their execution.
  • Step started rules are executed at the beginning of a new step. A step is considered to have started immediately after the previous step has been completed.
  • Step saving rules are executed when you save the form. If the form was created but never saved, the rule executes when you submit the step, as the submit button also saves the information.
  • Step completed rules are executed when the step is completed (submitted). A step can be submitted more than once.
  • Question changed rules are executed when you change the value entered into a question. If the question has a default value, the rule only executes when you change that value. The rule executes each time you change the value.
Step rules and passbackStep rules are affected by passing back for critical information. In this situation, rules on steps from the “step passed back to” through the “step passed back from” are executed a second time, subject to the rule conditions being met.
In a flow, rules are executed in the following order:
  1. Form loaded
  2. Flow started rules
  3. Step started rules
  4. Question changed rules
  5. Step saved
  6. Step completed
  7. Flow completed
  8. Flow rejected
Rule execution can be broken down further by executing rules in either parallel or series. Rules executed in parallel run at the same time (assuming conditions are met), whereas rules executed in series run one by one (assuming conditions are met). By default, when rules are executed, FlowForma checks all the rules, selects those that meet the conditions, and executes them in parallel. If you have rules that change items that affect the conditions of other rules, make sure set execution in series is selected. For example, you have two rules on step completed:
  • Set the current user in a person or group question (no conditions).
  • Set step assign to (if the value in the person or group question = Paige Turner).
If set execution in series is not selected, the first rule executes every time, but the second rule never executes: the person or group field is still empty because the second rule runs before the first has finished populating it. If set execution in series is selected, the first rule executes every time, and the second rule executes only if its condition is met. Because the second rule starts only after the first has completed, the person or group field will have been populated, so if the person is “Paige Turner”, the second rule executes and the step assign to takes place. Additionally, if you have two rules on step completed such as:
  • Generate a document.
  • Send email with the generated document attached.
It’s important to use rule execution in series so the email isn’t sent before the document has finished generating, otherwise the email is sent without an attachment. You can apply conditions to business rules so they only execute when certain conditions are met; if no conditions are added, the rule always executes. When creating a new business rule, the first section determines when the rule executes (load, save, start, complete, or question updated), the second section is for any conditions (and can be left blank), and the third section is the action. Each rule has its own action. Once you’ve entered all relevant detail, click Save.