Uploaded image for project: 'JOC - JobScheduler Operations Center'
  1. JOC - JobScheduler Operations Center
  2. JOC-749

Job Stream Jobs should support function calls in parameter values and some default environment variables

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.13
    • 1.13.1
    • None
    • None

    Description

      Current Situation

      Function calls in parameter values are not supported

      Desired Behavior

      Function Calls in parameter values

      It should be possible to have function calls like %%today()%% in the value of the parameters. These function calls will be executed and the function call will get the value from the function call.

      • Example
        today is %%today()%%
      • calculated date is %%calcdate(20191105,3,yyyyMMdd)%% 
        • calcdate(date,quantity,format)
          • date: in the format yyyyMMdd or yyMMdd or the string today
          • quantity: number of days to be added/substracted
          • outformat: default yyyyMMdd. To define the format of the result
      • substring is %%substring(test,2,2)%%
        • substring
          • string: the source
          • from: the begin of the substring
          • length: the length of the substring
            • e.g. substring(12345,2,3) will result 234

      Environment variables

      In the Job script there should be some default environment variables available

      • JS_JOBSTREAM
        • The name of actual job stream
      • JS_TIME
        • The actual Time. The format is hhmmss
      • JS_CENTURY
        • The century. At the moment 20
      • JS_DAY
        • The actual day of the month. Format is dd
      • JS_YEAR_YYYY or JS_YEAR
        • The actual year. Format is yyyy
      • JS_YEAR_YY
        • The actual year. Format is yy
      • JS_MONTH
        • The actual month of the year. Format is MM
      • JS_MONTH_NAME
        • Then name of the actual month of the year
      • JS_DATE_YYYY or JS_DATE
        • The actual date in the format yyyyMMdd
      • JS_DATE_YY
        • The actual date in the format yyMMdd
      • JS_FOLDER
        • The actual folder of the job (parent of the job name)
      • JS_JOBNAME
        • The job name (full name with path)

      It is also possible to use the env vars in the parameters for substitution

      Example: 

      • Param name = test
      • Param value =%%substring(\${JS_FOLDER},2,2)%%
      • Will evaluated to jo if the job is in the folder /jobstream
        • echo %SCHEDULER_PARAM_TEST% 
          • ==> jo

      Attachments

        Issue Links

          Activity

            People

              ur Uwe Risse
              ur Uwe Risse
              Chanchal Khatri Chanchal Khatri (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: