Interface IWorkflowManager
This class is responsible to manage the workflows of the portal. It provides CRUD operation methods and methods to know the usage of the workflow.
Namespace: DotNetNuke.Entities.Content.Workflow
Assembly: DotNetNuke.dll
Syntax
public interface IWorkflowManager
Methods
| Improve this Doc View SourceAddWorkflow(Workflow)
This method adds a new workflow. It automatically add two system states: "Draft" and "Published".
Declaration
void AddWorkflow(Workflow workflow)
Parameters
Type | Name | Description |
---|---|---|
Workflow | workflow | Workflow Entity. |
Exceptions
Type | Condition |
---|---|
WorkflowNameAlreadyExistsException | Thrown when a workflow with the same name already exist for the portal. |
DeleteWorkflow(Workflow)
This method hard deletes a workflow.
Declaration
void DeleteWorkflow(Workflow workflow)
Parameters
Type | Name | Description |
---|---|---|
Workflow | workflow | Workflow Entity. |
Exceptions
Type | Condition |
---|---|
WorkflowInvalidOperationException | Thrown when a workflow is in use or is a system workflow. |
GetWorkflow(ContentItem)
This method returns a workflow entity by Content Item Id. It returns null if the Content Item is not under workflow.
Declaration
Workflow GetWorkflow(ContentItem contentItem)
Parameters
Type | Name | Description |
---|---|---|
ContentItem | contentItem | Content Item. |
Returns
Type | Description |
---|---|
Workflow | Workflow Entity. |
GetWorkflow(Int32)
This method returns a workflow entity by Id.
Declaration
Workflow GetWorkflow(int workflowId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | workflowId | Workflow Id. |
Returns
Type | Description |
---|---|
Workflow | Workflow Entity. |
GetWorkflows(Int32)
This method return the list of the Workflows defined for the portal.
Declaration
IEnumerable<Workflow> GetWorkflows(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Portal Id. |
Returns
Type | Description |
---|---|
IEnumerable<Workflow> | List of the Workflows for the portal. |
GetWorkflowUsage(Int32, Int32, Int32)
This method returns the paginated list of Items that are associated with a workflow.
Declaration
IEnumerable<WorkflowUsageItem> GetWorkflowUsage(int workflowId, int pageIndex, int pageSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | workflowId | Workflow Id. |
System.Int32 | pageIndex | Page index (where 1 is the index of the first page). |
System.Int32 | pageSize | Page size. |
Returns
Type | Description |
---|---|
IEnumerable<WorkflowUsageItem> | List of Usage Items. |
GetWorkflowUsageCount(Int32)
This method returns the total number of Content Items that are associated with any State of a workflow (even the Published state).
Declaration
int GetWorkflowUsageCount(int workflowId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | workflowId | Workflow Id. |
Returns
Type | Description |
---|---|
System.Int32 | Total count of Content Items that are using the specified workflow. |
UpdateWorkflow(Workflow)
this method update a existing workflow.
Declaration
void UpdateWorkflow(Workflow workflow)
Parameters
Type | Name | Description |
---|---|---|
Workflow | workflow | Workflow Entity. |
Exceptions
Type | Condition |
---|---|
WorkflowNameAlreadyExistsException | Thrown when a workflow with the same name already exist for the portal. |