1 package org.sapia.soto.state; 2 3 4 12 public class TestState implements State { 13 public boolean exec; 14 public boolean success; 15 String successId; 16 String errId; 17 String id; 18 19 public TestState(boolean success) { 20 this.success = success; 21 } 22 23 public String getId() { 24 return id; 25 } 26 27 public void setId(String id) { 28 this.id = id; 29 } 30 31 public void setSuccess(String flowId) { 32 successId = flowId; 33 } 34 35 public void setError(String flowId) { 36 errId = flowId; 37 } 38 39 public void execute(Result st) { 40 if (!success) { 41 st.setNextStateId(errId); 42 } else { 43 st.setNextStateId(successId); 44 } 45 46 exec = true; 47 } 48 } 49 | Popular Tags |