From ef4ac80e45801780026cdf57bb7ab12a82aa4da4 Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Fri, 13 Feb 2009 06:26:26 +0000 Subject: [PATCH] BATCH-1064: Rename to --- .../batch/core/configuration/xml/FlowParser.java | 7 ++++--- .../batch/core/configuration/xml/spring-batch-2.0.xsd | 6 +++--- .../xml/StopIncompleteJobParserTests-context.xml | 2 +- .../core/configuration/xml/StopJobParserTests-context.xml | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowParser.java index 697d9a3eb..fe11ba536 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/FlowParser.java @@ -43,7 +43,7 @@ public class FlowParser extends AbstractSingleBeanDefinitionParser { private static final String NEXT = "next"; private static final String END = "end"; private static final String FAIL = "fail"; - private static final String PAUSE = "pause"; + private static final String STOP = "stop"; // For generating unique state names for end transitions private static int endCounter = 0; @@ -138,7 +138,7 @@ public class FlowParser extends AbstractSingleBeanDefinitionParser { boolean transitionElementExists = false; List patterns = new ArrayList(); - for (String transitionName : new String[] { NEXT, PAUSE, END, FAIL }) { + for (String transitionName : new String[] { NEXT, STOP, END, FAIL }) { @SuppressWarnings("unchecked") List transitionElements = (List) DomUtils.getChildElementsByTagName(element, transitionName); @@ -194,6 +194,7 @@ public class FlowParser extends AbstractSingleBeanDefinitionParser { BatchStatus batchStatus = getBatchStatusFromEndTransitionName(transitionElement.getNodeName()); String onAttribute = transitionElement.getAttribute("on"); String nextAttribute = transitionElement.getAttribute("to"); + nextAttribute = StringUtils.hasText(nextAttribute) ? nextAttribute : transitionElement.getAttribute("restart"); String statusAttribute = transitionElement.getAttribute("status"); return createTransition(batchStatus, onAttribute, nextAttribute, statusAttribute, stateDef, parserContext); @@ -256,7 +257,7 @@ public class FlowParser extends AbstractSingleBeanDefinitionParser { * @return the BatchStatus corresponding to the transition name */ private static BatchStatus getBatchStatusFromEndTransitionName(String elementName) { - if (PAUSE.equals(elementName)) { + if (STOP.equals(elementName)) { return BatchStatus.INCOMPLETE; } else if (END.equals(elementName)) { diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd index bbea6da13..884bd0826 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd @@ -588,7 +588,7 @@ - + Declares job should be stop at this point and provides pointer where execution should continue when @@ -601,9 +601,9 @@ A pattern to match against the exit status code. Use * and ? as wildcard characters. When a step finishes the most specific match will be chosen to select the next step. - + - The name of the step to go to next. + The name of the step to start on when the stopped job is restarted. Must resolve to one of the other steps in this job. diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml index 216784a07..3f16423c8 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml @@ -10,7 +10,7 @@ - + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopJobParserTests-context.xml index 6a8027ce0..fbf613391 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopJobParserTests-context.xml @@ -10,7 +10,7 @@ - +