Assembly: OptimaJet.Workflow.Core

Class ActivityExceptionsHandler

OptimaJet.Workflow.Core.Model.ActivityExceptionsHandler

Represents an Activity Exception Handler in ActivityDefinition.ExceptionsHandlers that defines a response to matching Exception instances raised during normal activity execution.

public class ActivityExceptionsHandler

Properties

[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ActivityExceptionsHandlerType>))] public ActivityExceptionsHandlerType Type { get; set; } #
Gets or sets the ActivityExceptionsHandlerType response to use after the handler matches an Exception.
public string NameForSet { get; set; } #
Gets or sets the target activity name for ActivityExceptionsHandlerType.SetActivity or the target business state name for ActivityExceptionsHandlerType.SetState.
public int RetryCount { get; set; } #
Gets or sets the maximum number of retry attempts for the activity implementation when ActivityExceptionsHandler.Type is ActivityExceptionsHandlerType.Retry.
public List<string> Exceptions { get; set; } #
Gets or sets the exception-name patterns evaluated by ActivityExceptionsHandler.CanHandle(Exception). A pattern matches if it equals ActivityExceptionsHandler.UniversalExceptionName or occurs within Type.FullName for the exception's runtime type.
public int Order { get; set; } #
Gets or sets the handler's evaluation order. The handlers in ActivityDefinition.ExceptionsHandlers are evaluated in ascending order.

Methods

public bool CanHandle(Exception exception) #
Determines whether exception satisfies this handler's exception-name patterns and, for ActivityExceptionsHandlerType.Retry, the retry-count requirement.

Parameters

Name
Type
Description
exception
Exception
The Exception to match against the patterns in ActivityExceptionsHandler.Exceptions.

Returns

Type
Description

Fields

public const string UniversalExceptionName = "*" #
Specifies the wildcard exception-name pattern used by ActivityExceptionsHandler.CanHandle(Exception) for exceptions of any runtime type.