
Originally Posted by
lucasward
yes, there's a property on the step 'saveExecutionAttributes' which should be set to true.
it is weird that it still failed... trying to trace into the code to see what I have done wrong but not found the answer yet.
Here is what I am doing:
Code:
<bean id="job" parent="simpleJob">
<property name="steps">
<list>
<bean id="step1" parent="simpleStep">
<property name="tasklet">
<bean id="tradeTasklet"
class="com.foo.TradeMatchTasklet"
scope="step">
<aop:scoped-proxy />
</bean>
</property>
<property name="commitInterval" value="2" />
<property name="saveExecutionAttributes" value="true" />
</bean>
</list>
</property>
</bean>
and my tasklet:
Code:
public class TradeMatchTasklet implements Tasklet, StepContextAware {
//... some other boring getters setters etc deleted
public ExitStatus execute() throws Exception {
stepContext.setAttribute("test" + status, "hello");
if ((++(this.status)) > 5) {
return ExitStatus.FINISHED;
}
return ExitStatus.CONTINUABLE;
}
}