Link Search Menu Expand Document

block

It is used to group a set of actions.

block {
    set carOwner {
        value = "John Doe"
    }
    print {
        msg = "the owner of the car is ${carOwner}"
    }
    when = car.color=="red"
}

Supported actions:

Specification

Arguments

 TypeRequired?Vars supported? 
descriptionstringnono
whilebooleannoyes
whenbooleannoyes
countnumericnoyes

description ( string | optional ) It is used to apply descriptive text to the action.

Example 1: Basic use of argument

block{
  description = "a new person is created and registered."
}

when ( bool | optional ) It is used to control if the action must be executed.

var {
  evalJobStatus = false
}

block{
  when = evalJobStatus
}

count ( number || optional ) It determines the number of times the action is executed. Additionally, the variable _.index is increased in each iteration. The value of _.index starts with 0 and it ends with count-1.

Example 1: Basic use of the argument

block {

  count = 3
}

while ( boolean | optional ) The action is executed repeatedly as long as the value of this argument is met. Additionally, the variable _.index is increased in each iteration. The value of _.index starts with 0 and increase in 1 in each iteration.

Example 1: Basic use of argument while

block {
  while = _.index<=2
}