Assembly: OptimaJet.Workflow.Core

Class RestrictionDefinition

OptimaJet.Workflow.Core.Model.RestrictionDefinition

Represents an authorization restriction on a TransitionDefinition that associates an ActorDefinition with a RestrictionType.

public class RestrictionDefinition

Properties

[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<RestrictionType>))] public RestrictionType Type { get; set; } #
Gets or sets the RestrictionType that determines how a match for RestrictionDefinition.Actor affects transition authorization.
public ActorDefinition Actor { get; set; } #
Gets or sets the ActorDefinition whose ActorDefinition.Rule determines whether a workflow participant identity matches this restriction.

Methods

public static RestrictionDefinition Create(string type, ActorDefinition actor) #
Creates a RestrictionDefinition that associates actor with the RestrictionType parsed from type.

Parameters

Name
Type
Description
type
String
The text representation of a RestrictionType to parse case-insensitively.
actor
ActorDefinition
The ActorDefinition to associate with the restriction.

Returns

Type
Description
RestrictionDefinition
A new RestrictionDefinition whose RestrictionDefinition.Actor is actor and whose RestrictionDefinition.Type is the parsed result.

Remarks

If type cannot be parsed, RestrictionType.Allow is used.
public static RestrictionDefinition Create(RestrictionType type, ActorDefinition actor) #
Creates a RestrictionDefinition that associates actor with type.

Parameters

Name
Type
Description
type
RestrictionType
The RestrictionType to apply.
actor
ActorDefinition
The ActorDefinition to associate with the restriction.

Returns

Type
Description
RestrictionDefinition
public RestrictionDefinition Clone() #
Creates a copy of this restriction and clones its associated RestrictionDefinition.Actor, when present, by using ActorDefinition.Clone().

Returns

Type
Description
RestrictionDefinition
A new RestrictionDefinition with the same RestrictionDefinition.Type and an independently cloned RestrictionDefinition.Actor, when one is assigned.
public RestrictionDefinition Clone(List<ActorDefinition> actorDefinitions) #
Creates a copy of this restriction and rebinds its RestrictionDefinition.Actor reference to an ActorDefinition from a supplied collection.

Parameters

Name
Type
Description
actorDefinitions
List<ActorDefinition>
The ActorDefinition instances to search for one whose actor name matches that of the current RestrictionDefinition.Actor.

Returns

Type
Description
RestrictionDefinition
A new RestrictionDefinition that references the matching ActorDefinition from actorDefinitions when an actor is assigned.

Exceptions

Type
Description
ArgumentNullException
The current RestrictionDefinition.Actor is assigned and actorDefinitions is null.
InvalidOperationException
The current RestrictionDefinition.Actor is assigned and actorDefinitions contains no ActorDefinition with the same actor name.

Remarks

Actor names are compared by using StringComparison.Ordinal.