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 theConsignmentModelto 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 classProcessConsignmentPreFulfillmentAction.Transition
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringLAST_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 voidcleanStrategyContextParam(ConsignmentProcessModel consignmentProcess)Removes the strategy context param fromBusinessProcessModel.CONTEXTPARAMETERS(if any exists), before attempting to set a new paramjava.lang.Stringexecute(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 givenConsignmentModelprotected ConsignmentPreFulfillmentStrategygetLastExecutedConsignmentPreFulfillmentStrategy(ConsignmentProcessModel consignmentProcess, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies)Evaluates the last executedConsignmentPreFulfillmentStrategyfor the givenConsignmentModelprotected 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 booleanisTerminalStrategy(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, java.util.List<ConsignmentPreFulfillmentStrategy> consignmentPreFulfillmentStrategies)Evaluates if the givenConsignmentPreFulfillmentStrategyis last pre fulfillment strategy to be executedvoidsetPreFulfillmentStrategyRegistry(java.util.Map<java.lang.String,java.util.List<ConsignmentPreFulfillmentStrategy>> preFulfillmentStrategyRegistry)protected voidsetStrategyInContextParam(ConsignmentPreFulfillmentStrategy consignmentPreFulfillmentStrategy, ConsignmentProcessModel consignmentProcess)Sets the current executedConsignmentPreFulfillmentStrategyin 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: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 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 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:
java.lang.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
protected void cleanStrategyContextParam(ConsignmentProcessModel consignmentProcess)
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, java.util.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
public java.util.Set<java.lang.String> 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
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)
-
-