-
May 12th, 2010, 12:28 PM
#1
How to get execution context inside the reader
Hi ,
I have implemented the ItemReader interface.Inside the custom item reader, how we will get the execution context?In execution context ,how we can store any key/ value pairs?
Regards,
Siva
-
May 13th, 2010, 01:12 AM
#2
Hi,
To get the execution context in custom reader,You need to implement beforeStep() or afterStep() method.
In that you have to put some value in execution context and you can access that value in next step wherever required,
Like
@BeforeStep
public void beforeStep(StepExecution stepExecution) throws Exception {
ExitStatus exitStatus = stepExecution.getExitStatus();
stepExecution.getJobExecution().getExecutionContex t().put("Name","testUser");
return exitStatus;
}
To access the value from execution context this way,
String str = (String) stepExecution.getJobExecution().getExecutionContex t().get("Name");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules