@Override
		public Element[] walk(Element[] context, JobDefinition jd) {
			// TODO this code needs some rework to match XML gen for JobReference but we don't
			// support JobDefinitions in the first version of the DSL.
			Element step = doc.createElement("step");
			step.setAttribute("id", jd.getJobName());
			Element tasklet = doc.createElement("tasklet");
			String jobRunnerId = "jobRunner-" + jd.getJobName();
			tasklet.setAttribute("ref", jobRunnerId);
			jobRunnerBeanNames.add(jd.getName());
			step.appendChild(tasklet);
			Element next = null;
			if (jd.hasTransitions()) {
				for (Transition t : jd.transitions) {
					if (t.getTargetJobName().equals(Transition.FAIL)) {
						addFailAttribute(step, t.getStateName());
					}
					else if (t.getTargetJobName().equals(Transition.END)) {
						addEndAttribute(step, t.getStateName());
					}
					else {
						addNextAttribute(step, t.getStateName(), t.getTargetJobName());
					}
				}
				// If there are transitions, it is necessary to ensure the whole exit space is covered from this
			}
			if (context != null) {
				// context is an array of earlier elements that should point to this one
				Element[] elements = context;
				for (Element element : elements) {
					next = doc.createElement("next");
					next.setAttribute("on", "COMPLETED");
					next.setAttribute("to", jd.getJobName());
					element.appendChild(next);
				}
			}
			this.currentElement.peek().appendChild(step);
			return new Element[] { step };
		}
Create a &lt;end on=&gt; attribute and attach it to the supplied step element.
@param step the step that will get the new attribute
@param jobExitStatus the jobExitStatus to fill in as the 'on' attribute value field
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/job/dsl/JobSpecification.java