Develop > Process Designer Tailoring Best Practices > Consider rule set execution sequence

Consider rule set execution order

A rule set contains a list of rules that you may run against a record. Rules implement business logic to drive a workflow or a process. In Service Manager, you can define rule sets at the object level, workflow level, or phase level. The rule sets defined at different levels are executed in order. For example, rule sets defined at the object level are executed first. The following diagram illustrates this execution order (from top to bottom):

For each action in Service Manager, such as creating a record, rule sets defined at different levels might be executed. The following table provides a high level view of the execution order of these rule sets:

Action Execution order of the rule sets (from left to right)
Create a record On add, On enter, Format control (add), After successful add, After successful enter, Format control (subroutine after add), Initialization, Format control (initial), On display, Format Control (display)
Update a record On update, Format control (update), After successful update, Format control (subroutine after update), Initialization, Format control (initial), On display, Format control (display)
Search and access a record Initialization, Format control (initial), On display, Format control (display)
Fill, find, screen-redraw On display, Format control (display)
  • Move from one phase to another
  • Close record (inactive)

On exit (global + old phase), Transition, On enter (global + new phase), Format control (update), Format control (subroutine after update), Initialization, Format control (initial), On display, Format control (display)

Note: The term "global" means rule sets defined at the object level or the workflow level.

When you define your own rule sets in Service Manager, you might need to consider the execution order of the rule sets, so that you can optimize the definition of your own rule sets accordingly.

The following tables provides a more detailed view of the execution order of the rule sets that are executed for each action. The events and their corresponding rule sets are executed from top to bottom.

Open an existing record

Events Rule sets
Initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization for the form of the phase
Display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display for the form of the phase

Create a new record (launched from document.new)

Events Rule sets
Initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization for the form of the phase
Display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display for the form of the phase

Add a record and stay in the logging phase

Events Rule sets
On-add
  • On-add rule sets at the object level
  • On-add rule sets at the workflow level
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets at the phase level
  • Master format control on-add
  • Format control on-add for the form of the phase
Add the record to the database

Note: This is a user action, not an event.

N/A
After-add
  • After-successful-add rule sets at the object level
  • After-successful-add rule sets at the workflow level
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets at the phase level
  • Master format control subroutine after-add
  • Format control subroutine after-add for the form of the phase
Initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization for the form of the phase
Display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display for the form of the phase

Add a record and automatically move to next phase

Events Rule sets
Old phase on-add
  • On-add rule sets at the object level
  • On-add rule sets at the workflow level
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets at the phase level
  • Master format control on-add
  • Format control on-add for the form of the phase
To phase on-enter
  • On-exit rule sets at the object level
  • On-exit rule sets at the workflow level
  • On-exit rule sets in the "from phase"
  • Transition rule sets
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets in the "to phase"

Note In this event, if you need to use the current phase of the record in the rule sets or format control, the value of the current.phase field in the "current record" is the name of the "to phase," and the value of the current.phase field in the "saved record" is the name of the "from phase."

Add the record to the database

Note: This is a user action, not an event.

N/A
From phase after-add
  • After-successful-add rule sets at the object level
  • After-successful-add rule sets at the workflow level
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets at the phase level
  • Master format control subroutine after-add
  • Phase form’s format control subroutine after-add
To phase post
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets at the phase level
  • Master format control subroutine after- add
  • Phase form’s format control subroutine after-add
To phase initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization to the form of the phase
To phase display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display to the form of the phase

Save a record and stay in current phase

Events Rule sets
On-update
  • On-update rule sets at the object level
  • On-update rule sets at the workflow level
  • On-update rule sets at the phase level
  • Master format control on-add
  • Format control on-add for the form of the phase

Save the record to the database

Note: This is a user action, not an event.

N/A
After-update
  • After-successful-update rule sets at the object level
  • After-successful- update rule sets at the workflow level
  • After-successful-update rule sets at the phase level
  • Master format control subroutine after-update
  • Format control subroutine after-update for the form of the phase
Initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization for the form of the phase
Display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display for the form of the phase

Save a record and automatically move to the next phase

Events Rule sets
From phase on-update
  • On-update rule sets at the object level
  • On-update rule sets at the workflow level
  • On-update rule sets at the phase level
  • Master format control on-update
  • Format control on-update for the form of the phase
