Kettle(Pentaho PDI):无法找到这份工作的起点

时间:2016-06-30 16:37:38

标签: pentaho kettle pdi

我使用Java中的Kettle手动创建作业,但收到错误消息Couldn't find starting point in this job

KettleEnvironment.init();
JobMeta jobMeta = new JobMeta();
JobEntrySpecial start = new JobEntrySpecial("START", true, false);
start.setStart(true);
JobEntryCopy startEntry = new JobEntryCopy(start);
jobMeta.addJobEntry(startEntry);                    

JobEntryTrans jet1 = new JobEntryTrans("first");
Trans trans1 = jet1.getTrans();
jet1.setFileName("file.ktr");
JobEntryCopy jc1 = new JobEntryCopy(jet1);
jobMeta.addJobEntry(jc1);

jobMeta.addJobHop(new JobHopMeta(startEntry, jc1));
Job job = new Job(null, jobMeta);
job.setInteractive(true);
job.start();

2 个答案:

答案 0 :(得分:1)

我发现我失踪了

job.setStartJobEntryCopy(startEntry);

答案 1 :(得分:0)

类org.pentaho.di.job.JobMeta类有方法findJobEntry

你可以用它来寻找名为" START

的入口点

这就是它如何成为kettle-pdi的原始来源

private JobMeta jobMeta;
....

// Where do we start?
jobEntryCopy startpoint;
....

if ( startJobEntryCopy == null ) {
        startpoint = jobMeta.findJobEntry( JobMeta.STRING_SPECIAL_START, 0, false );

// and then 
JobEntrySpecial jes = (JobEntrySpecial) startpoint.getEntry();