Class Workflow
The Workflow class represents an immutable series of states and transitions describing a moderation strategy.
Inheritance
Inherited Members
Namespace: EPiServer.Social.Moderation.Core
Assembly: EPiServer.Social.Moderation.Core.dll
Version: 1.5.4Syntax
public class Workflow
Constructors
Workflow(WorkflowId, String, IEnumerable<WorkflowTransition>, WorkflowState)
Constructor
Declaration
public Workflow(WorkflowId id, string name, IEnumerable<WorkflowTransition> transitions, WorkflowState initialState)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | id | Identifier for this workflow |
| System.String | name | Name describing the workflow |
| System.Collections.Generic.IEnumerable<WorkflowTransition> | transitions | Collection of transitions comprising this workflow |
| WorkflowState | initialState | The start state for this workflow |
Workflow(WorkflowId, String, IEnumerable<WorkflowTransition>, WorkflowState, IEnumerable<TransitionSessionToken>)
Constructor
Declaration
public Workflow(WorkflowId id, string name, IEnumerable<WorkflowTransition> transitions, WorkflowState initialState, IEnumerable<TransitionSessionToken> transitionSessions)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | id | Identifier for this workflow |
| System.String | name | Name describing the workflow |
| System.Collections.Generic.IEnumerable<WorkflowTransition> | transitions | Collection of transitions comprising this workflow |
| WorkflowState | initialState | The start state for this workflow |
| System.Collections.Generic.IEnumerable<TransitionSessionToken> | transitionSessions | Collection of tokens describing sessions in which exclusive access to a particular target has been granted |
Workflow(String, IEnumerable<WorkflowTransition>, WorkflowState)
Constructor
Declaration
public Workflow(string name, IEnumerable<WorkflowTransition> transitions, WorkflowState initialState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name describing the workflow |
| System.Collections.Generic.IEnumerable<WorkflowTransition> | transitions | Collection of transitions comprising this workflow |
| WorkflowState | initialState | The start state for this workflow |
Properties
Id
Gets the unique identifier for this workflow.
Declaration
public WorkflowId Id { get; }
Property Value
| Type | Description |
|---|---|
| WorkflowId |
InitialState
Gets the start state for this workflow.
Declaration
public WorkflowState InitialState { get; }
Property Value
| Type | Description |
|---|---|
| WorkflowState | State representing the starting state for this workflow |
Name
Gets the name for this workflow.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Transitions
Gets the collection of transitions comprising this workflow. Transitions describe the action require to move from one state to another within the workflow.
Declaration
public IReadOnlyCollection<WorkflowTransition> Transitions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<WorkflowTransition> |
TransitionSessions
Gets a collection of tokens describing sessions, in which exclusive access to a particular target of moderation has been granted.
Declaration
public IReadOnlyCollection<TransitionSessionToken> TransitionSessions { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<TransitionSessionToken> |
Methods
ActionsFor(WorkflowState)
Returns a collection of names representing the actions available to advance an item within the workflow given the specified state.
Declaration
public IEnumerable<WorkflowAction> ActionsFor(WorkflowState state)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowState | state | Workflow state for which actions should be retrieved |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<WorkflowAction> | Collection of names representing the actions available in the given state |
HasState(WorkflowState)
Checks if the specified state is one that exists within this workflow.
Declaration
public bool HasState(WorkflowState state)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowState | state | State to match in this workflow. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the specified state is one that exists within this workflow, false otherwise |
Transition(WorkflowState, WorkflowAction)
Returns the resulting state to which an item in the specified state will transition when the specified action is applied.
Declaration
public WorkflowState Transition(WorkflowState state, WorkflowAction action)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowState | state | State in which an action will be taken |
| WorkflowAction | action | Action to be applied |
Returns
| Type | Description |
|---|---|
| WorkflowState | Resulting state when the specified action is applied |