Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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. 

...

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  control passed to a rule when it is invoked. The left hand side uses a reference to the control'.

...

What causes an "Invalid signature detected. Data may have been tampered with" error?

Business rules are not prevented from changing control values in signed sections. 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. Here are some examples and solutions:

Example 1:Checkbox with Custom Options in a locked Signed Section

Imagine a two step workflow designed with Linked Steps where step 1 contains a Checkbox control inside a section that the user is required to sign, The checkbox has only one option defined in the flow designer.  A Business rule is executed when step 1 loads to dynamically populate the checkbox with additional options.

Image Modified

The image shows this scenario in use mode after the rule has executed. Notice there are three options for the checkbox now. The user selects all three options, signs then clicks continue.

Image Modified

The flow is routed to Tasks Lists of users who fulfill the requirements for the next step. When Step 2 loads, the rule is executed again. This combination results in data tampered error.

Image Modified

Solution:

This situation can be avoided by always setting more than one option in the flow designer for any checkbox that will be dynamically populated with a rule.

...

  • The same rule will run again due to the linked step design and modify the Case Number control data.
  • Since the data has changed, the signature will show as invalid (tampered data).

 

Solutions:

Change the rule to prevent the value from being changed if there is already a value in the Case Number control in Step 1:

Code Block
var n;
if (form.load && CaseNumber.value.length === 0) {
  CaseNumber.value = n;
}
or add a condition to the rule such that it executes only on step 1 of the flow. This rule uses the built-in method_data.getParameter('flow.activity.name') to detect the current step and uses it in the rule condition.

 

Code Block
var n;
var an = _data.getParameter("flow.activity.name");
if (form.load && an === 'Step 1') {
var n = new Date().valueOf().toString(); 
  CaseNumber.value = n;
}

 

will prevent a rule from modifying a field that's inside a signed section in a future release.

...