Sequence of rules in views and forms


Badge

When I edit a rule, I can see how to sequence the rule definitions, move them up and down, etc.

Can I alter the sequence of the rules themselves? It seems my only options for rules are Add, Edit, Remove and Disable.

I have a rule that runs a SmartObject and it is being executed before some of the inputs to the SmartObject have been initialized.

What solutions are available to me?


2 replies

Userlevel 1
Badge +8

Hi dlheies

 

There are a few aspects of rules that you need to be aware of. This should help you configure your rules to avoid your issue.

 

Form Rule Sequence

 

The form and views have Initialize and Initialized methods. When opening a form the rules will run by default as follows:

  1. Form Initializing
  2. View Initializing
  3. View Initialized
  4. Form Initialized

When you drop a view on a form it will add a statement in the Form Initializing rule to call the View Initialize method/rule. You can remove this and place elsewhere if necessary to alter the above sequence.

 

Rule Action Execution Types

 

Rules actions can be run as 

  • One after another
  • Concurrently
  • In a batch
  • Asynchronous

If you run a rule Asynchronous the following actions and rules will continue to execute without waiting for the asynchronous action to finish.

 

Have a look at the following KB for more info.

 

http://help.k2.com/KB001432

 

 

Badge +10

To keep things simple, I would just change all the rules to "one after another". After than think about what each rule does and then start setting the concurrent, batch and asynchronous while testing at each step. These last three types of executions are more for optimiziing the performance of your forms and views.

 

Reply