001 package videoautomat.contentcreator.stdactions;
002
003 import sale.Action;
004 import sale.GateChangeTransition;
005 import sale.SaleProcess;
006 import sale.SalesPoint;
007 import sale.UIGate;
008
009 /**
010 * Standard action to change to stop gate and detach user.
011 *
012 * @author Alexander Herrmann
013 *
014 */
015 public class LogOutAction implements Action {
016
017 /**
018 * Changes to the stop gate and detaches User. Called by an action listener, such as an button.
019 * The attribues are set by the action listener.
020 * @param saleProcess - current {@link sale.SaleProcess}
021 * @param salePoint - current {@link sale.SalesPoint}
022 */
023 public void doAction(SaleProcess saleProcess, SalesPoint sp) throws Throwable {
024 sp.detachUser();
025 UIGate currentGate = (UIGate)saleProcess.getCurrentGate();
026 currentGate.setNextTransition(GateChangeTransition.CHANGE_TO_STOP_GATE);
027 }
028
029 }