If the condition trigger has many conditions, the business rule will truncate the condition string to 254 characters, causing the business rule to fail every time the assessment is triggered.
Steps to Reproduce
- Navigate to Survey Management > Administration.
- Click Trigger Conditions.
- Create a new trigger condition.
- Select the assessment you want to use, or create a new one.
- Assign the table to which this will be related (for example, Incident).
- Select the user you want the survey to be sent to.
- Add four or more conditions.
- Save the record and review the xml to view the condition built there.
- Navigate to System Definition > Business Rule.
- Note that the condition is truncated to 254 characters.
- Try to force the Assessment to trigger.
- Note that the business rule fails.
Edit the generated business rule, remove the broken condition expression, and have the corresponding logic in the script field.
if ((new AssessmentUtils().conditionCheck(current, 'condition-string')))
(new SNC.AssessmentCreation()).conditionTrigger(current, 'trigger-condition-sys-id');
The 'condition-string' should be the encoded condition that is specified in the trigger condition. The trigger-condition-sys-id is the sys-id of the trigger condition defined to send the survey/assessments.
Related Problem: PRB609029