public class ConsignmentToReallocateController
extends DefaultWidgetController
| Modifier and Type | Field and Description |
|---|---|
protected static int |
COLUMN_INDEX_REALLOCATION_COMMENT |
protected static int |
COLUMN_INDEX_REALLOCATION_LOCATION |
protected static int |
COLUMN_INDEX_REALLOCATION_QUANTITY |
protected static int |
COLUMN_INDEX_REALLOCATION_REASON |
protected static java.lang.Object |
COMPLETED |
protected static java.lang.String |
CONSIGNMENT_ACTION_EVENT_NAME |
protected static java.lang.String |
DECLINE_ENTRIES |
protected static java.lang.String |
IN_SOCKET |
protected static java.lang.String |
OUT_CONFIRM |
protected static java.lang.String |
REALLOCATE_CONSIGNMENT_CHOICE |
| Constructor and Description |
|---|
ConsignmentToReallocateController() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addListeners()
Add listeners on Intbox, Combobox and Textbox so that when a change happens on one of these components, we are
catching it.
|
protected void |
applyToCheckboxRow(java.lang.Object data,
Component component)
Applies a specific change if the current element is a checkbox
|
protected void |
applyToComboboxRow(java.lang.Object data,
Component component)
Applies a specific change if the current element is a combobox
|
protected void |
applyToGrid(java.lang.Object data,
int childrenIndex)
Apply a value to the elements contained in the grid
|
protected void |
applyToRow(java.lang.Object data,
int childrenIndex,
Component row)
Apply a specific change to a specific row of the grid
|
protected void |
autoSelect(Event event)
Automatically select the checkbox in front of the row
|
protected void |
buildDeclineParam(ConsignmentProcessModel processModel,
java.util.Collection<DeclineEntry> entriesToReallocate)
Build and save the context parameter for decline entries and set it into the given process
|
protected void |
cleanDeclineParam(ConsignmentProcessModel processModel)
Removes the old decline entries from
BusinessProcessModel.CONTEXTPARAMETERS(if any exists), before attempting to decline |
void |
confirmReallocation()
Confirm the reallocation request
|
protected void |
createDeclineEntry(java.util.Collection<DeclineEntry> entriesToReallocate,
Component component)
Creates a decline entry for the current row
|
protected CockpitEventQueue |
getCockpitEventQueue() |
protected BackofficeLocaleService |
getCockpitLocaleService() |
protected ConsignmentModel |
getConsignment() |
protected WarehousingBusinessProcessService<ConsignmentModel> |
getConsignmentBusinessProcessService() |
protected Grid |
getConsignmentEntries() |
protected java.util.Optional<DeclineReason> |
getCustomSelectedDeclineReason(Event event)
Gets the label for the selected decline reason in case the event has a target of Combobox
|
protected EnumerationService |
getEnumerationService() |
protected int |
getLocationIndex(WarehouseModel location)
Gets the location index within the combobox model
|
protected ModelService |
getModelService() |
protected NotificationService |
getNotificationService() |
protected int |
getReasonIndex(DeclineReason declineReason)
Gets the reason index within the combobox model
|
protected java.util.Optional<DeclineReason> |
getSelectedDeclineReason(Event event)
get the corresponding decline reason according to the selected item in the combobox if existing
|
protected WarehouseModel |
getSelectedLocation(Event event)
Get the corresponding warehouse location according to the selected item in the combobox if anything is selected
|
protected DefaultWarehouseStockService |
getWarehouseStockService() |
protected void |
handleGlobalComment(Event event)
Updates all entries with the selected global comment
|
protected void |
handleGlobalLocation(Event event)
Updates all entries with the selected global location
|
protected void |
handleGlobalReason(Event event)
Updates all entries with the selected global reason
|
protected void |
handleIndividualLocation(Event event)
Updates an individual entry with the selected location
|
protected void |
handleIndividualReason(Event event)
Updates an individual entry with the selected reason
|
protected void |
handleRow(Row row)
Set or Reset the given row with the appropriate default informations
|
void |
initReallocationConsignmentForm(ConsignmentModel inputObject)
Initialize the popup to reallocate consignment entries
|
protected boolean |
isDeclinedQuantityCorrect(ConsignmentModel latestConsignmentModel,
DeclineEntry declineEntry)
Check if the declined quantity of the passed consignment model matches the expected quantity to be declined.
|
protected boolean |
isDeclineProcessDone(ConsignmentModel latestConsignmentModel,
java.util.Collection<DeclineEntry> entriesToReallocate)
Check if the decline process is done or not.
|
protected java.util.Optional<DeclineReason> |
matchingComboboxDeclineReason(java.lang.String declineReasonLabel)
Retrieve the
DeclineReason according to the selected label in the
combobox |
void |
reset()
Reinitialize the popup.
|
protected void |
selectAllEntries()
Select or unselect all the rows of the grid and sets the default values for each of them.
|
void |
setConsignment(ConsignmentModel consignment) |
protected Component |
targetFieldToApplyValidation(java.lang.String stringToValidate,
int indexLabelToCheck,
int indexTargetComponent)
Retrieve the row who needs to apply a validation message
|
protected void |
validateConsignmentEntry(ConsignmentEntryToReallocateDto entry)
Validate each consignment entry and throw a
WrongValueException if it fails any check |
protected void |
validateRequest()
Check if the data provided by the form are compliant with the validation rules
|
protected static final java.lang.String IN_SOCKET
protected static final java.lang.String OUT_CONFIRM
protected static final java.lang.Object COMPLETED
protected static final java.lang.String CONSIGNMENT_ACTION_EVENT_NAME
protected static final java.lang.String REALLOCATE_CONSIGNMENT_CHOICE
protected static final java.lang.String DECLINE_ENTRIES
protected static final int COLUMN_INDEX_REALLOCATION_QUANTITY
protected static final int COLUMN_INDEX_REALLOCATION_REASON
protected static final int COLUMN_INDEX_REALLOCATION_LOCATION
protected static final int COLUMN_INDEX_REALLOCATION_COMMENT
public void initReallocationConsignmentForm(ConsignmentModel inputObject)
inputObject - the consignment for which we want to ask for one or several reallocation(s)public void confirmReallocation()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected void createDeclineEntry(java.util.Collection<DeclineEntry> entriesToReallocate, Component component)
entriesToReallocate - the list to which the newly created decline entry will be added tocomponent - the current row from which the decline entry will be createdpublic void reset()
protected void addListeners()
protected void applyToGrid(java.lang.Object data,
int childrenIndex)
data - the value to pass to the gridchildrenIndex - the index indicating where to find the right component in the gridprotected void applyToRow(java.lang.Object data,
int childrenIndex,
Component row)
data - the new value to setchildrenIndex - the index of the component in the gridrow - the row to which the change needs to be appliedprotected void applyToComboboxRow(java.lang.Object data,
Component component)
data - the element for which the change has to be appliedcomponent - the component which will have the change appliedprotected void applyToCheckboxRow(java.lang.Object data,
Component component)
data - the element for which the change has to be appliedcomponent - the component which will have the change appliedprotected void autoSelect(Event event)
event - the event that triggered the autoselectprotected void buildDeclineParam(ConsignmentProcessModel processModel, java.util.Collection<DeclineEntry> entriesToReallocate)
processModel - the process model for which the context parameters has to be registerentriesToReallocate - the entries to be reallocatedprotected void cleanDeclineParam(ConsignmentProcessModel processModel)
BusinessProcessModel.CONTEXTPARAMETERS(if any exists), before attempting to declineprocessModel - the ConsignmentProcessModel for the consignment to be declinedprotected int getLocationIndex(WarehouseModel location)
location - the location which the item(s) will be reallocated toprotected int getReasonIndex(DeclineReason declineReason)
declineReason - the reason for which we want to know the indexprotected java.util.Optional<DeclineReason> getSelectedDeclineReason(Event event)
event - the select event on the comboboxprotected java.util.Optional<DeclineReason> getCustomSelectedDeclineReason(Event event)
event - the event that was firedprotected WarehouseModel getSelectedLocation(Event event)
event - the select event on the comboboxprotected void handleGlobalComment(Event event)
event - the event that triggered the changeprotected void handleGlobalLocation(Event event)
event - the event that triggered the changeprotected void handleGlobalReason(Event event)
event - the event that triggered the changeprotected void handleIndividualReason(Event event)
event - the event that triggered the changeprotected void handleIndividualLocation(Event event)
event - the event that triggered the changeprotected void handleRow(Row row)
row - the row to set/resetprotected boolean isDeclineProcessDone(ConsignmentModel latestConsignmentModel, java.util.Collection<DeclineEntry> entriesToReallocate)
latestConsignmentModel - the updated consignment modelentriesToReallocate - the entries to be reallocatedprotected boolean isDeclinedQuantityCorrect(ConsignmentModel latestConsignmentModel, DeclineEntry declineEntry)
latestConsignmentModel - declineEntry - protected java.util.Optional<DeclineReason> matchingComboboxDeclineReason(java.lang.String declineReasonLabel)
DeclineReason according to the selected label in the
comboboxdeclineReasonLabel - a Stringprotected void selectAllEntries()
protected Component targetFieldToApplyValidation(java.lang.String stringToValidate,
int indexLabelToCheck,
int indexTargetComponent)
stringToValidate - the string to compare to identify a specific row in the gridindexLabelToCheck - the index of the label to which we want to compare the passed stringindexTargetComponent - the index of the grid where the target component is locatedprotected void validateConsignmentEntry(ConsignmentEntryToReallocateDto entry)
WrongValueException if it fails any checkentry - the individual entry to validateprotected void validateRequest()
protected ConsignmentModel getConsignment()
public void setConsignment(ConsignmentModel consignment)
protected EnumerationService getEnumerationService()
protected Grid getConsignmentEntries()
protected WarehousingBusinessProcessService<ConsignmentModel> getConsignmentBusinessProcessService()
protected ModelService getModelService()
protected BackofficeLocaleService getCockpitLocaleService()
protected CockpitEventQueue getCockpitEventQueue()
protected DefaultWarehouseStockService getWarehouseStockService()
protected NotificationService getNotificationService()
Copyright © 2018 SAP SE. All Rights Reserved.