1 package hero.entity; 2 24 25 import hero.interfaces.BnNodeLocal; 26 import hero.interfaces.Constants; 27 28 import org.apache.log4j.Category; 29 30 31 public class ActivityNodeState extends NodeState implements java.io.Serializable { 32 33 private static final Category log = Category.getInstance(ActivityNodeState.class); 35 36 private static int[][] nodeTransition= { 37 { 38 Constants.Nd.BAD_TRANSITION, Constants.Nd.EXECUTING, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 53 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 68 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANT_SUSPENDED, Constants.Nd.ANT_SUSPENDED, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 83 Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.EXECUTING, },{ 98 Constants.Nd.INITIAL, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.INITIAL, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, },{ 113 Constants.Nd.ANTICIPABLE, Constants.Nd.ANTICIPABLE, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPABLE, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPATING, Constants.Nd.ANTICIPATING, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED, Constants.Nd.BAD_TRANSITION, Constants.Nd.ANTICIPABLE, Constants.Nd.ANTICIPABLE, },{ 128 Constants.Nd.READY, Constants.Nd.READY, Constants.Nd.BAD_TRANSITION, Constants.Nd.READY, Constants.Nd.BAD_TRANSITION, Constants.Nd.EXECUTING, Constants.Nd.EXECUTING, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.TERMINATED , Constants.Nd.BAD_TRANSITION, Constants.Nd.EXEC_SUSPENDED, Constants.Nd.EXEC_SUSPENDED, },{ 143 Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, Constants.Nd.DEAD, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.BAD_TRANSITION, Constants.Nd.DEAD, Constants.Nd.DEAD, } 158 }; 159 160 public ActivityNodeState() { 161 } 162 163 public int computeState(BnNodeLocal node,int operation) { 164 log.debug("computeState: node="+node.getName()+" operation="+Constants.Nd.operationName[operation]); 165 return nodeTransition[operation][node.getState()]; 166 } 167 168 169 } 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | Popular Tags |