001    package videoautomat.contentcreator.stdactions;
002    
003    import sale.Action;
004    import sale.SaleProcess;
005    import sale.SalesPoint;
006    import sale.Transition;
007    import sale.UIGate;
008    
009    /**
010     * Standart action to perform the given transition
011     * 
012     * @author Tobias Ruch
013     */
014    public class TransitWithAction implements Action {
015       /**
016        * Transition which should be performed by this action
017        */
018       private Transition transition;
019       
020        /**
021         * Constructs an new action.
022         * @param transition - Transition of this action.
023         */
024       public TransitWithAction(Transition transition){
025          this.transition = transition;
026       }
027       
028       /**
029        * Performes the given transition.
030        * @param saleProcess - current {@link sale.SaleProecess}
031        * @param salePoint   - current {@link sale.SalesPoint}
032        */
033       public void doAction(SaleProcess saleProcess, SalesPoint salePoint) throws Throwable {
034          UIGate currentGate = (UIGate)saleProcess.getCurrentGate();
035          currentGate.setNextTransition(transition);
036       }
037    
038    }