Class DefaultWorkflowTemplateActivationService
java.lang.Object
com.hybris.backoffice.workflow.impl.DefaultWorkflowTemplateActivationService
- All Implemented Interfaces:
WorkflowTemplateActivationService
public class DefaultWorkflowTemplateActivationService
extends Object
implements WorkflowTemplateActivationService
default implementation of service which allows to create workflow based on workflow templates and its activation
scripts
WorkflowTemplateModel.getActivationScript()-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateWorkflowTemplates(Collection<WorkflowTemplateActivationCtx> activationCtxList) For every given activation ctx, seeksWorkflowTemplateModelwith activation script and runs the script which activation ctx.collectCurrentValues(ItemModel item, Set<String> attributes, Map<String, Set<Locale>> localizedAttributes) collectLocalizedValues(Map<String, Set<Locale>> localizedAttributes, BiFunction<String, Locale, Object> localizedAttributeValue) collectModifiedAttributes(ItemModelContext itemModelCtx, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType) collectModifiedLocalizedAttributes(ItemModelContext itemModelCtx, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType) collectOriginalValues(ItemModelContext itemModelCtx, Set<String> attributes, Map<String, Set<Locale>> localizedAttributes) protected voidcopyInvocationContext(com.hybris.cockpitng.dataaccess.context.Context invocationCtx, com.hybris.cockpitng.dataaccess.context.Context toCtx) protected ItemModelContextgetItemModelContext(ItemModel item) protected StringgetLanguageIsoCodeForLocale(Locale locale) getLocalizedValuesForAttribute(String attribute, Set<Locale> locales, BiFunction<String, Locale, Object> attributeValue) com.hybris.cockpitng.dataaccess.facades.type.TypeFacadeprotected booleanisSupportedType(String typeCode) protected com.hybris.cockpitng.dataaccess.facades.type.DataTypeloadDataType(String typeCode) protected WorkflowTemplateActivationCtxprepareContextForCreate(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) protected WorkflowTemplateActivationCtxprepareContextForRemove(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) protected WorkflowTemplateActivationCtxprepareContextForSave(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) prepareWorkflowTemplateActivationContexts(Map<? extends ItemModel, WorkflowTemplateActivationAction> items, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) PreparesWorkflowTemplateActivationCtxfor every item in given items list.protected WorkflowTemplateActivationCtxprepareWorkflowTemplateActivationCtx(ItemModel item, WorkflowTemplateActivationAction action, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) voidsetLocalizationService(LocalizationService localizationService) voidsetScriptEvaluationService(ScriptEvaluationService scriptEvaluationService) voidsetTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) voidsetTypeService(TypeService typeService) voidsetWorkflowActivationSupportedTypes(Set<String> workflowActivationSupportedTypes)
-
Constructor Details
-
DefaultWorkflowTemplateActivationService
public DefaultWorkflowTemplateActivationService()
-
-
Method Details
-
activateWorkflowTemplates
Description copied from interface:WorkflowTemplateActivationServiceFor every given activation ctx, seeksWorkflowTemplateModelwith activation script and runs the script which activation ctx. Workflows should be activated after items are saved/created.For more information please readScriptEvaluationService- Specified by:
activateWorkflowTemplatesin interfaceWorkflowTemplateActivationService- Parameters:
activationCtxList- list fo activation contexts which should be created before items are saved.
-
prepareWorkflowTemplateActivationContexts
public List<WorkflowTemplateActivationCtx> prepareWorkflowTemplateActivationContexts(Map<? extends ItemModel, WorkflowTemplateActivationAction> items, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) Description copied from interface:WorkflowTemplateActivationServicePreparesWorkflowTemplateActivationCtxfor every item in given items list. Contexts have to be created before items are saved/created due to information about original values which is removed after saving items.- Specified by:
prepareWorkflowTemplateActivationContextsin interfaceWorkflowTemplateActivationService- Parameters:
items- map of items with workflow action.invocationCtx- context of invocation which will be copied into returned contexts- Returns:
- list of activation ctx
-
isSupportedType
-
prepareWorkflowTemplateActivationCtx
protected WorkflowTemplateActivationCtx prepareWorkflowTemplateActivationCtx(ItemModel item, WorkflowTemplateActivationAction action, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) -
loadDataType
-
prepareContextForRemove
protected WorkflowTemplateActivationCtx prepareContextForRemove(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) -
prepareContextForSave
protected WorkflowTemplateActivationCtx prepareContextForSave(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) -
prepareContextForCreate
protected WorkflowTemplateActivationCtx prepareContextForCreate(ItemModel item, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.dataaccess.context.Context invocationCtx) -
getItemModelContext
-
collectCurrentValues
-
collectOriginalValues
-
collectValues
-
collectLocalizedValues
-
getLocalizedValuesForAttribute
-
collectModifiedAttributes
protected Set<String> collectModifiedAttributes(ItemModelContext itemModelCtx, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType) -
collectModifiedLocalizedAttributes
protected Map<String,Set<Locale>> collectModifiedLocalizedAttributes(ItemModelContext itemModelCtx, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType) -
copyInvocationContext
protected void copyInvocationContext(com.hybris.cockpitng.dataaccess.context.Context invocationCtx, com.hybris.cockpitng.dataaccess.context.Context toCtx) -
getLanguageIsoCodeForLocale
-
setTypeFacade
public void setTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) -
getTypeFacade
public com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade() -
setScriptEvaluationService
-
getScriptEvaluationService
-
setLocalizationService
-
getLocalizationService
-
setWorkflowActivationSupportedTypes
-
getWorkflowActivationSupportedTypes
-
setTypeService
-
getTypeService
-