SalesPoint v3.3 API

data.stdforms.twotableformsheet
Class CSCSStrategy

java.lang.Object
  extended by sale.stdforms.FormSheetStrategy
      extended by data.stdforms.twotableformsheet.MoveStrategy
          extended by data.stdforms.twotableformsheet.CSCSStrategy
All Implemented Interfaces:
Serializable, ProcessErrorCodes

public class CSCSStrategy
extends MoveStrategy

MoveStrategy for a CountingStock source and destination.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces 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
CSCSStrategy()
           
 
Method Summary
protected  int checkMove(SaleProcess p, SalesPoint sp, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount)
          Check whether the indicated move is allowable.
protected  Gate getCheckMoveGate(SaleProcess p, SalesPoint sp, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount, TwoTableFormSheet ttfs)
          Get the first gate of a sub-process that will move items from one Stock into another.
protected  Gate getCheckMoveToDestGate(SaleProcess p, SalesPoint sp, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount, 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, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount, 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, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount, TwoTableFormSheet ttfs)
          Get the sub-process that will move items from the source to the destination.
 Transition getMoveToSourceProcess(SaleProcess p, SalesPoint sp, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount, TwoTableFormSheet ttfs)
          Get the sub-process that will move items from the destination to the source.
protected  void moveImpl(SaleProcess p, SalesPoint sp, CountingStock csSource, CountingStock csDest, DataBasket db, CatalogItem ci, int nCount)
          Move the indicated number of items from the source CountingStock into the destination CountingStock.
 
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

CSCSStrategy

public CSCSStrategy()
Method Detail

getMoveToDestProcess

public Transition getMoveToDestProcess(SaleProcess p,
                                       SalesPoint sp,
                                       CountingStock csSource,
                                       CountingStock csDest,
                                       DataBasket db,
                                       CatalogItem ci,
                                       int nCount,
                                       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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
nCount - the number of items to be moved.
ttfs - the FormSheet that triggers the process.
Override:
Never

getCheckMoveToDestGate

protected Gate getCheckMoveToDestGate(SaleProcess p,
                                      SalesPoint sp,
                                      CountingStock csSource,
                                      CountingStock csDest,
                                      DataBasket db,
                                      CatalogItem ci,
                                      int nCount,
                                      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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the source.
nCount - the number of items to be moved.
ttfs - the FormSheet that triggers the process.
Returns:
getCheckMoveGate(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int, data.stdforms.TwoTableFormSheet).
Override:
Never Instead, override checkMove(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int) and/or moveImpl(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int).

getMoveToSourceProcess

public Transition getMoveToSourceProcess(SaleProcess p,
                                         SalesPoint sp,
                                         CountingStock csSource,
                                         CountingStock csDest,
                                         DataBasket db,
                                         CatalogItem ci,
                                         int nCount,
                                         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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the destination.
nCount - the number of items to be moved.
ttfs - the FormSheet that triggers the process.
Override:
Never

getCheckMoveToSourceGate

protected Gate getCheckMoveToSourceGate(SaleProcess p,
                                        SalesPoint sp,
                                        CountingStock csSource,
                                        CountingStock csDest,
                                        DataBasket db,
                                        CatalogItem ci,
                                        int nCount,
                                        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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem that is selected in the destination.
nCount - the number of items to be moved.
ttfs - the FormSheet that triggers the process.
Returns:
getCheckMoveGate(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int, data.stdforms.TwoTableFormSheet).
Override:
Never Instead, override checkMove(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int) and/or moveImpl(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int).

getCheckMoveGate

protected Gate getCheckMoveGate(SaleProcess p,
                                SalesPoint sp,
                                CountingStock csSource,
                                CountingStock csDest,
                                DataBasket db,
                                CatalogItem ci,
                                int nCount,
                                TwoTableFormSheet ttfs)
Get the first gate of a sub-process that will move items from one Stock into another.

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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem for which items are to be moved from the source into the destination CountingStock.
nCount - the number of items to be moved.
ttfs - the FormSheet that triggers the process.
Override:
Never Instead, override checkMove(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int) and/or moveImpl(sale.SaleProcess, sale.SalesPoint, data.CountingStock, data.CountingStock, data.DataBasket, data.CatalogItem, int).

moveImpl

protected void moveImpl(SaleProcess p,
                        SalesPoint sp,
                        CountingStock csSource,
                        CountingStock csDest,
                        DataBasket db,
                        CatalogItem ci,
                        int nCount)
Move the indicated number of items from the source CountingStock into the destination CountingStock. 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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem for which items are to be moved.
nCount - the number of items to be moved.
Override:
Sometimes

checkMove

protected int checkMove(SaleProcess p,
                        SalesPoint sp,
                        CountingStock csSource,
                        CountingStock csDest,
                        DataBasket db,
                        CatalogItem ci,
                        int nCount)
                 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.
csSource - the source CountingStock.
csDest - the destination CountingStock.
db - the DataBasket relative to which to perform the operation.
ci - the CatalogItem for which items are to be moved.
nCount - the number of items to be moved.
Throws:
InterruptedException
Override:
Sometimes The default implementation returns 0.

SalesPoint v3.3 API