Package de.hybris.platform.workflow.impl
Class DefaultWorkflowService
- java.lang.Object
-
- de.hybris.platform.workflow.impl.DefaultWorkflowService
-
- All Implemented Interfaces:
WorkflowService
- Direct Known Subclasses:
BackofficeWorkflowService,DefaultCMSWorkflowService
public class DefaultWorkflowService extends java.lang.Object implements WorkflowService
Default implementation ofWorkflowService
-
-
Constructor Summary
Constructors Constructor Description DefaultWorkflowService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanassignUser(PrincipalModel principalModel, WorkflowModel workflowModel)Assigns principal to workflow.booleancanBeStarted(WorkflowModel workf)Checks if workflow can be startedWorkflowModelcreateAdhocWorkflow(java.lang.String defaultName, java.util.List<ItemModel> itemsToAdd, UserModel owner)Creates adhoc workflow with a name and adds an attachment to it.WorkflowModelcreateWorkflow(WorkflowTemplateModel template, ItemModel attachmentItem, UserModel owner)Creates workflow based on a template and adds an attachment to it.WorkflowModelcreateWorkflow(WorkflowTemplateModel template, UserModel owner)Creates workflow based on a template.WorkflowModelcreateWorkflow(java.lang.String workflowName, WorkflowTemplateModel template, java.util.List<ItemModel> itemsToAdd, UserModel owner)Creates workflow based on a template and adds an attachment to it.java.util.List<WorkflowModel>getAllAdhocWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date adhocDateFrom, java.util.Date adhocDateTo)Returns addhoc workflows that match statuses and time range.SearchResult<WorkflowModel>getAllAdhocWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date adhocDateFrom, java.util.Date adhocDateTo, int startIndex, int pageSize)Pageable version of methodWorkflowService.getAllAdhocWorkflows(EnumSet, Date, Date)java.util.List<WorkflowModel>getAllWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date dateFrom, java.util.Date dateTo)Returns workflows that match statuses and time range.SearchResult<WorkflowModel>getAllWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date dateFrom, java.util.Date dateTo, int startIndex, int pageSize)Pageable version of methodWorkflowService.getAllWorkflows(EnumSet, Date, Date)java.util.DategetStartTime(WorkflowModel workflow)Gets start time from a workflowprotected WorkflowActionModelgetWorkAction(WorkflowActionTemplateModel templateAction, java.util.List<WorkflowActionModel> workflowActions)WorkflowModelgetWorkflowForCode(java.lang.String code)Returns workflow for a given codejava.util.List<WorkflowModel>getWorkflowsForTemplateAndUser(WorkflowTemplateModel template, UserModel user)Returns workflows that was created from giventemplatewhom owner is givenuser.booleanisAdhocWorkflow(WorkflowModel workflowModel)Checks if workflow is adhocbooleanisCompleted(WorkflowModel workflowModel)Checks if workflow is completedbooleanisFinished(WorkflowModel workflowModel)Checks if workflow is finishedbooleanisPaused(WorkflowModel workflowModel)Checks if workflow is pausedbooleanisPlanned(WorkflowModel workflowModel)Checks if workflow is plannedbooleanisRunning(WorkflowModel workflowModel)Checks if workflow is runningbooleanisTerminated(WorkflowModel workflowModel)Checks if workflow is terminatedvoidsetActionsWorkflowTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowTemplateModel,java.util.List<WorkflowActionModel>> actionsFromWorkflowTemplate)voidsetDecisionsActionTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowActionTemplateModel,java.util.List<WorkflowDecisionModel>> decisionsFromActionTemplate)voidsetModelService(ModelService modelService)voidsetPredecessorsActionTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowActionTemplateModel,java.util.List<AbstractWorkflowActionModel>> predecessorsFromActionTemplate)voidsetWorkflowActionService(WorkflowActionService workflowActionService)voidsetWorkflowDao(WorkflowDao workflowDao)voidsetWorkflowTemplateService(WorkflowTemplateService workflowTemplateService)booleanunassignUser(WorkflowModel workflowModel)Unassigns principal from workflow and assign dummy uservoidwriteAutomatedComment(WorkflowActionModel action, java.lang.String message, java.lang.String... messageParams)
-
-
-
Method Detail
-
setActionsWorkflowTemplateFactory
public void setActionsWorkflowTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowTemplateModel,java.util.List<WorkflowActionModel>> actionsFromWorkflowTemplate)
-
setDecisionsActionTemplateFactory
public void setDecisionsActionTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowActionTemplateModel,java.util.List<WorkflowDecisionModel>> decisionsFromActionTemplate)
-
setPredecessorsActionTemplateFactory
public void setPredecessorsActionTemplateFactory(WorkflowFactory<WorkflowModel,WorkflowActionTemplateModel,java.util.List<AbstractWorkflowActionModel>> predecessorsFromActionTemplate)
-
getWorkflowsForTemplateAndUser
public java.util.List<WorkflowModel> getWorkflowsForTemplateAndUser(WorkflowTemplateModel template, UserModel user)
Description copied from interface:WorkflowServiceReturns workflows that was created from giventemplatewhom owner is givenuser.- Specified by:
getWorkflowsForTemplateAndUserin interfaceWorkflowService- Parameters:
template- to be matcheduser- owner of the workflow
-
isTerminated
public boolean isTerminated(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is terminated- Specified by:
isTerminatedin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if terminated, false otherwise
-
createWorkflow
public WorkflowModel createWorkflow(WorkflowTemplateModel template, ItemModel attachmentItem, UserModel owner)
Description copied from interface:WorkflowServiceCreates workflow based on a template and adds an attachment to it. It does not save workflow and actions, please do it by yourself.- Specified by:
createWorkflowin interfaceWorkflowService- Parameters:
template- from which workflow is being createdattachmentItem- to be added- Returns:
- created workflow
-
createWorkflow
public WorkflowModel createWorkflow(java.lang.String workflowName, WorkflowTemplateModel template, java.util.List<ItemModel> itemsToAdd, UserModel owner)
Description copied from interface:WorkflowServiceCreates workflow based on a template and adds an attachment to it. It does not save workflow and actions, please do it by yourself.- Specified by:
createWorkflowin interfaceWorkflowService- Parameters:
workflowName- name of a workflowtemplate- from which workflow is being createditemsToAdd- attachment items to be added- Returns:
- created workflow
-
createWorkflow
public WorkflowModel createWorkflow(WorkflowTemplateModel template, UserModel owner)
Description copied from interface:WorkflowServiceCreates workflow based on a template. It does not save workflow and actions, please do it by yourself.- Specified by:
createWorkflowin interfaceWorkflowService- Parameters:
template- from which workflow is being createdowner- of the workflow- Returns:
- created workflow
-
getAllWorkflows
public java.util.List<WorkflowModel> getAllWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date dateFrom, java.util.Date dateTo)
Description copied from interface:WorkflowServiceReturns workflows that match statuses and time range. Workflow meets the time range when itsItemModel.getModifiedtime()is between givenadhocDateFromandadhocDateTo.- Specified by:
getAllWorkflowsin interfaceWorkflowService- Parameters:
workflowsStatuses- statuses to be matchdateFrom- time range startdateTo- time range end- Returns:
- workflows that match critetia
-
getAllAdhocWorkflows
public java.util.List<WorkflowModel> getAllAdhocWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date adhocDateFrom, java.util.Date adhocDateTo)
Description copied from interface:WorkflowServiceReturns addhoc workflows that match statuses and time range. Workflow meets the time range when itsItemModel.getModifiedtime()is between givenadhocDateFromandadhocDateTo.- Specified by:
getAllAdhocWorkflowsin interfaceWorkflowService- Parameters:
workflowsStatuses- statuses to be matchadhocDateFrom- time range startadhocDateTo- time range end- Returns:
- adhoc workflows that match critetia
-
getAllWorkflows
public SearchResult<WorkflowModel> getAllWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date dateFrom, java.util.Date dateTo, int startIndex, int pageSize)
Description copied from interface:WorkflowServicePageable version of methodWorkflowService.getAllWorkflows(EnumSet, Date, Date)- Specified by:
getAllWorkflowsin interfaceWorkflowService
-
getAllAdhocWorkflows
public SearchResult<WorkflowModel> getAllAdhocWorkflows(java.util.EnumSet<WorkflowStatus> workflowsStatuses, java.util.Date adhocDateFrom, java.util.Date adhocDateTo, int startIndex, int pageSize)
Description copied from interface:WorkflowServicePageable version of methodWorkflowService.getAllAdhocWorkflows(EnumSet, Date, Date)- Specified by:
getAllAdhocWorkflowsin interfaceWorkflowService
-
isPlanned
public boolean isPlanned(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is planned- Specified by:
isPlannedin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if planned, false otherwise
-
isRunning
public boolean isRunning(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is running- Specified by:
isRunningin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if running, false otherwise
-
isFinished
public boolean isFinished(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is finished- Specified by:
isFinishedin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if planned, false otherwise
-
isPaused
public boolean isPaused(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is paused- Specified by:
isPausedin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if paused, false otherwise
-
isCompleted
public boolean isCompleted(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is completed- Specified by:
isCompletedin interfaceWorkflowService- Parameters:
workflowModel- to check- Returns:
- true if completed, false otherwise
-
getWorkAction
protected WorkflowActionModel getWorkAction(WorkflowActionTemplateModel templateAction, java.util.List<WorkflowActionModel> workflowActions)
-
writeAutomatedComment
public void writeAutomatedComment(WorkflowActionModel action, java.lang.String message, java.lang.String... messageParams)
-
isAdhocWorkflow
public boolean isAdhocWorkflow(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceChecks if workflow is adhoc- Specified by:
isAdhocWorkflowin interfaceWorkflowService- Parameters:
workflowModel- to check
-
canBeStarted
public boolean canBeStarted(WorkflowModel workf)
Description copied from interface:WorkflowServiceChecks if workflow can be started- Specified by:
canBeStartedin interfaceWorkflowService- Parameters:
workf- to check- Returns:
- true if can be started, false otherwise
-
getStartTime
public java.util.Date getStartTime(WorkflowModel workflow)
Description copied from interface:WorkflowServiceGets start time from a workflow- Specified by:
getStartTimein interfaceWorkflowService- Returns:
- start date of workflow
-
createAdhocWorkflow
public WorkflowModel createAdhocWorkflow(java.lang.String defaultName, java.util.List<ItemModel> itemsToAdd, UserModel owner)
Description copied from interface:WorkflowServiceCreates adhoc workflow with a name and adds an attachment to it. This method does not save workflow, do it by yourself.- Specified by:
createAdhocWorkflowin interfaceWorkflowService- Parameters:
defaultName- name of a workflowitemsToAdd- attachment items to be addedowner- of the workflow- Returns:
- created workflow
-
assignUser
public boolean assignUser(PrincipalModel principalModel, WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceAssigns principal to workflow. This action does not save workflow, please do it by yourself.- Specified by:
assignUserin interfaceWorkflowService- Parameters:
principalModel- to be assigned to workflow
-
unassignUser
public boolean unassignUser(WorkflowModel workflowModel)
Description copied from interface:WorkflowServiceUnassigns principal from workflow and assign dummy user- Specified by:
unassignUserin interfaceWorkflowService
-
getWorkflowForCode
public WorkflowModel getWorkflowForCode(java.lang.String code)
Description copied from interface:WorkflowServiceReturns workflow for a given code- Specified by:
getWorkflowForCodein interfaceWorkflowService
-
setModelService
public void setModelService(ModelService modelService)
- Parameters:
modelService- the modelService to set
-
setWorkflowActionService
public void setWorkflowActionService(WorkflowActionService workflowActionService)
- Parameters:
workflowActionService- the workflowActionService to set
-
setWorkflowDao
public void setWorkflowDao(WorkflowDao workflowDao)
- Parameters:
workflowDao- the workflowDao to set
-
setWorkflowTemplateService
public void setWorkflowTemplateService(WorkflowTemplateService workflowTemplateService)
- Parameters:
workflowTemplateService- the workflowTemplateService to set
-
-