How can active text be used in business rules?

Active text can occur in any option of a statically defined select variable (see Editing variables).
For example, consider some text variables
ManagingDirector, FinanceDirector
and
CompanySecretary
associated with the variable
CompanyName
. Consider also the variable
MeetingChairPerson
whose statically defined options are:
{ManagingDirector} : the managing director of {CompanyName}
{FinanceDirector} : the finance director of {CompanyName}
{CompanySecretary} : the company secretary of {CompanyName}
If the values for these variables are "Jane Doe", "John Buck", "Sir Arthur Conan Doyle" and "Alpha Holdings", the select options will be rendered as:
Jane Doe
: the managing director of
Alpha Holdings
John Buck
: the finance director of
Alpha Holdings
Sir Arthur Conan Doyle
: the company secretary of
Alpha Holdings
Now consider a conditional span which will only be included in a generated document if the meeting chairperson is the company secretary. For the particular answer set above this would be:
[
MeetingChairPerson Is "Sir Arthur Conan Doyle : the company secretary of Alpha Holdings"
... ]
Obviously this should not be used in the template because it pre-supposes the values. It is tempting, instead, to mark-up the span as:
[
MeetingChairPerson Is "{CompanySecretary} : the company secretary of {CompanyName}"
... ]
but this too would be wrong because the value for
MeetingChairPerson
, namely "Sir Arthur Conan Doyle : the company secretary of Alpha Holdings", does not equal the text "{CompanySecretary} : the company secretary of {CompanyName}" which is always considered literally.
The correct mark-up for the span is:
[
MeetingChairPerson Is CompanySecretary + " : the company secretary of " + CompanyName
... ]
A better way of approaching this problem would be to introduce three new computation variables:
MeetingChairManagingDirector
MeetingChairFinanceDirector
MeetingChairCompanySecretary
whose definitions are, respectively:
ManagingDirector + " : the managing director of " + CompanyName
FinanceDirector + " : thefinance director of " + CompanyName
CompanySecretary + " : thecompany secretaryof " + CompanyName
The statically defined options for MeetingChairPerson would then be:
{MeetingChairManagingDirector}
{MeetingChairFinanceDirector}
{MeetingChairCompanySecretary}
and the mark-up for the span would be:
[
MeetingChairPerson Is MeetingChairCompanySecretary
... ]

Related content