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            * ID for Serialization.
017            */
018       private static final long serialVersionUID = 2264074797074037762L;
019       
020       /**
021        * Transition which should be performed by this action
022        */
023       private Transition transition;
024       
025        /**
026         * Constructs an new action.
027         * @param transition - Transition of this action.
028         */
029       public TransitWithAction(Transition transition){
030          this.transition = transition;
031       }
032       
033       /**
034        * Performes the given transition.
035        * @param saleProcess - current {@link sale.SaleProecess}
036        * @param salePoint   - current {@link sale.SalesPoint}
037        */
038       public void doAction(SaleProcess saleProcess, SalesPoint salePoint) throws Throwable {
039          UIGate currentGate = (UIGate)saleProcess.getCurrentGate();
040          currentGate.setNextTransition(transition);
041       }
042    
043    }