Class ProcessConsignmentPreFulfillmentAction
- java.lang.Object
-
- de.hybris.platform.processengine.action.AbstractAction<ConsignmentProcessModel>
-
- de.hybris.platform.yacceleratorordermanagement.actions.consignment.ProcessConsignmentPreFulfillmentAction
-
- All Implemented Interfaces:
Action<ConsignmentProcessModel>
public class ProcessConsignmentPreFulfillmentAction extends AbstractAction<ConsignmentProcessModel>
Redirects theConsignmentModel
to wait node, if more pre fulfillment steps are required, else move to sendConsignmentToExternalFulfillmentSystem step inConsignmentProcessModel
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ProcessConsignmentPreFulfillmentAction.Transition
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
LAST_EXECUTED_STRATEGY
-
Fields inherited from class de.hybris.platform.processengine.action.AbstractAction
modelService, processParameterHelper
-
Fields inherited from interface de.hybris.platform.processengine.spring.Action
ERROR_RETURN_CODE, RETRY_RETURN_CODE
-
-
Constructor Summary
Constructors Constructor Description ProcessConsignmentPreFulfillmentAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanStrategyContextParam(ConsignmentProcessModel consignmentProcess)
Removes the strategy context param fromBusinessProcessModel.CONTEXTPARAMETERS
(if any exists), before attempting to set a new paramjava.lang.String
execute(ConsignmentProcessModel consignmentProcess)
Executes thisAction
's business logic working on the givenBusinessProcessModel
.protected java.util.List<ConsignmentPreFulfillmentStrategy>
getConsignmentPreFulfillmentStrategies(ConsignmentModel consignment)
Returns the list ofConsignmentPreFulfillmentStrategy
(s), that needs to be applied on the givenConsignmentModel
protected ConsignmentPreFulfillmentStrategy
getLastExecutedConsignmentPreFulfillmentStrategy(ConsignmentProcessModel consignmentProcess, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies)
Evaluates the last executedConsignmentPreFulfillmentStrategy
for the givenConsignmentModel
protected java.util.Map<java.lang.String,java.util.List<ConsignmentPreFulfillmentStrategy>>
getPreFulfillmentStrategyRegistry()
java.util.Set<java.lang.String>
getTransitions()
Accesses all possible return codes of thisAction
.protected boolean
isTerminalStrategy(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies)
Evaluates if the givenConsignmentPreFulfillmentStrategy
is last pre fulfillment strategy to be executedvoid
setPreFulfillmentStrategyRegistry(java.util.Map<java.lang.String,java.util.List<ConsignmentPreFulfillmentStrategy>> preFulfillmentStrategyRegistry)
protected void
setStrategyInContextParam(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, ConsignmentProcessModel consignmentProcess)
Sets the current executedConsignmentPreFulfillmentStrategy
in the context params of givenConsignmentProcessModel
-
Methods inherited from class de.hybris.platform.processengine.action.AbstractAction
createTransitions, getModelService, getProcessParameterHelper, getProcessParameterValue, refresh, save, setModelService, setOrderStatus, setProcessParameterHelper
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.processengine.spring.Action
getCurrentActionDefinitionContext
-
-
-
-
Field Detail
-
LAST_EXECUTED_STRATEGY
protected static final java.lang.String LAST_EXECUTED_STRATEGY
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public java.lang.String execute(ConsignmentProcessModel consignmentProcess)
Description copied from interface:Action
Executes 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 java.util.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, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies) throws java.lang.IllegalStateException
Evaluates the last executedConsignmentPreFulfillmentStrategy
for the givenConsignmentModel
- Parameters:
consignmentProcess
- theConsignmentProcessModel
consignmentPreFulfillmentStrategies
- the list ofConsignmentPreFulfillmentStrategy
(s) to choose from- Returns:
- the last executed
ConsignmentPreFulfillmentStrategy
.
Returns null, if no strategy was executed before - Throws:
java.lang.IllegalStateException
- if the last executedConsignmentPreFulfillmentStrategy
is invalid
-
setStrategyInContextParam
protected void setStrategyInContextParam(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, ConsignmentProcessModel consignmentProcess)
Sets the current executedConsignmentPreFulfillmentStrategy
in the context params of givenConsignmentProcessModel
- Parameters:
consignmentPreFulfillmentStrategy
- theConsignmentPreFulfillmentStrategy
consignmentProcess
- theConsignmentProcessModel
-
cleanStrategyContextParam
protected void cleanStrategyContextParam(ConsignmentProcessModel consignmentProcess)
Removes the strategy context param fromBusinessProcessModel.CONTEXTPARAMETERS
(if any exists), before attempting to set a new param- Parameters:
consignmentProcess
- theConsignmentProcessModel
for the consignment to be fulfilled
-
isTerminalStrategy
protected boolean isTerminalStrategy(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies)
Evaluates if the givenConsignmentPreFulfillmentStrategy
is last pre fulfillment strategy to be executed- Parameters:
consignmentPreFulfillmentStrategy
- the givenConsignmentPreFulfillmentStrategy
to 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
public java.util.Set<java.lang.String> getTransitions()
Description copied from interface:Action
Accesses 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
protected java.util.Map<java.lang.String,java.util.List<ConsignmentPreFulfillmentStrategy>> getPreFulfillmentStrategyRegistry()
-
setPreFulfillmentStrategyRegistry
public void setPreFulfillmentStrategyRegistry(java.util.Map<java.lang.String,java.util.List<ConsignmentPreFulfillmentStrategy>> preFulfillmentStrategyRegistry)
-
-