1 package org.sapia.soto.state.helpers; 2 3 import org.sapia.soto.state.ExecContainer; 4 import org.sapia.soto.state.Result; 5 import org.sapia.soto.state.Step; 6 7 import org.sapia.util.xml.confix.ConfigurationException; 8 import org.sapia.util.xml.confix.ObjectHandlerIF; 9 10 11 19 public abstract class CompositeStep extends ExecContainer 20 implements ObjectHandlerIF, Step { 21 public CompositeStep() { 22 } 23 24 27 public void execute(Result res) { 28 if (doExecute(res)) { 29 if (res.isError()) { 30 return; 31 } else if (res.getNextStateId() != null) { 32 return; 33 } else { 34 super.execute(res); 35 } 36 } 37 } 38 39 protected abstract boolean doExecute(Result res); 40 41 44 public void handleObject(String name, Object obj) 45 throws ConfigurationException { 46 if (obj instanceof Step) { 47 super.addExecutable((Step) obj); 48 } 49 } 50 } 51 | Popular Tags |