Package com.hybris.backoffice.workflow
Interface CoreWorkflowFacade
-
- All Known Subinterfaces:
WorkflowFacade
- All Known Implementing Classes:
DefaultCoreWorkflowFacade
,DefaultWorkflowFacade
public interface CoreWorkflowFacade
Facade to handle core workflow functionality (independent of the web context)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<WorkflowItemAttachmentModel>
addItems(WorkflowModel workflow, java.util.List<? extends ItemModel> itemsToAdd)
Adds items to workflow as an attachmentboolean
canBeStarted(WorkflowModel workflow)
Tells if workflow can be started - has assigned users to all actions etc.int
countDecisions(WorkflowModel workflowModel)
Counts all decisions to make in all actions of the workflow.WorkflowModel
createWorkflow(java.lang.String name, WorkflowTemplateModel template, java.util.List<ItemModel> itemsToAdd, UserModel owner)
Creates an instance ofWorkflowModel
with given name, template, attached items and user.WorkflowTemplateModel
getAdHocWorkflowTemplate()
Gets adHoc workflow template defined for the system.java.util.List<WorkflowActionModel>
getCurrentTasks(WorkflowModel workflowModel)
Gets all WorkflowAction items with statusWorkflowActionStatus.IN_PROGRESS
.java.util.Date
getWorkflowStartTime(WorkflowModel workflow)
Returns start time of given workflow.WorkflowStatus
getWorkflowStatus(WorkflowModel workflowModel)
ChecksWorkflowStatus
of workflow modelWorkflowTemplateModel
getWorkflowTemplateForCode(java.lang.String code)
LoadsWorkflowTemplateModel
by given code.boolean
isAdHocTemplate(WorkflowTemplateModel template)
Tells is given template is adHocTemplateWorkflowService.isAdhocWorkflow(WorkflowModel)
.boolean
isCorrectAdHocAssignee(PrincipalModel adHocAssignedUser)
Tells if given principal can be assigned to a adHoc template.default void
removeItems(WorkflowModel workflow, java.util.List<WorkflowItemAttachmentModel> itemsToRemove)
Removes attachments from a workflowboolean
startWorkflow(WorkflowModel workflow)
Starts given workflowboolean
terminateWorkflow(WorkflowModel workflow)
Terminates given workflow
-
-
-
Method Detail
-
addItems
java.util.List<WorkflowItemAttachmentModel> addItems(WorkflowModel workflow, java.util.List<? extends ItemModel> itemsToAdd)
Adds items to workflow as an attachment- Parameters:
workflow
- to which items should be addeditemsToAdd
- items to add- Returns:
- attachments
-
removeItems
default void removeItems(WorkflowModel workflow, java.util.List<WorkflowItemAttachmentModel> itemsToRemove)
Removes attachments from a workflow- Parameters:
workflow
-WorkflowModel
which contains given attachmentsitemsToRemove
-WorkflowItemAttachmentModel
s to remove
-
getWorkflowTemplateForCode
WorkflowTemplateModel getWorkflowTemplateForCode(java.lang.String code)
LoadsWorkflowTemplateModel
by given code.- Parameters:
code
- code of theWorkflowTemplateModel
to be loaded- Returns:
WorkflowTemplateModel
instance or null if the implementation cannot find appropriateWorkflowTemplateModel
-
getAdHocWorkflowTemplate
WorkflowTemplateModel getAdHocWorkflowTemplate()
Gets adHoc workflow template defined for the system.WorkflowTemplateService.getAdhocWorkflowTemplate()
- Returns:
- adHoc workflow template.
-
createWorkflow
WorkflowModel createWorkflow(java.lang.String name, WorkflowTemplateModel template, java.util.List<ItemModel> itemsToAdd, UserModel owner)
Creates an instance ofWorkflowModel
with given name, template, attached items and user.- Parameters:
name
- name of the workflowtemplate
-WorkflowTemplateModel
to be useditemsToAdd
- item to be added to the workflowowner
- owner of the workflow- Returns:
WorkflowModel
based on the given arguments
-
startWorkflow
boolean startWorkflow(WorkflowModel workflow)
Starts given workflow- Parameters:
workflow
- workflow to start- Returns:
- true if workflow has been started.
-
canBeStarted
boolean canBeStarted(WorkflowModel workflow)
Tells if workflow can be started - has assigned users to all actions etc.WorkflowService.canBeStarted(WorkflowModel)
- Parameters:
workflow
- workflow to be started- Returns:
- true if workflow can be started.
-
isAdHocTemplate
boolean isAdHocTemplate(WorkflowTemplateModel template)
Tells is given template is adHocTemplateWorkflowService.isAdhocWorkflow(WorkflowModel)
.- Parameters:
template
- template to be checked.- Returns:
- true if the template is adHocTemplate.
-
isCorrectAdHocAssignee
boolean isCorrectAdHocAssignee(PrincipalModel adHocAssignedUser)
Tells if given principal can be assigned to a adHoc template. It cannot beWorkflowTemplateService.getAdhocWorkflowTemplateDummyOwner()
- Parameters:
adHocAssignedUser
- user to be verified if can be assigned to an adHoc template- Returns:
- true if given principal can be assigned to an adHoc template.
-
getWorkflowStatus
WorkflowStatus getWorkflowStatus(WorkflowModel workflowModel)
ChecksWorkflowStatus
of workflow model- Parameters:
workflowModel
- model of workflow- Returns:
- status of workflow or
null
if it was impossible to determine
-
terminateWorkflow
boolean terminateWorkflow(WorkflowModel workflow)
Terminates given workflow- Parameters:
workflow
- workflow to terminate- Returns:
- true if workflow has been terminated.
-
getCurrentTasks
java.util.List<WorkflowActionModel> getCurrentTasks(WorkflowModel workflowModel)
Gets all WorkflowAction items with statusWorkflowActionStatus.IN_PROGRESS
.- Parameters:
workflowModel
- workflow to check.- Returns:
- all WorkflowAction items in progress.
-
countDecisions
int countDecisions(WorkflowModel workflowModel)
Counts all decisions to make in all actions of the workflow.- Parameters:
workflowModel
- workflow to check.- Returns:
- all decisions to make in all actions of the workflow
-
getWorkflowStartTime
java.util.Date getWorkflowStartTime(WorkflowModel workflow)
Returns start time of given workflow.- Parameters:
workflow
- workflow to check.- Returns:
- start time of given workflow.
-
-