SalesPoint Framework v3.1

data.stdforms.twotableformsheet
Class CSSStrategy

java.lang.Object
  extended bysale.stdforms.FormSheetStrategy
      extended bydata.stdforms.twotableformsheet.MoveStrategy
          extended bydata.stdforms.twotableformsheet.CSSStrategy
All Implemented Interfaces:
ProcessErrorCodes, Serializable

public abstract class CSSStrategy
extends MoveStrategy

MoveStrategy for a Catalog source and a StoringStock destination. Abstract as creating StockItems is application dependant.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
createStockItem(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.CatalogItem), Serialized Form

Nested Class Summary
 
Nested classes inherited from class sale.stdforms.FormSheetStrategy
FormSheetStrategy.ErrorHandler
 
Field Summary
 
Fields inherited from class sale.stdforms.FormSheetStrategy
DEFAULT_ERROR_HANDLER, m_ehErrHandler, MSG_POPUP_ERROR_HANDLER
 
Fields inherited from interface sale.ProcessErrorCodes
DATABASKET_CONFLICT_ERROR, DUPLICATE_KEY_EXCEPTION, ERR_INTERNAL, ERR_LOWERBOUND, ERR_NOERROR, ERR_UPPERBOUND, NOT_ENOUGH_ELEMENTS_ERROR, REMOVE_VETO_EXCEPTION
 
Constructor Summary
CSSStrategy()
           
 
Method Summary
protected  int checkMoveToDest(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, CatalogItem ci)
          Check whether the indicated move is allowable.
protected  int checkMoveToSource(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, StockItem si)
          Check whether the indicated move is allowable.
protected abstract  StockItem createStockItem(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, CatalogItem ci)
          Create a fresh StockItem following the specifications given.
protected  Gate getCheckMoveToDestGate(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, CatalogItem ci, TwoTableFormSheet ttfs)
          Get the first gate of the sub-process that will move items from the source to the destination.
protected  Gate getCheckMoveToSourceGate(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, StockItem si, TwoTableFormSheet ttfs)
          Get the first gate of the sub-process that will move items from the destination to the source.
 Transition getMoveToDestProcess(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, CatalogItem ci, TwoTableFormSheet ttfs)
          Get the sub-process that will move items from the source to the destination.
 Transition getMoveToSourceProcess(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, StockItem si, TwoTableFormSheet ttfs)
          Get the sub-process that will move items from the destination to the source.
protected  void moveToDest(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, StockItem si)
          Move the item as indicated into the destination Stock.
protected  void moveToSource(SaleProcess p, SalesPoint sp, Catalog cSource, StoringStock ssDest, DataBasket db, StockItem si)
          Move the indicated item as indicated from the destination Stock.
 
Methods inherited from class data.stdforms.twotableformsheet.MoveStrategy
canMoveToDest, canMoveToSource
 
Methods inherited from class sale.stdforms.FormSheetStrategy
error, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSStrategy

public CSSStrategy()
Method Detail

getMoveToDestProcess

public Transition getMoveToDestProcess(SaleProcess p,
                                       SalesPoint sp,
                                       Catalog cSource,
                                       StoringStock ssDest,
                                       DataBasket db,
                                       CatalogItem ci,
                                       TwoTableFormSheet ttfs)
Get the sub-process that will move items from the source to the destination.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
ttfs - the FormSheet that triggers the process.
Override:
Never

getCheckMoveToDestGate

protected Gate getCheckMoveToDestGate(SaleProcess p,
                                      SalesPoint sp,
                                      Catalog cSource,
                                      StoringStock ssDest,
                                      DataBasket db,
                                      CatalogItem ci,
                                      TwoTableFormSheet ttfs)
Get the first gate of the sub-process that will move items from the source to the destination.

This Gate will check whether the move is allowable, and if so, will trigger a Transition that performs it.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
ttfs - the FormSheet that triggers the process.
Override:
Never Instead, override checkMoveToDest(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.CatalogItem), createStockItem(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.CatalogItem) and/or moveToDest(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.StockItem).

checkMoveToDest

protected int checkMoveToDest(SaleProcess p,
                              SalesPoint sp,
                              Catalog cSource,
                              StoringStock ssDest,
                              DataBasket db,
                              CatalogItem ci)
                       throws InterruptedException
Check whether the indicated move is allowable. If so, return 0, otherwise return a non-zero error value that can be passed on to FormSheetStrategy.error(sale.SaleProcess, int). You can assume that you are at a Gate.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
Throws:
InterruptedException
Override:
Sometimes The default implementation returns 0.

createStockItem

protected abstract StockItem createStockItem(SaleProcess p,
                                             SalesPoint sp,
                                             Catalog cSource,
                                             StoringStock ssDest,
                                             DataBasket db,
                                             CatalogItem ci)
                                      throws InterruptedException
Create a fresh StockItem following the specifications given. You can assume that you are at a Gate.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
Throws:
InterruptedException
Override:
Always This method is application dependant.

moveToDest

protected void moveToDest(SaleProcess p,
                          SalesPoint sp,
                          Catalog cSource,
                          StoringStock ssDest,
                          DataBasket db,
                          StockItem si)
Move the item as indicated into the destination Stock. You can assume that you are in a Transition.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
si - the StockItem to be moved into the destination.
Override:
Sometimes

getMoveToSourceProcess

public Transition getMoveToSourceProcess(SaleProcess p,
                                         SalesPoint sp,
                                         Catalog cSource,
                                         StoringStock ssDest,
                                         DataBasket db,
                                         StockItem si,
                                         TwoTableFormSheet ttfs)
Get the sub-process that will move items from the destination to the source.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
si - the StockItem that is selected in the destination.
ttfs - the FormSheet that triggers the process.
Override:
Never

getCheckMoveToSourceGate

protected Gate getCheckMoveToSourceGate(SaleProcess p,
                                        SalesPoint sp,
                                        Catalog cSource,
                                        StoringStock ssDest,
                                        DataBasket db,
                                        StockItem si,
                                        TwoTableFormSheet ttfs)
Get the first gate of the sub-process that will move items from the destination to the source.

This Gate will check whether the move is allowable, and if so, will trigger a Transition that performs it.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
si - the StockItem that is selected in the destination.
ttfs - the FormSheet that triggers the process.
Override:
Never Instead, override checkMoveToSource(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.StockItem) and/or moveToSource(sale.SaleProcess, sale.SalesPoint, data.Catalog, data.StoringStock, data.DataBasket, data.StockItem).

checkMoveToSource

protected int checkMoveToSource(SaleProcess p,
                                SalesPoint sp,
                                Catalog cSource,
                                StoringStock ssDest,
                                DataBasket db,
                                StockItem si)
                         throws InterruptedException
Check whether the indicated move is allowable. If so, return 0, otherwise return a non-zero error value that can be passed on to FormSheetStrategy.error(sale.SaleProcess, int). You can assume that you are at a Gate.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
si - the StockItem that is selected in the destination.
Throws:
InterruptedException
Override:
Sometimes The default implementation returns 0.

moveToSource

protected void moveToSource(SaleProcess p,
                            SalesPoint sp,
                            Catalog cSource,
                            StoringStock ssDest,
                            DataBasket db,
                            StockItem si)
Move the indicated item as indicated from the destination Stock. You can assume that you are in a Transition.

Parameters:
p - the process into which the sub-process wil be embedded.
sp - the SalesPoint, if any, at which the FormSheet is being displayed.
cSource - the source Catalog.
ssDest - the destination StoringStock.
db - the DataBasket relative to which to perform the operation.
si - the StockItem that is selected in the destination.
Override:
Sometimes

SalesPoint Framework v3.1