Interface IWorkflowService

The IWorkflowService interface describes a component responsible for facilitating the creation, deletion, and retrieval of moderation workflows.

Namespace: EPiServer.Social.Moderation.Core
Assembly: EPiServer.Social.Moderation.Core.dll
Version: 1.5.4
Syntax
public interface IWorkflowService

Methods

Add(Workflow)

Adds a new moderation workflow.

Declaration
Workflow Add(Workflow workflow)
Parameters
Type Name Description
Workflow workflow

Workflow to be added

Returns
Type Description
Workflow

Workflow which was just added

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Add<TExtension>(Workflow, TExtension)

Adds a new workflow with supporting metadata to form a composite.

Declaration
Composite<Workflow, TExtension> Add<TExtension>(Workflow workflow, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Workflow workflow

Workflow to be added

TExtension extension

Extended data related to the workflow

Returns
Type Description
Composite<Workflow, TExtension>

The workflow composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the workflow

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

AddAsync(Workflow)

Asynchronously adds a new moderation workflow.

Declaration
Task<Workflow> AddAsync(Workflow workflow)
Parameters
Type Name Description
Workflow workflow

Workflow to be added

Returns
Type Description
System.Threading.Tasks.Task<Workflow>

Workflow which was just added

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

AddAsync<TExtension>(Workflow, TExtension)

Asynchronously adds a new workflow with supporting metadata to form a composite.

Declaration
Task<Composite<Workflow, TExtension>> AddAsync<TExtension>(Workflow workflow, TExtension extension)
    where TExtension : class
Parameters
Type Name Description
Workflow workflow

Workflow to be added

TExtension extension

Extended data related to the workflow

Returns
Type Description
System.Threading.Tasks.Task<Composite<Workflow, TExtension>>

The workflow composed with the extended data

Type Parameters
Name Description
TExtension

Type applied as an extension of the workflow

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

BeginTransitionSession(WorkflowId, Reference)

Requests exclusive access to add workflow items for a target within a particular workflow. If another client already has secured access to that target, a TransitionSessionDeniedException will be thrown.

Declaration
TransitionSessionToken BeginTransitionSession(WorkflowId workflow, Reference target)
Parameters
Type Name Description
WorkflowId workflow

Identifies the workflow through which transitions are to occur

Reference target

Identifies the target which is to be transitioned through the workflow

Returns
Type Description
TransitionSessionToken

A TransitionSessionToken authorizing exclusive access to transition a target within a particular workflow. Apply this token when adding workflow items with IWorkflowItemService to ensure that exclusive access is respected.

Exceptions
Type Condition
TransitionSessionDeniedException

Exclusive access for the specified workflow and target combination could not be secured. Access may have already been secured by another client.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

BeginTransitionSessionAsync(WorkflowId, Reference)

Asynchronously requests exclusive access to add workflow items for a target within a particular workflow. If another client already has secured access to that target, a TransitionSessionDeniedException will be thrown.

Declaration
Task<TransitionSessionToken> BeginTransitionSessionAsync(WorkflowId workflow, Reference target)
Parameters
Type Name Description
WorkflowId workflow

Identifies the workflow through which transitions are to occur

Reference target

Identifies the target which is to be transitioned through the workflow

Returns
Type Description
System.Threading.Tasks.Task<TransitionSessionToken>

A TransitionSessionToken authorizing exclusive access to transition a target within a particular workflow. Apply this token when adding workflow items with IWorkflowItemService to ensure that exclusive access is respected.

Exceptions
Type Condition
TransitionSessionDeniedException

Exclusive access for the specified workflow and target combination could not be secured. Access may have already been secured by another client.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

EndTransitionSession(TransitionSessionToken)

Asynchronously ends a transition session, relinquishing exclusive access to add workflow items for a target.

Declaration
void EndTransitionSession(TransitionSessionToken token)
Parameters
Type Name Description
TransitionSessionToken token

Token authorizing exclusive access to a target within a particular workflow

Exceptions
Type Condition
SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

EndTransitionSession(WorkflowId, Reference)

Ends a transition session, relinquishing exclusive access to add workflow items for a target.

Declaration
void EndTransitionSession(WorkflowId workflow, Reference target)
Parameters
Type Name Description
WorkflowId workflow

Identifies the workflow to which access was granted

Reference target

Identifies the target to which access was granted

Exceptions
Type Condition
SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

EndTransitionSessionAsync(TransitionSessionToken)

Asynchronously ends a transition session, relinquishing exclusive access to add workflow items for a target.

Declaration
Task EndTransitionSessionAsync(TransitionSessionToken token)
Parameters
Type Name Description
TransitionSessionToken token

Token authorizing exclusive access to a target within a particular workflow

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

EndTransitionSessionAsync(WorkflowId, Reference)

Asynchronously ends a transition session, relinquishing exclusive access to add workflow items for a target.

Declaration
Task EndTransitionSessionAsync(WorkflowId workflow, Reference target)
Parameters
Type Name Description
WorkflowId workflow

Identifies the workflow to which access was granted

Reference target

Identifies the target to which access was granted

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Get(Criteria<WorkflowFilter>)

Retrieves a page of workflows as specified by the provided criteria.

Declaration
ResultPage<Workflow> Get(Criteria<WorkflowFilter> criteria)
Parameters
Type Name Description
Criteria<WorkflowFilter> criteria

Filters the result set of workflows

Returns
Type Description
ResultPage<Workflow>

Page of workflows filtered according to the specified criteria

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Get(WorkflowId)

Gets a workflow as identified by the specified ID.

Declaration
Workflow Get(WorkflowId id)
Parameters
Type Name Description
WorkflowId id

Workflow identifier

Returns
Type Description
Workflow

Workflow corresponding to the specified ID

Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are invalid.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Get<TExtension>(CompositeCriteria<WorkflowFilter, TExtension>)

Retrieves a page of workflows as specified by the provided criteria. The workflows are filtered by the type of their associated data.

Declaration
ResultPage<Composite<Workflow, TExtension>> Get<TExtension>(CompositeCriteria<WorkflowFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<WorkflowFilter, TExtension> criteria

Filters the result set of workflows

Returns
Type Description
ResultPage<Composite<Workflow, TExtension>>

Page of composite workflows filtered according to the specified criteria

Type Parameters
Name Description
TExtension

Type of data associated with the desired workflows

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Get<TExtension>(WorkflowId)

Gets a workflow composed with associated extension data, as identified by the specified ID.

Declaration
Composite<Workflow, TExtension> Get<TExtension>(WorkflowId id)
    where TExtension : class
Parameters
Type Name Description
WorkflowId id

ID of the workflow to be retrieved

Returns
Type Description
Composite<Workflow, TExtension>

A workflow composed with associated extension data

Type Parameters
Name Description
TExtension

Type of data applied as an extension of the workflow

Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are invalid.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

GetAsync(Criteria<WorkflowFilter>)

Asynchronously retrieves a page of workflows as specified by the provided criteria.

Declaration
Task<ResultPage<Workflow>> GetAsync(Criteria<WorkflowFilter> criteria)
Parameters
Type Name Description
Criteria<WorkflowFilter> criteria

Filters the result set of workflows

Returns
Type Description
System.Threading.Tasks.Task<ResultPage<Workflow>>

Page of workflows filtered according to the specified criteria

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

GetAsync(WorkflowId)

Asynchronously gets a workflow as identified by the specified ID.

Declaration
Task<Workflow> GetAsync(WorkflowId id)
Parameters
Type Name Description
WorkflowId id

Workflow identifier

Returns
Type Description
System.Threading.Tasks.Task<Workflow>

Workflow corresponding to the specified ID

Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are invalid.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

GetAsync<TExtension>(CompositeCriteria<WorkflowFilter, TExtension>)

Asynchronously retrieves a page of workflows as specified by the provided criteria. The workflows are filtered by the type of their associated data.

Declaration
Task<ResultPage<Composite<Workflow, TExtension>>> GetAsync<TExtension>(CompositeCriteria<WorkflowFilter, TExtension> criteria)
    where TExtension : class
Parameters
Type Name Description
CompositeCriteria<WorkflowFilter, TExtension> criteria

Filters the result set of workflows

Returns
Type Description
System.Threading.Tasks.Task<ResultPage<Composite<Workflow, TExtension>>>

Page of composite workflows filtered according to the specified criteria

Type Parameters
Name Description
TExtension

Type of data associated with the desired workflows

Exceptions
Type Condition
System.ArgumentNullException

Thrown when any of the parameters passed in are null.

System.ArgumentException

Thrown when any of the parameters passed in are invalid.

InvalidPageInfoException

Thrown when the page info is invalid.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

GetAsync<TExtension>(WorkflowId)

Asynchronously gets a workflow composed with associated extension data, as identified by the specified ID.

Declaration
Task<Composite<Workflow, TExtension>> GetAsync<TExtension>(WorkflowId id)
    where TExtension : class
Parameters
Type Name Description
WorkflowId id

ID of the workflow to be retrieved

Returns
Type Description
System.Threading.Tasks.Task<Composite<Workflow, TExtension>>

A workflow composed with associated extension data

Type Parameters
Name Description
TExtension

Type of data applied as an extension of the workflow

Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are invalid.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

Remove(WorkflowId)

Removes an existing workflow from the system.

Declaration
void Remove(WorkflowId id)
Parameters
Type Name Description
WorkflowId id

ID of the workflow to be removed

Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are null or invalid.

System.InvalidOperationException

Thrown when workflow items still exist for the workflow being removed.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

RemoveAsync(WorkflowId)

Asynchronously removes an existing workflow from the system.

Declaration
Task RemoveAsync(WorkflowId id)
Parameters
Type Name Description
WorkflowId id

ID of the workflow to be removed

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentException

Thrown when any of the parameters passed in are null or invalid.

System.InvalidOperationException

Thrown when workflow items still exist for the workflow being removed.

WorkflowDoesNotExistException

Thrown when the identified workflow does not exist.

SocialException

Thrown when an error occurs while processing the request.

SocialAuthenticationException

Thrown when an authentication error occurs while processing the request.

MaximumDataSizeExceededException

Thrown when a Social object is submitted, which exceeds the size restrictions of the system.

SocialCommunicationException

Thrown when errors occur communicating with the cloud services.

arrow_upward