diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java index 5729f56f0..8d33cb0b1 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java @@ -179,11 +179,14 @@ public abstract class AbstractStepParser { } //add the allow parser here -// String isAllowStart = stepElement.getAttribute(ALLOW_START_ATTR); -// if (StringUtils.hasText(isAllowStart)) { -// //set the value as a property -// bd.getPropertyValues().add("allowStartIfComplete", Boolean.valueOf(isAllowStart)); -// } + String isAllowStart = stepElement.getAttribute(ALLOW_START_ATTR); + if (StringUtils.hasText(isAllowStart)) { + //check if the value is already set from an inner element + if (!bd.getPropertyValues().contains("allowStartIfComplete")) { + //set the value as a property + bd.getPropertyValues().add("allowStartIfComplete", Boolean.valueOf(isAllowStart)); + }//end if + } stepListenerParser.handleListenersElement(stepElement, bd, parserContext); return bd; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTest.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTest.java index 6dc0f6e6f..e401ca832 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTest.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTest.java @@ -12,7 +12,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -@Ignore +//@Ignore @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class TaskletStepAllowStartIfCompleteTest {