Class WorkflowStateManager
Inheritance
Implements
Inherited Members
Namespace: DotNetNuke.Entities.Content.Workflow
Assembly: DotNetNuke.dll
Syntax
public class WorkflowStateManager : ServiceLocator<IWorkflowStateManager, WorkflowStateManager>, IWorkflowStateManager
Constructors
| Improve this Doc View SourceWorkflowStateManager()
Initializes a new instance of the WorkflowStateManager class.
Declaration
public WorkflowStateManager()
Methods
| Improve this Doc View SourceAddWorkflowState(WorkflowState)
This method adds a new State to a workflow. The new state is always added as next to last state.
Declaration
public void AddWorkflowState(WorkflowState state)
Parameters
Type | Name | Description |
---|---|---|
WorkflowState | state | State entity. |
Remarks
This method also takes care on state reordering.
Exceptions
Type | Condition |
---|---|
WorkflowDoesNotExistException | Thrown when adding a state to a workflow that does not exist. |
WorkflowInvalidOperationException | Thrown when adding a state to a system workflow. |
WorkflowStateNameAlreadyExistsException | Thrown when already exist a state in the workflow with the same name. |
AddWorkflowStatePermission(WorkflowStatePermission, Int32)
This method add a new workflow state permission.
Declaration
public void AddWorkflowStatePermission(WorkflowStatePermission permission, int userId)
Parameters
Type | Name | Description |
---|---|---|
WorkflowStatePermission | permission | Permission. |
System.Int32 | userId | User Id of the user that perform the action. |
DeleteWorkflowState(WorkflowState)
This method hard deletes a state.
Declaration
public void DeleteWorkflowState(WorkflowState state)
Parameters
Type | Name | Description |
---|---|---|
WorkflowState | state | State entity. |
Remarks
This method takes care of state reordering.
Exceptions
Type | Condition |
---|---|
WorkflowInvalidOperationException | Thrown when deleting a system state workflow (i.e.: Draft, Published) or if the workflow state is beign used. |
DeleteWorkflowStatePermission(Int32)
This method deletes a workflow state permission by Id.
Declaration
public void DeleteWorkflowStatePermission(int workflowStatePermissionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | workflowStatePermissionId | Workflow state permission Id. |
GetContentWorkflowStateUsageCount(Int32)
This method returns the total number of Content Items that are associated with the State.
Declaration
public int GetContentWorkflowStateUsageCount(int stateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
Returns
Type | Description |
---|---|
System.Int32 | Total count of Content Items that are using the specified state. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<IWorkflowStateManager> GetFactory()
Returns
Type | Description |
---|---|
Func<IWorkflowStateManager> | A factory function. |
Overrides
GetWorkflowState(Int32)
This method returns a workflow State by Id.
Declaration
public WorkflowState GetWorkflowState(int stateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
Returns
Type | Description |
---|---|
WorkflowState | State entity. |
GetWorkflowStatePermissionByState(Int32)
This method returns the list of State Permission of a specific state.
Declaration
public IEnumerable<WorkflowStatePermission> GetWorkflowStatePermissionByState(int stateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
Returns
Type | Description |
---|---|
IEnumerable<WorkflowStatePermission> | List of state permissions. |
GetWorkflowStates(Int32)
This method returns the list of States of a Workflow ordered by State Order ascending.
Declaration
public IEnumerable<WorkflowState> GetWorkflowStates(int workflowId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | workflowId | Workflow Id. |
Returns
Type | Description |
---|---|
IEnumerable<WorkflowState> | List of workflow States ordered by State Order ascending. |
MoveState(Int32, Int32)
This method move the state up to index position in the workflow state order.
Declaration
public void MoveState(int stateId, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
System.Int32 | index | Index where the stateId will be moved. Since first and last states can't be moved, this index has to be a number between 1 and the number of states minus 2. |
Remarks
This method takes care of state reordering.
Exceptions
Type | Condition |
---|---|
WorkflowDoesNotExistException | Thrown when moving a state that does not exist. |
WorkflowInvalidOperationException | Thrown when state cannot be moved (i.e.: is the first/last state, etc...) |
WorkflowInvalidOperationException | Thrown when index is not a valid value (index = 0 or index >= number of states - 2). |
MoveWorkflowStateDown(Int32)
This method move the state down to 1 position in the workflow state order.
Declaration
public void MoveWorkflowStateDown(int stateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
Remarks
This method takes care of state reordering.
Exceptions
Type | Condition |
---|---|
WorkflowDoesNotExistException | Thrown when moving a state that does not exist. |
WorkflowInvalidOperationException | Thrown when state cannot be moved (i.e.: is the first/last state, etc...) |
MoveWorkflowStateUp(Int32)
This method move the state up to 1 position in the workflow state order.
Declaration
public void MoveWorkflowStateUp(int stateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | stateId | State Id. |
Remarks
This method takes care of state reordering.
Exceptions
Type | Condition |
---|---|
WorkflowDoesNotExistException | Thrown when moving a state that does not exist. |
WorkflowInvalidOperationException | Thrown when state cannot be moved (i.e.: is the first/last state, etc...) |
UpdateWorkflowState(WorkflowState)
This method updates a State.
Declaration
public void UpdateWorkflowState(WorkflowState state)
Parameters
Type | Name | Description |
---|---|---|
WorkflowState | state | State entity. |
Remarks
This method does not update the Order of the state. Use MoveWorkflowStateDown and MoveWorkflowStateUp for this operation.
Exceptions
Type | Condition |
---|---|
WorkflowDoesNotExistException | Thrown when updating a state that does not exist. |
WorkflowStateNameAlreadyExistsException | Thrown when already exist a state in the workflow with the same name. |