Business Rules have several quirky behaviors that will be addressed in a future release. Please read and understand these points before writing your first business rule.
Table of Contents |
---|
Why do I need a local variable for certain cases ?
...
The code above makes logical sense but it just won't work. In a nutshell this particularity of the implementation can be resumed explained this way:
The right hand side of an assignment expression resolves to the value of a a control passed to a rule when it is invoked. The left hand side uses a reference to the control'.
Lets work with a concrete example to understand the concept. Assume that there are two subtotals in the form, 12 and 14 and the total is correctly set to 26. Now, you add 50 as a third subtotal and the rule fires as a consequence. The values of the controls involved in the rule are passed as parameters to the rule: the subtotals 12,14 and 50 and the current total (value of T), 26. The core of the matter is in the expression:
...
Code Block | ||
---|---|---|
| ||
if (color.value === 'red') {
color.value = 'blue';
} |
No execution error will be logged in server log files (see rule debugging ). The rule will simply not be executedThe rule will simply not be executed and you will find these errors in the frevvo.log file.
Code Block |
---|
21:41:42.812 |-INFO [RuleProcessor] - [set color blue] rule dependency 'color.value' because the same control property is also being assigned: 'color.value = 'blue';'
21:41:42.812 |-WARN [RuleProcessor] - [set color blue] This rule will never be triggered in this form because no valid dependencies were found! |
Why does a commented out code line still execute?
A rule with a code line inside a comment block may still execute. For example this rule uses two different Javascript comment styles. The commented out lines in both cases will execute even though you would expect them to be ignored. Do not use comments for this purpose.
Code Block |
---|
if (form.load)
{
PO.value = 'A-234';
// FN.value = 'Nancy';
/* LN.value = 'Doe'; */
} |
What causes an "Invalid signature detected. Data may have been tampered with" error?
This error message usually displays in multi-step workflows when there is a rule on a subsequent step that executes at form load and updates values inside a signed section in a previous step. Check your rules if you encounter this error.