Adding a Localized Business Rule Message
A message can display static text or dynamic text, based on the value of a variable.
Note: This option uses locales. It is not context-dependent. Contact your Stibo Systems representative to display additional language locales on your Web UI or workbench.
- Open the Edit Operation dialog for an existing JavaScript business rule. For more information, refer to the Editing a Business Rule or Function topic here.
In this example, we have selected a condition and are using the 'return' statement to display the message.
- On the Edit Operation dialog, for the Messages parameter, click the Edit button () to display the 'Edit messages' dialog.
- Click the Add message button () and add a variable name and the message text.
A variable message can include the name of the business rule or any other data that would be helpful in resolving the problem reported by the message.
A variable tag within the message text is optional. In this example, the tag is {size} and will return the value of the attribute from the bound product.
- Click the Translations flipper () to open it ().
- Click the Add translation button () to add the translated text. Multiple translations can be added. Do not translate variable tags.
- Click OK to close the 'Edit messages' dialog.
- On the Edit Operation dialog, for the JavaScript parameter, add JavaScript code to display the message. In this example, our business condition will use the 'return' statement.
- If you added a translation, test the results by logging in to the locale that matches the language for the message using workbench or the Web UI. For our example, we select the Danish locale.
- Test the business rule or run a workflow that uses it to display the translated message. For information, refer to the Testing a Business Rule topic here.