Pre Running Actions are very useful to change or calculate Job Parameters. Job Parameters are the parameters which are defined for the job. In the Source of a JobDefinition, parameters can be used directly without any reference. In a Pre Running Action, the parameters cannot be addressed by its name. In a PRA getJobParameterByName() should be used to address to a parameter. With getInValueString() the value of parameter can be retrieved.
{ # JobDefiniton has a parameter (type String, direction In) with the name: P_SERVER String srv = jcsJob.getJobParameterByName("P_SERVER").getInValueString() ; }
Of course it is also possible to set a new value in a PRA for a JobParameter. This can be done by getInValueString()
{ # JobDefiniton has a parameter (type String, direction In) with the name: P_SERVER String srv = jcsJob.getJobParameterByName("P_SERVER").getInValueString() ; srv = srv + "_active" ; jcsJob.getJobParameterByName("P_SERVER").setInValueString(srv); }