com.ibm.workplace.wcm.api
Interface Workflow

All Superinterfaces:
Document, Editable, EditableItem, Item, Localized, WCMApiObject

public interface Workflow
extends Editable

Represents a workflow.

A Workflow consists of WorkflowStages in a specific order. Workflowing controls access to and manages the progression of WCM objects through the specified WorkflowStages.

See Also:
WorkflowStage

Nested Class Summary
static class Workflow.DraftCreationBehavior
          The Workflow.DraftCreationBehavior controls how items using the Workflow can create new drafts
 
Method Summary
 Workflow.DraftCreationBehavior getDraftCreationBehavior()
          Returns the Workflow.DraftCreationBehavior for this Workflow.
 int getNumStages()
          Returns the number of stages in this Workflow.
 DocumentId getRejectStageId()
          Returns the DocumentId of the WorkflowStage documents will be placed into if they fail approval
 DocumentIdIterator getStagesIterator()
          Returns an iterator of DocumentId objects of the WorkflowStages in this Workflow.
 DocumentId getTargetStageIdForProjectItems()
          Returns the DocumentId of the WorkflowStage that documents will be placed into when the project they are associated with publishes
 boolean isCommentRequiredOnApproval()
          Indicates if a comment is required on approval
 boolean isWorkflowDisabledInProjects()
          Indicates if this workflow is disabled for items in projects
 void setCommentRequiredOnApproval(boolean commentRequired)
          Specifies whether a comment is required on approval
 void setDraftCreationBehaviour(Workflow.DraftCreationBehavior behavior)
          Sets the Workflow.DraftCreationBehavior for this Workflow.
 void setRejectStageId(DocumentId rejectStageId)
          Specifies the DocumentId of the WorkflowStage documents will be placed into if they fail approval
 void setStages(java.util.List<WorkflowStage> workflowStages)
          Sets the ordered list of WorkflowStage's in this Workflow
 void setStages(WorkflowStage... workflowStages)
          Sets the ordered list of WorkflowStage's in this Workflow
 void setTargetStageIdForProjectItems(DocumentId workflowStageId)
          Sets the DocumentId of the WorkflowStage that documents will be placed into when the project they are associated with publishes AND has the effect of disabling workflow in projects
 
Methods inherited from interface com.ibm.workplace.wcm.api.Editable
addAuthors, addCategoryIds, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addMembersForAccess, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeCategoryIds, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeMembersForAccess, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescriptionTextProviderKey, setDescriptionTextProviderName, setEditorAccessInheritance, setInheritance, setKeywords, setManagerAccessInheritance, setPropagation, setTitleTextProviderKey, setTitleTextProviderName, setUserAccessInheritance
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getCategoryIds, getContributorAccessMembers, getCreator, getDeleteAccessMembers, getDescription, getDescriptionTextProviderKey, getDescriptionTextProviderName, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getKeywords, getLastModifier, getLiveAccessMembers, getManagerAccessMembers, getMembersForAccess, getMembersForInheritedAccess, getOwnerLibrary, getOwners, getProject, getReadAccessMembers, getSourceWorkspace, getTitle, getTitleTextProviderKey, getTitleTextProviderName, getUserAccessMembers, getVersionCatalog, getVersionStrategy, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasProfile, hasProject, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isInherited, isManagerAccessInherited, isNew, isPropagated, isUserAccessInherited, isWorkflowed
 
Methods inherited from interface com.ibm.workplace.wcm.api.Item
getCreationDate, getDescription, getIdentity, getModifiedDate, getName, getTitle
 
Methods inherited from interface com.ibm.portal.Localized
getLocales
 
Methods inherited from interface com.ibm.workplace.wcm.api.EditableItem
setDescription, setName, setTitle
 

Method Detail

getNumStages

int getNumStages()
                 throws com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the number of stages in this Workflow.

Returns:
the number of stages in this Workflow
Throws:
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the number of stages cannot be calculated

getStagesIterator

DocumentIdIterator getStagesIterator()
Returns an iterator of DocumentId objects of the WorkflowStages in this Workflow.

Returns an empty iterator if no workflow stages have been specified.

Returns:
an iterator of DocumentId objects of the WorkflowStages in this Workflow.

setStages

void setStages(WorkflowStage... workflowStages)
Sets the ordered list of WorkflowStage's in this Workflow

Will overwrite the previous list

Parameters:
workflowStages - the workflow stages

setStages

void setStages(java.util.List<WorkflowStage> workflowStages)
Sets the ordered list of WorkflowStage's in this Workflow

Will overwrite the previous list

Parameters:
workflowStages - the workflow stages

getDraftCreationBehavior

Workflow.DraftCreationBehavior getDraftCreationBehavior()
Returns the Workflow.DraftCreationBehavior for this Workflow. This property governs how published or expired items using this Workflow to control the creation of drafts.

Returns:
the current Workflow.DraftCreationBehavior selected for this Workflow

setDraftCreationBehaviour

void setDraftCreationBehaviour(Workflow.DraftCreationBehavior behavior)
Sets the Workflow.DraftCreationBehavior for this Workflow.

Parameters:
behavior - the Workflow.DraftCreationBehavior to set

isCommentRequiredOnApproval

boolean isCommentRequiredOnApproval()
Indicates if a comment is required on approval

Returns:
true if a comment is required on approval, false otherwise

setCommentRequiredOnApproval

void setCommentRequiredOnApproval(boolean commentRequired)
Specifies whether a comment is required on approval

Parameters:
commentRequired - true if a comment should be required, false otherwise

getRejectStageId

DocumentId getRejectStageId()
                            throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                   com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the DocumentId of the WorkflowStage documents will be placed into if they fail approval

Returns:
the DocumentId of the WorkflowStage documents will be placed into if they fail approval or NULL if a reject stage has not been set
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have the appropriate access to the reject workflow stage
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the reject workflow stage id could not be retrieved

setRejectStageId

void setRejectStageId(DocumentId rejectStageId)
                      throws com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException
Specifies the DocumentId of the WorkflowStage documents will be placed into if they fail approval

Parameters:
rejectStageId - the reject stage id. Passing in NULL will clear the reject stage
Throws:
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException - if the supplied DocumentId is not of type DocumentTypes.WorkflowStage

isWorkflowDisabledInProjects

boolean isWorkflowDisabledInProjects()
Indicates if this workflow is disabled for items in projects

To disable workflow in projects, see the setTargetStageIdForProjectItems method

Returns:
true if this workflow is disabled for items in projects, false otherwise
See Also:
setTargetStageIdForProjectItems(com.ibm.workplace.wcm.api.DocumentId)

getTargetStageIdForProjectItems

DocumentId getTargetStageIdForProjectItems()
                                           throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                                  com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the DocumentId of the WorkflowStage that documents will be placed into when the project they are associated with publishes

Returns:
the DocumentId of the WorkflowStage that documents will be placed into when they are added to a project OR NULL if workflow is not disabled in projects
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have the appropriate access to the target workflow stage
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the target workflow stage id could not be retrieved

setTargetStageIdForProjectItems

void setTargetStageIdForProjectItems(DocumentId workflowStageId)
                                     throws com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException,
                                            com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Sets the DocumentId of the WorkflowStage that documents will be placed into when the project they are associated with publishes AND has the effect of disabling workflow in projects

Parameters:
workflowStageId - the DocumentId of the WorkflowStage to set. Passing in NULL will re-enable workflow for projects
Throws:
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException - if the supplied DocumentId is not of type DocumentTypes.WorkflowStage
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the specified WorkflowStage is not in the list of stages for this Workflow