Package com.hybris.backoffice.workflow
Interface CoreWorkflowFacade
-
- All Known Subinterfaces:
WorkflowFacade
- All Known Implementing Classes:
DefaultCoreWorkflowFacade,DefaultWorkflowFacade
public interface CoreWorkflowFacadeFacade 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 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.WorkflowModelcreateWorkflow(java.lang.String name, WorkflowTemplateModel template, java.util.List<ItemModel> itemsToAdd, UserModel owner)Creates an instance ofWorkflowModelwith given name, template, attached items and user.WorkflowTemplateModelgetAdHocWorkflowTemplate()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.DategetWorkflowStartTime(WorkflowModel workflow)Returns start time of given workflow.WorkflowStatusgetWorkflowStatus(WorkflowModel workflowModel)ChecksWorkflowStatusof workflow modelWorkflowTemplateModelgetWorkflowTemplateForCode(java.lang.String code)LoadsWorkflowTemplateModelby 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, java.util.List<WorkflowItemAttachmentModel> itemsToRemove)Removes attachments from a workflowbooleanstartWorkflow(WorkflowModel workflow)Starts given workflowbooleanterminateWorkflow(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-WorkflowModelwhich contains given attachmentsitemsToRemove-WorkflowItemAttachmentModels to remove
-
getWorkflowTemplateForCode
WorkflowTemplateModel getWorkflowTemplateForCode(java.lang.String code)
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(java.lang.String name, WorkflowTemplateModel template, java.util.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
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)
ChecksWorkflowStatusof workflow model- Parameters:
workflowModel- model of workflow- Returns:
- status of workflow or
nullif 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.
-
-