高度なエディターでは、条件命令(if、then、else)をサポートしています。これにより、より複雑な式を定義できます。条件命令は、次の要素で構成されています。
すべての式は括弧で囲む必要があります。
if (<expression1>)
then
(<expression2>)
else
(<expression3>)
<expression1>
はブール値を返す必要があります。
<expression2>
と <expression3>
は、同じタイプまたは互換性のあるタイプを持つ必要があります。サポートされているシグネチャと戻り値のタイプは次のとおりです。
boolean,boolean : boolean
dateTime,dateTime : dateTime
dateTimeOnly,dateTimeOnly : dateTimeOnly
decimal,integer : decimal
integer,decimal : integer
integer,decimal : decimal
duration,duration : duration
string,string : string
listBoolean,listBoolean : listBoolean
listDateTime,listDateTime : listDateTime
listDateTimeOnly,listDateTimeOnly : listDateTimeOnly
listDateOnly,listDateOnly : listDateOnly
listDecimal,listDecimal : listDecimal
listInteger,listInteger : listInteger
listString,listString : listString
用途
条件命令を使用すると、条件アクティビティの数を減らして、ジャーニーワークフローを最適化できます。例えば、同じアクションアクティビティ内で、1 つの条件式のみを使用して、1 つのフィールド定義に 2 つの代替オプションを指定できます。
アクションアクティビティの例(条件命令の結果として文字列を想定するフィールドの場合):
if (startWithIgnoreCase(@{eventiOSPushPermissionAllowed.device.model}, 'iPad') or startWithIgnoreCase(@{eventiOSPushPermissionAllowed.device.model}, 'iOS'))
then
('apns')
else
('fcm')