Class ProcessConsignmentPreFulfillmentAction
java.lang.Object
de.hybris.platform.processengine.action.AbstractAction<ConsignmentProcessModel>
de.hybris.platform.yacceleratorordermanagement.actions.consignment.ProcessConsignmentPreFulfillmentAction
- All Implemented Interfaces:
Action<ConsignmentProcessModel>
Redirects the
ConsignmentModel to wait node, if more pre fulfillment steps are required, else move to sendConsignmentToExternalFulfillmentSystem step in ConsignmentProcessModel.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum -
Field Summary
FieldsFields inherited from class de.hybris.platform.processengine.action.AbstractAction
modelService, processParameterHelperFields inherited from interface de.hybris.platform.processengine.spring.Action
ERROR_RETURN_CODE, RETRY_RETURN_CODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanStrategyContextParam(ConsignmentProcessModel consignmentProcess) Removes the strategy context param fromBusinessProcessModel.CONTEXTPARAMETERS(if any exists), before attempting to set a new paramexecute(ConsignmentProcessModel consignmentProcess) Executes thisAction's business logic working on the givenBusinessProcessModel.protected List<ConsignmentPreFulfillmentStrategy>getConsignmentPreFulfillmentStrategies(ConsignmentModel consignment) Returns the list ofConsignmentPreFulfillmentStrategy(s), that needs to be applied on the givenConsignmentModelprotected ConsignmentPreFulfillmentStrategygetLastExecutedConsignmentPreFulfillmentStrategy(ConsignmentProcessModel consignmentProcess, List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies) Evaluates the last executedConsignmentPreFulfillmentStrategyfor the givenConsignmentModelprotected Map<String,List<ConsignmentPreFulfillmentStrategy>> Accesses all possible return codes of thisAction.protected booleanisTerminalStrategy(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies) Evaluates if the givenConsignmentPreFulfillmentStrategyis last pre fulfillment strategy to be executedvoidsetPreFulfillmentStrategyRegistry(Map<String, List<ConsignmentPreFulfillmentStrategy>> preFulfillmentStrategyRegistry) protected voidsetStrategyInContextParam(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, ConsignmentProcessModel consignmentProcess) Sets the current executedConsignmentPreFulfillmentStrategyin the context params of givenConsignmentProcessModelMethods inherited from class de.hybris.platform.processengine.action.AbstractAction
createTransitions, getModelService, getProcessParameterHelper, getProcessParameterValue, refresh, save, setModelService, setOrderStatus, setProcessParameterHelperMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.processengine.spring.Action
getCurrentActionDefinitionContext
-
Field Details
-
LAST_EXECUTED_STRATEGY
- See Also:
-
-
Constructor Details
-
ProcessConsignmentPreFulfillmentAction
public ProcessConsignmentPreFulfillmentAction()
-
-
Method Details
-
execute
Description copied from interface:ActionExecutes thisAction's business logic working on the givenBusinessProcessModel.- Parameters:
consignmentProcess- The process context to work on.- Returns:
- the return code as stated in the process definition. This code is used by the process engine to determine the next actions.
-
getConsignmentPreFulfillmentStrategies
protected List<ConsignmentPreFulfillmentStrategy> getConsignmentPreFulfillmentStrategies(ConsignmentModel consignment) Returns the list ofConsignmentPreFulfillmentStrategy(s), that needs to be applied on the givenConsignmentModel- Parameters:
consignment- theConsignmentModel- Returns:
- the list of
ConsignmentPreFulfillmentStrategy(s)
-
getLastExecutedConsignmentPreFulfillmentStrategy
protected ConsignmentPreFulfillmentStrategy getLastExecutedConsignmentPreFulfillmentStrategy(ConsignmentProcessModel consignmentProcess, List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies) throws IllegalStateException Evaluates the last executedConsignmentPreFulfillmentStrategyfor the givenConsignmentModel- Parameters:
consignmentProcess- theConsignmentProcessModelconsignmentPreFulfillmentStrategies- the list ofConsignmentPreFulfillmentStrategy(s) to choose from- Returns:
- the last executed
ConsignmentPreFulfillmentStrategy.
Returns null, if no strategy was executed before - Throws:
IllegalStateException- if the last executedConsignmentPreFulfillmentStrategyis invalid
-
setStrategyInContextParam
protected void setStrategyInContextParam(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, ConsignmentProcessModel consignmentProcess) Sets the current executedConsignmentPreFulfillmentStrategyin the context params of givenConsignmentProcessModel- Parameters:
consignmentPreFulfillmentStrategy- theConsignmentPreFulfillmentStrategyconsignmentProcess- theConsignmentProcessModel
-
cleanStrategyContextParam
Removes the strategy context param fromBusinessProcessModel.CONTEXTPARAMETERS(if any exists), before attempting to set a new param- Parameters:
consignmentProcess- theConsignmentProcessModelfor the consignment to be fulfilled
-
isTerminalStrategy
protected boolean isTerminalStrategy(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies) Evaluates if the givenConsignmentPreFulfillmentStrategyis last pre fulfillment strategy to be executed- Parameters:
consignmentPreFulfillmentStrategy- the givenConsignmentPreFulfillmentStrategyto be checkedconsignmentPreFulfillmentStrategies- the given list ofConsignmentPreFulfillmentStrategy(s) to check against- Returns:
- true if there is no more strategy to be executed after this strategy
-
getTransitions
Description copied from interface:ActionAccesses all possible return codes of thisAction. This method is used by the process engine to validate a process definition. Furthermore it can be used by (graphical) editors to access all return codes which have to mapped in transitions.- Returns:
- all possible return codes of this
Action
-
getPreFulfillmentStrategyRegistry
-
setPreFulfillmentStrategyRegistry
public void setPreFulfillmentStrategyRegistry(Map<String, List<ConsignmentPreFulfillmentStrategy>> preFulfillmentStrategyRegistry)
-