How to Create Object Rules for a Generic Survey

This topic details how to create object rules for generic surveys to automatically update the properties and attributes of assets and business components. These rules use a simpler interface and should be written directly in the field using the following structure:

WHEN(Condition)DO

{

Asset.FieldName = Answer[Answer Number];

Asset.AttributeVariableName = Answer[Answer Number];

}

 

The first portion of the rule indicates what condition needs to be true for the actions to take place. A single condition should be entered in between the parenthesis, as in the examples below:

WHEN(Answer[5].EqualsTo("2"))DO

WHEN(Answer[6].Contains("0","1","2","3"))DO

WHEN(ALWAYS)DO

 

The second portion of the rule indicates what actions should take place if the conditions are true. The actions should be entered in between braces with each action separated by a semicolon.

{

BusinessComponent.Name = Answer[1];

BusinessComponent.Criticality = Answer[3];

}

 

The answers to multiple questions can be used to update a single property or attribute using basic mathematical functions:

BusinessComponent.AttributeVariableName = Answer[3] * (Answer[4] - Answer[3]) / (Answer[3] ^ Answer[3] * 3.1429);

 

Text can be entered in between quotes as the value for the property or attribute, or it can be inserted between answers to two different questions. This is useful for concatenating text answers with spaces in between them if more than one answer is used to update the property.

BusinessComponent.AttributeVariableName = "text";

BusinessComponent. AttributeVariableName = Answer[1] + " " + Answer[2];

 

You may update custom text attributes with the date the rule was executed, which also means the date the interview was answered. Dates accept the Brazilian (dd/mm/yyyy) and the American (mm/dd/yyyy) formats.

Asset.TextAttributeVariableName= todaydmy;

BusinessComponent.TextAttributeVariableName= todaymdy;

 

To include more than one set of conditions and actions, simply repeat the structure. The order in which the rules will be executed is the order in which they are written.

WHEN(Condition 1)DO

{

BusinessComponent.FieldName = Answer[Answer Number];

}

WHEN(Condition 2)DO

{

BusinessComponent.FieldName = Answer[Answer Number];

}

 

If a question used in an object rule is left blank by interviewees either because it was optional or because it was hidden due to question rules, the object rule will not be executed. Similarly, object rules will also not be executed if an attribute used in one is deleted or edited so that it no longer applies to the type of object the survey is being used for. If a question used in an object rule is reordered, the actions in the rules will automatically be updated to reflect the change. If a question is deleted, the survey can be saved but not published until the corresponding rule, highlighted red in the list due to the error, is corrected.

Only certain types of questions can be used to answer certain types of properties and attributes. For example, the response provided to a Number question cannot be used to update an E-mail attribute, as this type of attribute only allows e-mail addresses to be entered in it, not plain numbers. To make sure that these rules are consistent, you can validate object rules to check whether the variables used in the rules match the types of questions supported, for example. The table below lists the properties and attributes that can be updated through rules with the corresponding types of questions that can be used to update each. Note that the variables’ names are case sensitive.

Property/Attribute

Variable for Use in Rules

Types of Questions Supported

Applicable to Business Components?

Applicable to Assets?

Name

Name

Text

Yes

Yes

Description

Description

Text

Yes

Yes

Additional Information

AdditionalInformation

Text

Yes

No

Relevance

Relevance

Number or List of Options (single selection)

Yes

Yes

Criticality

Criticality

Number or List of Options (single selection)

Yes

Yes

Operational Impact of 1 Day

OperationalImpact1Day

Number

Yes

No

Operational Impact of 3 Days

OperationalImpact3Days

Number

Yes

No

Operational Impact of 5 Days

OperationalImpact5Days

Number

Yes

No

Operational Impact of 7 days

OperationalImpact7Days

Number

Yes

No

Operational Impact of 15 days

OperationalImpact15Days

Number

Yes

No

Operational Impact of 30 days

OperationalImpact30Days

Number

Yes

No

Regulatory Impact of 1 Day

RegulatoryImpact1Day

Number

Yes

No

Regulatory Impact of 3 Days

RegulatoryImpact3Days

Number

Yes

No

Regulatory Impact of 5 Days

RegulatoryImpact5Days

Number

Yes

No

Regulatory Impact of 7 days

RegulatoryImpact7Days

Number

Yes

No

Regulatory Impact of 15 days

RegulatoryImpact15Days

Number

Yes

No

Regulatory Impact of 30 days

RegulatoryImpact30Days

Number

Yes

No

Image Impact of 1 Day

ImageImpact1Day

Number

Yes

No

Image Impact of 3 Days

ImageImpact3Days

Number

Yes

No

Image Impact of 5 Days

ImageImpact5Days

Number

Yes

No

Image Impact of 7 days

ImageImpact7Days

Number

Yes

No

Image Impact of 15 days

ImageImpact15Days

Number

Yes

No

Image Impact of 30 days

ImageImpact30Days

Number

Yes

No

Financial Impact of 1 Day

FinancialImpact1Day

Number

Yes

No

Financial Impact of 3 Days

FinancialImpact3Days

Number

Yes

No

Financial Impact of 5 Days

FinancialImpact5Days

Number

Yes

No

Financial Impact of 7 days

FinancialImpact7Days

Number

Yes

No

Financial Impact of 15 days

FinancialImpact15Days

Number

Yes

No

Financial Impact of 30 days

FinancialImpact30Days

Number

Yes

No

MTPD

MTPD

Number

Yes

No

RTO

RTO

Number

Yes

No

RPO

RPO

Number

Yes

No

E-mail attributes

Use variable name as configured in Objects and Attributes section of the Administration module

Text

Yes

Yes

Number attributes

Use variable name as configured in Objects and Attributes section of the Administration module

Text, Number, or List of Options (single selection) with numeric value

Yes

Yes

Paragraph attributes

Use variable name as configured in Objects and Attributes section of the Administration module

Text

Yes

Yes

List of Options attributes (single selection)

Use variable name as configured in Objects and Attributes section of the Administration module

List of Options (single selection or multiple selection) with the same attribute options

Yes

Yes

List of Options attributes (multiple selection)

Use variable name as configured in Objects and Attributes section of the Administration module

List of Options (single or multiple selection)

Yes

Yes

Link attributes

Use variable name as configured in Objects and Attributes section of the Administration module

Text

Yes

Yes

Text attributes

Use variable name as configured in Objects and Attributes section of the Administration module

Text

Yes

Yes

 

1.    Access the Knowledge module.

2.    In the Knowledge menu, click the Surveys option.

3.    Click Edit next to the generic survey for which you want to create object rules.

4.    Click the Object Rules tab to create rules that will automatically update the properties and attributes of business components or assets (see figure below).

 

 

5.    Enter the rules and click Validate to validate the rules before proceeding. Note that validation messages will appear in the Validation Messages tab if errors are found.

 

Note: The system will only validate the syntax of the rule, not the logic. It’s important to check that the rules are consistent with the questions, and that if any changes are made to the questions the rules are also updated.

 

6.    When finished, click Save.

 

If no errors are encountered, the system displays a success message.

 

Note: The system supports up to 300 rules per survey without suffering any performance loss. This number includes all rules – control, object, or question, depending on the survey – created for a single survey. If the limit is not respected, the system performance will be compromised when managing surveys in the Knowledge module, but will not be affected when answering the interviews generated from these surveys.