Class WorkflowManager
Implements
Inherited Members
Namespace: DotNetNuke.Entities.Content.Workflow
Assembly: DotNetNuke.dll
Syntax
public class WorkflowManager : ServiceLocator<IWorkflowManager, WorkflowManager>, IWorkflowManager
Constructors
| Improve this Doc View SourceWorkflowManager()
Initializes a new instance of the WorkflowManager class.
Declaration
public WorkflowManager()
Methods
| Improve this Doc View SourceAddWorkflow(Workflow)
This method adds a new workflow. It automatically add two system states: "Draft" and "Published".
Declaration
public 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
public 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. |
GetFactory()
Gets the service locator factory.
Declaration
protected override System.Func<IWorkflowManager> GetFactory()
Returns
Type | Description |
---|---|
System.Func<IWorkflowManager> | A factory function. |
Overrides
GetWorkflow(ContentItem)
This method returns a workflow entity by Content Item Id. It returns null if the Content Item is not under workflow.
Declaration
public 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
public 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
public 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
public 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
public 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
public 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. |