To phase on-enter
  • On-exit rule sets at the object level

  • On-exit rule sets at the workflow level

  • On-exit rule sets in the "from phase"

  • Transition rule sets

  • On-enter rule sets at the object level

  • On-enter rule sets at the workflow level

  • On-enter rule sets in the "to phase"

Note In this event, if you need to use the current phase of the record in the rule sets or format control, the value of the current.phase field in the "current record" is the name of the"to phase", and the value of the current.phase field in the "saved record" is the name of the "from phase".

Update the record to the database

Note: This is a user action, not an event.

N/A
From phase after-update
  • After-successful-update rule sets at the object level
  • After-successful-update rule sets at the workflow level
  • After-successful-update rule sets at the phase level
  • Master format control subroutine after-update
  • Format control subroutine after-update for the form of the phase
To phase post
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets in the "to phase"
  • Master format control subroutine after-update
  • Format control subroutine after-update from the form of the phase
To phase initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets at the phase level
  • Master format control initialization
  • Format control initialization to the form of the phase
To phase display
  • On-display rule sets at the object level
  • On-display rule sets at the workflow level
  • On-display rule sets at the phase level
  • Master format control display
  • Format control display to the form of the phase

Manual transition without selecting “Save record prior to executing the transition”

Events Rule sets
To phase on-enter
  • On-exit rule sets at the object level
  • On-exit rule sets at the workflow level
  • On-exit rule sets in the "from phase"
  • Transition rule sets
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets in the "to phase"
  • Master format control On-update
  • Format control on-update from the form of the phase

Note In this event, if you need to use the current phase of the record in the rule sets or format control, the value of the current.phase field in the "current record" is the name of the"to phase", and the value of the current.phase field in the "saved record" is the name of the "from phase".

Save the record to the database

Note: This is a user action, not an event.

N/A
To phase after-enter
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets in the "to phase"
  • Master format control subroutine after-update
  • Format control subroutine after-update from the form of the phase

Manual transition with “Save record prior executing the transition” selected

Events Rule sets
From phase on-update
  • On-update rule sets at the object level
  • Workflow level on-update rule sets
  • On-update rule sets in the "from phase"
  • Master format control On-update
  • Format control on-update from the form of the phase

Save the record to the database

Note: This is a user action, not an event.

N/A
From phase after-update
  • After-successful-update rule sets at the object level
  • After-successful-update rule sets at the workflow level
  • After-successful-update rule sets in the "from phase"
  • Master format control subroutine after-update
  • Format control subroutine after-update from the form of the phase
To phase on-enter
  • On-exit rule sets at the object level
  • On-exit rule sets at the workflow level
  • On-exit rule sets in the "from phase"
  • Transition rule sets
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets in the "to phase"
  • Master format control on-update
  • Format control on-update from the form of the phase

Note In this event, if you need to use the current phase of the record in the rule sets or format control, the value of the current.phase field in the "current record" is the name of the"to phase", and the value of the current.phase field in the "saved record" is the name of the "from phase".

Save the record to the database

Note: This is a user action, not an event.

N/A
To phase after-enter
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets in the "to phase"
  • Master format control subroutine after-update
  • Format control subroutine after-update from the form of the phase

Back end transition

Events Rule sets
From phase initialization
  • Initialization rule sets at the object level
  • Initialization rule sets at the workflow level
  • Initialization rule sets in the "from phase"
  • Master format control initialization
  • Format control initialization from the form of the phase
To phase on-enter
  • On-exit rule sets at the object level
  • On-exit rule sets at the workflow level
  • On-exit rule sets in the "from phase"
  • Transition rule sets
  • On-enter rule sets at the object level
  • On-enter rule sets at the workflow level
  • On-enter rule sets in the "to phase"
  • Master format control On-update
  • Format control on-update from the form of the phase

Save the record to the database

Note: This is a user action, not an event.

N/A
To phase after-enter
  • After-successful-enter rule sets at the object level
  • After-successful-enter rule sets at the workflow level
  • After-successful-enter rule sets in the "to phase"
  • Master format control subroutine after-update
  • Format control subroutine after-update from the form of the phase