Interface IApprovalEngine
NOTE: This is a pre-release API that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version. Class for running an approval instance
Namespace: EPiServer.Approvals
Assembly: EPiServer.dll
Version: 11.20.7Syntax
public interface IApprovalEngine
Methods
AbortAsync(IEnumerable<Int32>, String)
Aborts a list of approval instances.
Declaration
Task AbortAsync(IEnumerable<int> ids, string username)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Int32> | ids | A list of approval instance ids |
System.String | username | Name of the user |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
ApproveAsync(Int32, String, Int32, ApprovalDecisionScope, String)
Approves a step in an approval instance.
Declaration
Task ApproveAsync(int id, string username, int stepIndex, ApprovalDecisionScope scope, string comment)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The identifier of the approval instance |
System.String | username | Name of the user |
System.Int32 | stepIndex | Index of the step to approve. If scope is Force, then this parameter is disregarded |
ApprovalDecisionScope | scope | Scope of the approve |
System.String | comment | An optional comment |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
MissingApprovalException | There was a problem finding an approval |
MissingApprovalDefinitionException | There was a problem finding an approval definition |
ApprovalStepIndexException | Step index is currently invalid |
ApprovalReviewerStepException | User is not part of the approval definition step |
ApprovalMissingCommentException | The approval definition requires a comment when approving |
ApprovalReviewerSelfApproveException | The user that started the approval is not allowed to approve it |
RejectAsync(Int32, String, Int32, ApprovalDecisionScope, String)
Rejects a step in an approval instance.
Declaration
Task RejectAsync(int id, string username, int stepIndex, ApprovalDecisionScope scope, string comment)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The identifier of the approval instance |
System.String | username | Name of the user |
System.Int32 | stepIndex | Index of the step to reject. If scope is Force, then this parameter is disregarded |
ApprovalDecisionScope | scope | Scope of the reject |
System.String | comment | An optional comment |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Exceptions
Type | Condition |
---|---|
MissingApprovalException | There was a problem finding an approval |
MissingApprovalDefinitionException | There was a problem finding an approval definition |
ApprovalRejectionException | Rejection is not allowed on an approved approval |
ApprovalStepIndexException | Step index is currently invalid |
ApprovalReviewerStepException | User is not part of the approval definition step |
ApprovalMissingCommentException | The approval definition requires a comment when rejecting |
StartAsync(IEnumerable<Uri>, String, Boolean)
Start approval instances for a list of approval references.
Declaration
Task<IEnumerable<Approval>> StartAsync(IEnumerable<Uri> references, string username, bool throwOnMissingDefinition)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Uri> | references | A list of approval references |
System.String | username | Name of the user |
System.Boolean | throwOnMissingDefinition | Specifies if an exception should be thrown when an definition is missing or is not enabled |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Approval>> | A list of approval instances |
Exceptions
Type | Condition |
---|---|
MissingApprovalException | There was a problem finding an approval |
DisabledApprovalDefinitionException | An approval definition was disabled |
ApprovalInReviewException | The operation cannot be executed due to a conflict with an approval in review |