Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expression
$var >= 199
JSON"varisGreater": "$var >= 199"

Arithmetic Operators

...

Referencing Variables

The syntax $VARIABLE, $`VARIABLE`, ${VARIABLE} or ${`VARIABLE`} is used to read the value of a variable.

  • Similar to a number of Unix shells a variable can be recalled with $ or with ${}

...

  • .
  • Variable names can include dots, however, not at the beginning and not at the end of the variable name and not as a sequence of dots.
  • Variable names with dots have to be referenced like this: $`mail.smtp.host`, ${`mail.smtp.host`}

If the variable is unknown then an error is raised and the affected Order will fail.

...

  • $js7JobName
    • The name of the current job for which an order is executed.
  • $epochMilli
    • The number of milliseconds since January 1st 1970 UTC.
  • $returnCode
    • The numeric exit code of the current job for which an order is executed.

Build-in Functions

  • env( "environment-variable", "default" )
    • The function reads the value of an existing OS environment variable. The name has to be specified in correct uppercase/lowercase spelling.
    • If the environment variable does not exist then an error is raised and the Order fails. Alternatively a default value can be specified.
    • Examples:

      Expression
      env( ('JS7_AGENT_CONFIG_DIR')
      JSON"env( 'JS7_AGENT_CONFIG_DIR' )"
      Sample Value/var/sos-berlin.com/js7/agent/var_4445/config
      Expression
      env( 'JAVA_HOME', '/usr/lib/jvm/java-1.8-openjdk' )
      JSON"env( 'JAVA_HOME', '/usr/lib/jvm/java-1.8-openjdk' )"
      Sample Value/usr/lib/jvm/java-1.8-openjdk
      Expression
      env( 'HOSTNAME', env( 'COMPUTERNAME' ) )
      JSON"env( 'HOSTNAME', env( 'COMPUTERNAME' ) )"
      Sample Value2021-05-03 07:30:42
  • now( format='yyyy-MM-dd hh:mm:ss', timezone='Europe/Berlin' )
    • The job start date. This date can be formatted using Java date qualifiers. Optionally a time zone can be specified, by default the UTC time zone is used.
    • ExampleExamples:

      Expression
      now( format='yyyy-MM-dd' )
      JSON"\"now( format='yyyy-MM-dd' )\""
      Sample Value2021-05-03
      Expression
      now( format='yyyy-MM-dd hh:mm:ss' )
      JSON"\"now( format='yyyy-MM-dd hh:mm:ss' )\""
      Sample Value2021-05-03 07:30:42
      Expression
      now( format='yyyy-MM-dd  hh:mm:ssssZ', timezone="UTCEurope/Berlin" )
      JSON"\"now( format='yyyy-MM-dd hh:mm:ssssZ', timezone=\\\"Europe/Berlin\\\" )\""
      Sample Value2021-05-03 09:30:42+02:00
  • scheduledOrEmpty( format='yyyy-MM-dd hh:mm:ss', timezone='Europe/Berlin' )
    • The date for which an orders is scheduled.
    • The date formatting options are the same as explained with the now() function.

Further Resources

...