Versions Compared

Key

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

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Order Parameters and Job Parameters

To access the order parameters and job parameters from a job one must have access to the JobScheduler internal API. Implementing an API Job, or a pre-/post-processing routine, in Java or in a scripting language that can implement the Job_impl interface, the access is possible via the JobScheduler objects.

Getting the Objects

JobScheduler has two different types of parameters:

...

  1. On line 5 a Variable_set is created from scratch. It is empty.
  2. On line 6 the content of the task parameters is merged into this Variable_set.
  3. On line 7 and 8 the order parameter, if the job runs as a job chain job, will be merged as well into the Variable_set

Get variable values

To get a variable value from the object Variable_set one has to use the method var():

...

If the variable with the given name does not exist then the value of the result variable will be null. The values of the JobScheduler's variables are always of type "String".

Set variable values

Code Block
    public void setJSParam(final String pstrKey, final String pstrValue) {
        @SuppressWarnings("unused")
        final String conMethodName = conClassName + "::setJSParam";
        if (isNotNull(spooler_task.params())) \{
            spooler_task.params().set_var(pstrKey, pstrValue);
        }
        if (hasOrderParameters()) {
            [http://www.sos-berlin.com/doc/en/scheduler.doc/api/Task-java.xml  spooler_task].order().params().set_var(pstrKey, pstrValue);
        }
        if (isNotNull(objJobOrOrderParams)) {
            objJobOrOrderParams.set_var(pstrKey, pstrValue);
        }
    } 

...

It is important to take into account that the modification of a variable is only effective for JobScheduler if this modification is done in the JobScheduler object and not in the copy which is provided by the getJobOrOrderParameters() method.

Further References

Job and Order Parameters

...