本文整理了Java中org.pentaho.di.job.Job.listParameters()
方法的一些代码示例,展示了Job.listParameters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.listParameters()
方法的具体详情如下:
包路径:org.pentaho.di.job.Job
类名称:Job
方法名:listParameters
暂无
代码示例来源:origin: pentaho/pentaho-kettle
protected void printJobParameters( Job job ) throws UnknownParamException {
if ( job != null && job.listParameters() != null ) {
for ( String pName : job.listParameters() ) {
printParameter( pName, job.getParameterValue( pName ), job.getParameterDefault( pName ), job.getParameterDescription( pName ) );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
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();
}
代码示例来源:origin: pentaho/pentaho-kettle
@Before
public void setUp() throws Exception {
executor = StepMockUtil.getStep( JobExecutor.class, JobExecutorMeta.class, "TransExecutorUnitTest" );
executor = spy( executor );
executor.setInputRowMeta( mock( RowMetaInterface.class ) );
doNothing().when( executor ).discardLogLines( any( JobExecutorData.class ) );
meta = new JobExecutorMeta();
data = new JobExecutorData();
Job job = mock( Job.class );
doReturn( job ).when( executor ).createJob( any( Repository.class ), any( JobMeta.class ),
any( LoggingObjectInterface.class ) );
doReturn( ArrayUtils.EMPTY_STRING_ARRAY ).when( job ).listParameters();
data.groupBuffer = new ArrayList<>();
data.groupSize = -1;
data.groupTime = -1;
data.groupField = null;
}
代码示例来源:origin: pentaho/pentaho-kettle
public void activateParameters() {
String[] keys = listParameters();
for ( String key : keys ) {
String value;
try {
value = getParameterValue( key );
} catch ( UnknownParamException e ) {
value = "";
}
String defValue;
try {
defValue = getParameterDefault( key );
} catch ( UnknownParamException e ) {
defValue = "";
}
if ( Utils.isEmpty( value ) ) {
setVariable( key, Const.NVL( defValue, "" ) );
} else {
setVariable( key, Const.NVL( value, "" ) );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
String[] parameterNames = job.listParameters();
for ( int idx = 0; idx < parameterNames.length; idx++ ) {
代码示例来源:origin: pentaho/pentaho-kettle
private void passParametersToJob() throws KettleException {
// Set parameters, when fields are used take the first row in the set.
//
JobExecutorParameters parameters = meta.getParameters();
String value;
for ( int i = 0; i < parameters.getVariable().length; i++ ) {
String fieldName = parameters.getField()[i];
if ( !Utils.isEmpty( fieldName ) ) {
int idx = getInputRowMeta().indexOfValue( fieldName );
if ( idx < 0 ) {
throw new KettleException( BaseMessages.getString(
PKG, "JobExecutor.Exception.UnableToFindField", fieldName ) );
}
value = data.groupBuffer.get( 0 ).getString( idx, "" );
this.setVariable( parameters.getVariable()[ i ], value );
}
}
StepWithMappingMeta.activateParams( data.executorJob, data.executorJob, this, data.executorJob.listParameters(),
parameters.getVariable(), parameters.getInput() );
}
代码示例来源:origin: pentaho/pentaho-kettle
String[] parameterNames = job.listParameters();
for ( int idx = 0; idx < parameterNames.length; idx++ ) {
代码示例来源:origin: pentaho/pentaho-kettle
String[] parentParameters = parentJob.listParameters();
for ( int idx = 0; idx < parentParameters.length; idx++ ) {
String par = parentParameters[idx];
String[] parameterNames = job.listParameters();
for ( int idx = 0; idx < parameterNames.length; idx++ ) {
内容来源于网络,如有侵权,请联系作者删除!