• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class WorkflowStateManager

Inheritance
System.Object
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>
WorkflowStateManager
Implements
IWorkflowStateManager
Inherited Members
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>.Instance
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>.Factory
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>.SetTestableInstance(IWorkflowStateManager)
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>.ClearInstance()
ServiceLocator<IWorkflowStateManager, WorkflowStateManager>.GetFactory()
Namespace: DotNetNuke.Entities.Content.Workflow
Assembly: DotNetNuke.dll
Syntax
public class WorkflowStateManager : ServiceLocator<IWorkflowStateManager, WorkflowStateManager>, IWorkflowStateManager

Constructors

| Improve this Doc View Source

WorkflowStateManager()

Initializes a new instance of the WorkflowStateManager class.

Declaration
public WorkflowStateManager()

Methods

| Improve this Doc View Source

AddWorkflowState(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

GetFactory()

Gets the service locator factory.

Declaration
protected override Func<IWorkflowStateManager> GetFactory()
Returns
Type Description
Func<IWorkflowStateManager>

A factory function.

Overrides
DotNetNuke.Framework.ServiceLocator<DotNetNuke.Entities.Content.Workflow.IWorkflowStateManager, DotNetNuke.Entities.Content.Workflow.WorkflowStateManager>.GetFactory()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

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...)

| Improve this Doc View Source

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...)

| Improve this Doc View Source

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.

Implements

IWorkflowStateManager

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS