If assignment- or append-statements must be executed conditionally, the following syntax can be used:

Syntax
 set object = expression if booleanGuardExpression; 
 append object to arrayExpression if booleanGuardExpression;
Semantics

The set and append statements are applied only if the boolean guard expression evaluates to true.

SubstitutablesobjectAny object name.
expressionA valid expression.
arrayExpressionAn expression evaluating to an array.
booleanGuardExpressionAny expression evaluating to a boolean.
Examples
 set x = "abc" if y > 10;

Example File (Builder project E2E Action Language/BaseTypes):

<your example path>\E2E Action Language\BaseTypes\uml\boolean.xml