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
Modifier and TypeMethodDescriptionaddItems(WorkflowModel workflow, List<? extends ItemModel> itemsToAdd) Adds items to workflow as an attachmentbooleancanBeStarted(WorkflowModel workflow) Tells if workflow can be started - has assigned users to all actions etc.intcountDecisions(WorkflowModel workflowModel) Counts all decisions to make in all actions of the workflow.createWorkflow(String name, WorkflowTemplateModel template, List<ItemModel> itemsToAdd, UserModel owner) Creates an instance ofWorkflowModelwith given name, template, attached items and user.Gets adHoc workflow template defined for the system.getCurrentTasks(WorkflowModel workflowModel) Gets all WorkflowAction items with statusWorkflowActionStatus.IN_PROGRESS.getWorkflowStartTime(WorkflowModel workflow) Returns start time of given workflow.getWorkflowStatus(WorkflowModel workflowModel) ChecksWorkflowStatusof workflow modelLoadsWorkflowTemplateModelby given code.booleanisAdHocTemplate(WorkflowTemplateModel template) Tells is given template is adHocTemplateWorkflowService.isAdhocWorkflow(WorkflowModel).booleanisCorrectAdHocAssignee(PrincipalModel adHocAssignedUser) Tells if given principal can be assigned to a adHoc template.default voidremoveItems(WorkflowModel workflow, List<WorkflowItemAttachmentModel> itemsToRemove) Removes attachments from a workflowbooleanstartWorkflow(WorkflowModel workflow) Starts given workflowbooleanterminateWorkflow(WorkflowModel workflow) Terminates given workflow
-
Method Details
-
addItems
List<WorkflowItemAttachmentModel> addItems(WorkflowModel workflow, 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
Removes attachments from a workflow- Parameters:
workflow-WorkflowModelwhich contains given attachmentsitemsToRemove-WorkflowItemAttachmentModels to remove
-
getWorkflowTemplateForCode
LoadsWorkflowTemplateModelby given code.- Parameters:
code- code of theWorkflowTemplateModelto be loaded- Returns:
WorkflowTemplateModelinstance 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(String name, WorkflowTemplateModel template, List<ItemModel> itemsToAdd, UserModel owner) Creates an instance ofWorkflowModelwith given name, template, attached items and user.- Parameters:
name- name of the workflowtemplate-WorkflowTemplateModelto be useditemsToAdd- item to be added to the workflowowner- owner of the workflow- Returns:
WorkflowModelbased on the given arguments
-
startWorkflow
Starts given workflow- Parameters:
workflow- workflow to start- Returns:
- true if workflow has been started.
-
canBeStarted
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
Tells is given template is adHocTemplateWorkflowService.isAdhocWorkflow(WorkflowModel).- Parameters:
template- template to be checked.- Returns:
- true if the template is adHocTemplate.
-
isCorrectAdHocAssignee
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
ChecksWorkflowStatusof workflow model- Parameters:
workflowModel- model of workflow- Returns:
- status of workflow or
nullif it was impossible to determine
-
terminateWorkflow
Terminates given workflow- Parameters:
workflow- workflow to terminate- Returns:
- true if workflow has been terminated.
-
getCurrentTasks
Gets all WorkflowAction items with statusWorkflowActionStatus.IN_PROGRESS.- Parameters:
workflowModel- workflow to check.- Returns:
- all WorkflowAction items in progress.
-
countDecisions
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
Returns start time of given workflow.- Parameters:
workflow- workflow to check.- Returns:
- start time of given workflow.
-