Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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:
...
- On line 5 a Variable_set is created from scratch. It is empty.
- On line 6 the content of the task parameters is merged into this Variable_set.
- 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
- How to set and read job and order parameters
- How to pass parameters to subsequent shell jobs in a job chain
- How to clone parameters from a persistent order
...