1 package cz.cuni.amis.pogamut.sposh.executor; 2 3 /** 4 * The value returned by the primitive via {@link IWorkExecutor} that can modify the behavior of posh stack evaluation. 5 * 6 * @author Jimmy 7 */ 8 public enum ActionResult { 9 10 /** 11 * Indicated failure of the action. 12 * <p><p> 13 * Failing an action means to roll back intention-stack of the drive down to the last adapt (no adapt == delete the stack). 14 * <p><p> 15 * Note that {@link StateWorkExecutor} won't stop PoshEngine execution upon this result. 16 */ 17 FAILED, 18 19 /** 20 * Indicates that action is running within the environment and needs time to finish its execution. 21 * <p><p> 22 * PoshEngine won't delete the action from the stack and will wait for its full execution. 23 * <p><p> 24 * Note that {@link StateWorkExecutor} will execute PoshEngine cycles until it hits some RUNNING/RUNNING_ONCE action. 25 */ 26 RUNNING, 27 28 /** 29 * Indicates that action is running within the environment BUT it wants to be running for only ONE cycle. 30 * <p><p> 31 * PoshEngine will delete the action from the stack and terminates with SURFACE. 32 * <p><p> 33 * Note that {@link StateWorkExecutor} will execute PoshEngine cycles until it hits some RUNNING/RUNNING_ONCE action. 34 */ 35 RUNNING_ONCE, 36 37 /** 38 * Indicates that the action has finished and PoshEngine may search for another action to execute. 39 * <p><p> 40 * Note that {@link StateWorkExecutor} will continue running PoshEngine after FINISHING some action (until some RUNNING/RUNNING_ONCE action is executed). 41 */ 42 FINISHED; 43 44 }