Use IncrementGlobalParam()
and DecrementGlobalParam()
to increment and decrement, respectively, an integer global parameter previosly created using SetGlobalParam() in a thread-safe way (as an "atomic" transaction).
For example, if you need to count how many times a workflow has been executed since a certain moment, you'll need to use these IncrementGlobalParam("myCounter")
, because workflow sessions for different records may execute in parallel, so code like
โSetGlobalParam("myCounter", GetGlobalParam("myCounter")+1)
would not work.
How to use
Use the function in any of the following ways:
IncrementGlobalParam(name[, step=1])
DecrementGlobalParam(name[, step=1])
Input
name
: the name of the global parameter (key) to increment or decrement.step
(optional, integer): the value by which to increment or decrement thename
parameter.
โ
Output
None.
Examples
IncrementGlobalParam("myParam")
IncrementGlobalParam("myParam", 100)