Interface IWorkflowRepository
The IWorkflowRepository interface describes a component capable of persisting, deleting, and retrieving workflow data from an underlying data store.
Namespace: EPiServer.Social.Moderation.Core
Assembly: EPiServer.Social.Moderation.Core.dll
Version: 1.5.4Syntax
public interface IWorkflowRepository
Methods
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 IWorkflowItemRepository 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. |
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 IWorkflowItemRepository 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. |
Create(Workflow)
Creates a workflow within the underlying data store.
Declaration
Workflow Create(Workflow workflow)
Parameters
| Type | Name | Description |
|---|---|---|
| Workflow | workflow | Workflow to be created |
Returns
| Type | Description |
|---|---|
| Workflow | Workflow which was created |
Create<TExtension>(Workflow, TExtension)
Creates a new workflow with supporting metadata to form a composite within the underlying data store.
Declaration
Composite<Workflow, TExtension> Create<TExtension>(Workflow workflow, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Workflow | workflow | Workflow to be created |
| 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 |
CreateAsync(Workflow)
Asynchronously creates a workflow within the underlying data store.
Declaration
Task<Workflow> CreateAsync(Workflow workflow)
Parameters
| Type | Name | Description |
|---|---|---|
| Workflow | workflow | Workflow to be created |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Workflow> | Workflow which was created |
CreateAsync<TExtension>(Workflow, TExtension)
Asynchronously creates a new workflow with supporting metadata to form a composite within the underlying data store.
Declaration
Task<Composite<Workflow, TExtension>> CreateAsync<TExtension>(Workflow workflow, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Workflow | workflow | Workflow to be created |
| 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 |
Delete(WorkflowId)
Removes an existing workflow from the underlying data store.
Declaration
void Delete(WorkflowId workflowId)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | workflowId | ID of the workflow to be removed |
DeleteAsync(WorkflowId)
Asynchronously removes an existing workflow from the underlying data store.
Declaration
Task DeleteAsync(WorkflowId workflowId)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | workflowId | ID of the workflow to be removed |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
EndTransitionSession(WorkflowId, Reference)
Ends a transition session, relinquishing exclusive access to transition 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 |
EndTransitionSessionAsync(WorkflowId, Reference)
Asynchronously ends a transition session, relinquishing exclusive access to transition 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 |
Get(Criteria<WorkflowFilter>)
Retrieves a page of workflows from the underlying data store, as described by the specified criteria.
Declaration
ResultPage<Workflow> Get(Criteria<WorkflowFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<WorkflowFilter> | criteria | Criteria by which to filter workflows |
Returns
| Type | Description |
|---|---|
| ResultPage<Workflow> | Page of workflows |
Get(WorkflowId)
Retrieves a workflow, represented by the specified ID, from the underlying data store.
Declaration
Workflow Get(WorkflowId workflowId)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | workflowId | ID of the workflow to be retrieved |
Returns
| Type | Description |
|---|---|
| Workflow | Workflow which was retrieved |
Get<TExtension>(CompositeCriteria<WorkflowFilter, TExtension>)
Retrieves a page of workflows from the underlying data store, as specified by the provided criteria. The workflow 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 |
Get<TExtension>(WorkflowId)
Gets a workflow composed with associated extension data, from the underlying data store, 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 |
GetAsync(Criteria<WorkflowFilter>)
Asynchronously retrieves a page of workflows from the underlying data store, as described by the specified criteria.
Declaration
Task<ResultPage<Workflow>> GetAsync(Criteria<WorkflowFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<WorkflowFilter> | criteria | Criteria by which to filter workflows |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Workflow>> | Page of workflows |
GetAsync(WorkflowId)
Asynchronously retrieves a workflow, represented by the specified ID, from the underlying data store.
Declaration
Task<Workflow> GetAsync(WorkflowId workflowId)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkflowId | workflowId | ID of the workflow to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Workflow> | Workflow which was retrieved |
GetAsync<TExtension>(CompositeCriteria<WorkflowFilter, TExtension>)
Asynchronously retrieves a page of workflows from the underlying data store, as specified by the provided criteria. The workflow 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 |
GetAsync<TExtension>(WorkflowId)
Asynchronously retrieves a workflow composed with associated extension data, from the underlying data store, 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 |