gn:act_if
- Description
- Action that acts as a conditional action. It accepts other actions as conditions and other actions that are defined to execute if condition was
true
or if it wasfalse
. - If all conditions are
true
, action will executetrue
block of actions, if any condition isfalse
, action will executefalse
block of actions.
- Action returns
- void
Action signatures
if action
[gn:act_if]|[conditionAction{n}--actionIfTrue{n}::actionIfFalse{n}]
Parameter Description conditionAction{n}
Action or list of actions separated by : **
characters (**
= AND condition)||
characters (||
= OR condition)
All conditional actions must return
boolean
Use)
and(
braces to group expression parts.actionIfTrue{n}
optionalAction or list of actions separated by
;
character, executed ifconditionAction{n}
returnstrue
actionIfFalse{n}
optionalAction or list of actions separated by
;
character, executed ifconditionAction{n}
returnsfalse
Example
[gn:act_hasTableRights]|[bebraTimeRecordingemployee!=C]
- conditional action[gn:act_toast]|[@string/$noWriteRightsToast];[gn:act_break]|[]
- executed if conditional action returnstrue
[gn:act_toast]|[@string/$successToast];[gn:act_break]|[]
- executed if conditional action returnsfalse
[gn:act_if]|[[gn:act_hasTableRights]|[bebraTimeRecordingemployee!=C]--[gn:act_toast]|[@string/$noWriteRightsToast];[gn:act_break]|[]::[gn:act_toast]|[@string/$successToast];[gn:act_break]|[]]
[gn:act_if]|[[gn:act_widgetContent]|[equals,@variable/a,@variable/true]||[gn:act_widgetContent]|[equals,@variable/c,@variable/true]--[gn:act_toast]|[true]::[gn:act_toast]|[false]]"
[gn:act_if]|[[gn:act_widgetContent]|[equals,@variable/a,@variable/true]**([gn:act_widgetContent]|[equals,@variable/b,@variable/true]||([gn:act_widgetContent]|[equals,@variable/b,@variable/true]**[gn:act_widgetContent]|[equals,@variable/c,@variable/true]))--[gn:act_toast]|[true]::[gn:act_toast]|[false]]"