BATCH-1064: Rename <pause to=/> to <stop restart=/>

This commit is contained in:
dhgarrette
2009-02-13 06:26:26 +00:00
parent b04841548e
commit ef4ac80e45
4 changed files with 9 additions and 8 deletions

View File

@@ -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<String> patterns = new ArrayList<String>();
for (String transitionName : new String[] { NEXT, PAUSE, END, FAIL }) {
for (String transitionName : new String[] { NEXT, STOP, END, FAIL }) {
@SuppressWarnings("unchecked")
List<Element> transitionElements = (List<Element>) 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)) {

View File

@@ -588,7 +588,7 @@
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="pause">
<xsd:element name="stop">
<xsd:annotation>
<xsd:documentation>
Declares job should be stop at this point and provides pointer where execution should continue when
@@ -601,9 +601,9 @@
<xsd:documentation>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.</xsd:documentation>
</xsd:annotation></xsd:attribute>
<xsd:attribute name="to" type="xsd:string" use="required" >
<xsd:attribute name="restart" type="xsd:string" use="required" >
<xsd:annotation>
<xsd:documentation>The name of the step to go to next.
<xsd:documentation>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.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>

View File

@@ -10,7 +10,7 @@
<job id="job">
<step id="fail" ref="failingStep">
<pause on="FAILED" to="s2"/>
<stop on="FAILED" restart="s2"/>
</step>
<step id="s2" ref="step2"/>
</job>

View File

@@ -10,7 +10,7 @@
<job id="job">
<step id="s1" ref="step1">
<pause on="COMPLETED" to="decision"/>
<stop on="COMPLETED" restart="decision"/>
</step>
<decision id="decision" decider="decider">
<next on="FOO" to="s2"/>