Class RestrictionDefinition
OptimaJet.Workflow.Core.Model.RestrictionDefinition
Represents an authorization restriction on a TransitionDefinition that associates an ActorDefinition with a RestrictionType.
Namespace: OptimaJet.Workflow.Core.Model
public class RestrictionDefinitionProperties
[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) #Parameters
Name
Type
Description
Returns
Type
Description
RestrictionDefinitionA 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) #Parameters
Name
Type
Description
Returns
Type
Description
RestrictionDefinitionA new RestrictionDefinition whose RestrictionDefinition.Actor is
actor and whose RestrictionDefinition.Type is type.public RestrictionDefinition Clone() #Creates a copy of this restriction and clones its associated RestrictionDefinition.Actor, when present, by using ActorDefinition.Clone().
Returns
Type
Description
RestrictionDefinitionA 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
actorDefinitionsList<ActorDefinition>The ActorDefinition instances to search for one whose actor name matches that of the current RestrictionDefinition.Actor.
Returns
Type
Description
RestrictionDefinitionA new RestrictionDefinition that references the matching ActorDefinition from
actorDefinitions when an actor is assigned.Exceptions
Type
Description
ArgumentNullExceptionInvalidOperationExceptionThe current RestrictionDefinition.Actor is assigned and
actorDefinitions contains no ActorDefinition with the same actor name.Remarks
Actor names are compared by using StringComparison.Ordinal.