Workflow
Workflow in Bloomreach Content is integrated with content management. A workflow consists of workflow actions. Each workflow action modifies a document, folder, or other node. Actions include editing content, publishing, reviewing, creating, deleting, or moving a document. Any change to the state of a document or folder occurs through a workflow action. You can define what constitutes the state of a document by adding properties to its document type.
Workflow actions are only available for documents in specific states and may be restricted based on user permissions.
Accessing Workflow
To execute a workflow action, first obtain a workflow instance using the workflow manager:
WorkflowManager wflManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager(); Workflow workflow = wflManager.getWorkflow( String workflowCategory, Node nodeToChange );
The getWorkflow method requires the workflow category name and the node to modify (such as a document or folder). The workflow manager evaluates each entry in the specified category and returns the first workflow allowed for the provided node.
The returned workflow instance matches the (custom) workflow implementation defined in the category entry. If you add a workflow to an existing category, be aware that a different workflow implementation may be returned than expected. To confirm the workflow type, use an instanceof check:
if (workflow instanceof FeaturedWorkflow)
Always cast the workflow to your specific type before invoking custom methods:
FeaturedWorkflow featuredWorkflow = (FeaturedWorkflow) workflow; featuredWorkflow.feature();