In Policy Automation, just like our old friend Siebel Enterprise, required base Attributes are highlighted to the user in the form of an asterisk, thus:-

Policy Automation - OPA Required Attribute Asterisk

You will notice that the Policy Automation asterisk is rather small. In fact, it is easy enough to not see it at all. So the question often comes up, how can we rectify this. There are three ways to approach this problem. All will require modification of files used in the Release folder of the Policy Automation Rulebase.

Option One – change the text used for all controls in all situations. Edit the messages.XX.properties files (where XX is the locale you are concerned with in your situation).

Policy Automation - OPA Release Folder Messages File Location

There is a reference in this file as follows, concerning the display of the asterisk. Mandatory text is defined as per the last entry in the section shown below.

Policy Automation - OPA Messages File Mandatory Text Example

So the text can be changed in this file. Upon running the interview again, we can obtain an improved version in this way.

Policy Automation - OPA Required Attribute Improved Version A

The text can include any of the defined authorized HTML tags such as B, I and so on for added formatting. The color of the text is defined in the appearances.properties file, under the heading mandatory-marker-text-color.

However, this solution changes the text for all controls. Suppose you wished to only change it for text controls, or boolean controls and so on?

Option Two therefore is to edit the corresponding VM file from the WEB-INF/classes/templates/controls folder. For example in the following image, the relevant code is highlighted before modification.

Policy Automation - OPA Editing Control VM file for Mandatory Text

Editing the text in the SPAN class=mandatory allows us to change the effect, in this case for a Text Input Control. A demonstration of the effect is below. In the screenshot below, the Boolean Input Control VM file has been modified. The Text Input Control VM file has been left unchanged.

Policy Automation - OPA Required Attribute Changed for Boolean Control

Finally, what if the custom effect is only to be used in certain circumstances? For example, enable the rule designer to optionally use this on certain boolean attributes but not others, in which case the normal asterisk should be shown.

Option Three – To create such an effect (and indeed, a similar technique can be used for many different reasons) requires two steps.  Firstly create a Custom Property within the Rulebase Project for the relevant Object type, in this case Control:

Policy Automation - OPA Create Custom Control Property

Secondly, within the VM template file of the relevant Control, edit in a similar way to the following. In the first part of the file, include a statement such as the example below, in order to get the value of the Custom Property and store it in a variable.

Policy Automation - OPA Boolean Control VM with added Property GetIn the same file, add conditional logic to use the desired text effect when the variable is True or False. The code below is for educational purposes only.

Policy Automation - OPA Custom Boolean Entry VM with Conditional DisplayIn this final case, the developer of the Rulebase can select to use the custom effect just by editing the Custom Property value for the desired control in the relevant Screen, as in the example shown here.

Policy Automation - OPA Custom Property in Screen Editor

So the resulting output looks like this, for False and True values respectively for the Custom Property – which can be managed, moving forward, by the Rulebase designer as needed. No further file modifications are needed to handle the conditional application of our effect.

Policy Automation - OPA Custom Property set to False for Control in Screen Policy Automation - OPA Custom Property set to True for Control in ScreenUntil next time.