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

Class WorkflowEngine

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

Constructors

| Improve this Doc View Source

WorkflowEngine()

Initializes a new instance of the WorkflowEngine class.

Declaration
public WorkflowEngine()

Methods

| Improve this Doc View Source

CompleteState(StateTransaction)

This method completes a state moving the workflow forward to the next state. If the next state is not the last one it send notifications to the reviewers of the next state, otherwise send the notification to the user that submit the draft in case the workflow complete.

Declaration
public void CompleteState(StateTransaction stateTransaction)
Parameters
Type Name Description
StateTransaction stateTransaction

State transaction Dto.

Exceptions
Type Condition
WorkflowConcurrencyException

Thrown when the current state of the workflow is not the same of the current state specified in the StateTransaction Dto.

WorkflowSecurityException

Thrown when the user does not have review permission on the current state.

| Improve this Doc View Source

CompleteWorkflow(StateTransaction)

This method completes the workflow no matter what is the current state. It also sends a system notification to the user that submit the workflow to let him know about the complete workflow action.

Declaration
public void CompleteWorkflow(StateTransaction stateTransaction)
Parameters
Type Name Description
StateTransaction stateTransaction

State transaction Dto.

Remarks

This method does not check review permission on the current state.

Exceptions
Type Condition
WorkflowConcurrencyException

Thrown when the current state of the workflow is not the same of the current state specified in the StateTransaction Dto.

| Improve this Doc View Source

DiscardState(StateTransaction)

This method discard a state moving the workflow backward to the previous state. If the previous state is not the first one it send notifications to the reviewers of the previous state, otherwise send the notification to the user that submit the draft in case the workflow is in the draft state.

Declaration
public void DiscardState(StateTransaction stateTransaction)
Parameters
Type Name Description
StateTransaction stateTransaction

State transaction Dto.

Exceptions
Type Condition
WorkflowConcurrencyException

Thrown when the current state of the workflow is not the same of the current state specified in the StateTransaction Dto.

WorkflowSecurityException

Thrown when the user does not have review permission on the current state.

WorkflowInvalidOperationException

Thrown when trying to discard a workflow in the last state.

| Improve this Doc View Source

DiscardWorkflow(StateTransaction)

This method discards the workflow no matter what is the current state. It also sends a system notification to the user that submit the workflow to let him know about the discard workflow action.

Declaration
public void DiscardWorkflow(StateTransaction stateTransaction)
Parameters
Type Name Description
StateTransaction stateTransaction

State transaction Dto.

Remarks

This method does not check review permission on the current state.

Exceptions
Type Condition
WorkflowConcurrencyException

Thrown when the current state of the workflow is not the same of the current state specified in the StateTransaction Dto.

| Improve this Doc View Source

GetFactory()

Gets the service locator factory.

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

A factory function.

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

GetStartedDraftStateUser(ContentItem)

This method returns the user that started the workflow for the contentItem.

Declaration
public UserInfo GetStartedDraftStateUser(ContentItem contentItem)
Parameters
Type Name Description
ContentItem contentItem

ContentItem.

Returns
Type Description
UserInfo

User Info.

Remarks

If Content Item has no workflow, returns null.

| Improve this Doc View Source

GetSubmittedDraftStateUser(ContentItem)

This method returns the user that submitted the contentItem.

Declaration
public UserInfo GetSubmittedDraftStateUser(ContentItem contentItem)
Parameters
Type Name Description
ContentItem contentItem

ContentItem.

Returns
Type Description
UserInfo

User Info.

Remarks

If Content Item has no workflow or the content has not submitted yet, returns null.

| Improve this Doc View Source

IsWorkflowCompleted(ContentItem)

This method returns true if the workflow associated to the Content Item is completed (it is in the last state).

Declaration
public bool IsWorkflowCompleted(ContentItem contentItem)
Parameters
Type Name Description
ContentItem contentItem

Content item entity.

Returns
Type Description
System.Boolean

True if the workflow is completed, false otherwise.

Remarks

Content Item without workflow is considered as completed as well.

| Improve this Doc View Source

IsWorkflowCompleted(Int32)

This method returns true if the workflow associated to the Content Item is completed (it is in the last state).

Declaration
public bool IsWorkflowCompleted(int contentItemId)
Parameters
Type Name Description
System.Int32 contentItemId

Content item Id.

Returns
Type Description
System.Boolean

True if the workflow is completed, false otherwise.

Remarks

Content Item without workflow is considered as completed as well.

| Improve this Doc View Source

IsWorkflowOnDraft(ContentItem)

This method returns true if the workflow associated to the Content Item is in draft (it is in the first state).

Declaration
public bool IsWorkflowOnDraft(ContentItem contentItem)
Parameters
Type Name Description
ContentItem contentItem

Content item entity.

Returns
Type Description
System.Boolean

True if the workflow is in draft, false otherwise.

Remarks

Content Item without workflow is considered as not in draft.

| Improve this Doc View Source

IsWorkflowOnDraft(Int32)

This method returns true if the workflow associated to the Content Item is in draft (it is in the first state).

Declaration
public bool IsWorkflowOnDraft(int contentItemId)
Parameters
Type Name Description
System.Int32 contentItemId

Content item Id.

Returns
Type Description
System.Boolean

True if the workflow is in draft, false otherwise.

Remarks

Content Item without workflow is considered as not in draft.

| Improve this Doc View Source

StartWorkflow(Int32, Int32, Int32)

This method starts a workflow for a Content Item.

Declaration
public void StartWorkflow(int workflowId, int contentItemId, int userId)
Parameters
Type Name Description
System.Int32 workflowId

Workflow Id.

System.Int32 contentItemId

Content item Id.

System.Int32 userId

User Id of the user that start the workflow.

Exceptions
Type Condition
WorkflowInvalidOperationException

Thrown when start a workflow on a Content Item that already has a started workflow.

Implements

IWorkflowEngine

Extension Methods

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