Java Code Examples for org.pentaho.di.job.JobMeta#setParameterValue()

The following examples show how to use org.pentaho.di.job.JobMeta#setParameterValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseJobServlet.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void copyJobParameters( Job job, Map<String, String> params ) throws UnknownParamException {
  JobMeta jobMeta = job.getJobMeta();
  // Also copy the parameters over...
  job.copyParametersFrom( jobMeta );
  job.clearParameters();
  String[] parameterNames = job.listParameters();
  for ( String parameterName : parameterNames ) {
    // Grab the parameter value set in the job entry
    String thisValue = params.get( parameterName );
    if ( !StringUtils.isBlank( thisValue ) ) {
      // Set the value as specified by the user in the job entry
      jobMeta.setParameterValue( parameterName, thisValue );
    }
  }
  jobMeta.activateParameters();
}