SHARE
TWEET

Untitled

a guest Aug 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // define job parameters
  2. JobParametersBuilder parameters = new JobParametersBuilder();
  3.  
  4. // create two steps
  5. TaskletStep step1 = new TaskletStep();
  6. TaskletStep step2 = new TaskletStep();
  7. step1.setName("PreProcessingStep");
  8. step2.setName("ChunkReadWriteStep");
  9.  
  10. // create two TaskLets
  11. Tasklet tasklet1 = new PreProcessingTasklet();
  12. Tasklet tasklet2; <------ HOW DO I ATTACH MY reader/writer IN THIS TASKLET??
  13.  
  14. // attach the TaskLet to the step
  15. step1.setTasklet(tasklet1);
  16. step2.setTasklet(tasklet2);
  17.  
  18. // attach the steps to the job
  19. SimpleJob job = new SimpleJob("MyBatchJob");
  20. job.addStep(step1);
  21. job.addStep(step2);
  22.  
  23. jobLauncher.run(job, parameters.toJobParameters());
  24.      
  25. <job id="MyBatchJob">
  26.     <step id="preprocessing" next="readWriteStep">
  27.         <tasklet ref="PreProcessingTasklet"/>
  28.     </step>
  29.     <step id="readWriteStep">
  30.         <tasklet>
  31.             <chunk reader="FlatFileItemReader" writer="DBItemWriter"/>
  32.         </tasklet>
  33.     </step>
  34. </job>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top