Class ActivityDefinition
OptimaJet.Workflow.Core.Model.ActivityDefinition
Defines an activity in a process scheme.
Namespace: OptimaJet.Workflow.Core.Model
public class ActivityDefinition : BaseDefinition, IInlineActivity, IOrdinaryActivityType Hierarchy
- BaseDefinition
- ActivityDefinition Current type
- Implemented interfaces
- ActivityDefinition Current type
Properties
public string OriginalName { get; set; } #Gets or sets the activity name before the activity was first inlined into another scheme.
public string OriginalSchemeCode { get; set; } #Gets or sets the code of the scheme from which the activity was originally inlined.
public string LastTimeInlineName { get; set; } #Gets or sets the name of the inline activity used when this activity was last copied into a parent process scheme.
public string FirstTimeInlineName { get; set; } #Gets or sets the name of the first inline activity through which this activity was inlined.
public bool WasInlined { get; set; } #Gets or sets a value indicating whether this activity was copied into another process scheme during scheme inlining.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<ActivityType>))] public ActivityType ActivityType { get; set; } #Gets or sets the kind of activity represented by this definition.
public string SchemeCode { get; set; } #Gets or sets the code of the process scheme referenced by this inline activity.
public string State { get; set; } #Gets or sets the business state name associated with this activity.
Remarks
Multiple activities can have the same ActivityDefinition.State value.
public bool IsInitial { get; set; } #Gets or sets a value indicating whether this activity is the process entry point.
Remarks
Every scheme has exactly one initial activity.
public bool IsFinal { get; set; } #Gets or sets a value indicating whether this activity is marked as final.
Remarks
The process status becomes ProcessStatus.Finalized when execution stops at a final activity.
public bool IsForSetState { get; set; } #Gets or sets a value indicating whether this activity is eligible to be selected by state-setting operations.
Remarks
An activity is selected by state only when this property and ActivityDefinition.IsState are true and the requested state matches ActivityDefinition.State.
public bool IsAutoSchemeUpdate { get; set; } #Gets or sets a value indicating whether Workflow Engine may automatically update an obsolete process scheme while this activity is current.
public bool DisablePersistState { get; set; } #Gets or sets a value indicating whether entering this activity skips updating the stored current activity and business state.
public bool DisablePersistTransitionHistory { get; set; } #Gets or sets a value indicating whether entering this activity skips writing the transition to process history.
public bool DisablePersistParameters { get; set; } #Gets or sets a value indicating whether entering this activity skips saving persistent process parameters.
public string UserComment { get; set; } #Gets or sets a user-defined comment for the activity.
public bool HaveImplementation { get; } #Gets a value indicating whether ActivityDefinition.Implementation contains at least one ActionDefinitionReference.
public bool HavePreExecutionImplementation { get; } #Gets a value indicating whether ActivityDefinition.PreExecutionImplementation contains at least one ActionDefinitionReference.
public List<ActionDefinitionReference> Implementation { get; set; } #Gets or sets the actions executed when a process instance enters this activity during normal execution.
Remarks
Actions are invoked in ascending ActionDefinitionReference.Order order.
public List<ActionDefinitionReference> PreExecutionImplementation { get; set; } #Gets or sets the ActionDefinitionReference instances for actions executed during pre-execution simulation.
Remarks
Actions are invoked in ascending ActionDefinitionReference.Order order.
public List<Annotation> Annotations { get; set; } #Gets or sets the Annotation instances attached to this activity.
public ActivityTimeout ExecutionTimeout { get; set; } #Gets or sets the timeout that requests cancellation when normal activity execution exceeds its interval and defines how Workflow Engine responds.
public ActivityTimeout IdleTimeout { get; set; } #Gets or sets the timeout that limits how long a process instance can wait at this activity without a transition firing and defines how Workflow Engine responds.
public List<ActivityExceptionsHandler> ExceptionsHandlers { get; set; } #Gets or sets the ActivityExceptionsHandler configurations used during normal activity execution.
Remarks
Handlers are evaluated in ascending ActivityExceptionsHandler.Order order, and the first matching handler is used.
public bool IsState { get; } #Gets a value indicating whether ActivityDefinition.State is neither null nor empty.
public int? NestingLevel { get; set; } #Gets or sets the subprocess nesting level assigned to this activity.
[JsonIgnore] [JsonIgnore] public string CustomType { get; set; } #Gets or sets the custom activity type identifier stored in ActivityDefinition.Annotations.
Remarks
The getter reads the first matching Annotation. The setter appends an Annotation whose Annotation.Name is FormBase.CustomTypeAnnotationName.
Methods
public static ActivityDefinition CreateInlineActivity(string name, string schemeCode) #Creates an inline activity that references another process scheme.
Parameters
Name
Type
Description
nameStringThe name assigned to the created activity.
Returns
Type
Description
ActivityDefinitionpublic void AddAction(ActionDefinitionReference action) #Adds
action to ActivityDefinition.Implementation.Parameters
Name
Type
Description
public void AddPreExecutionAction(ActionDefinitionReference action) #Adds
action to ActivityDefinition.PreExecutionImplementation.Parameters
Name
Type
Description
public ActivityDefinition Clone() #Creates a copy of this ActivityDefinition.
Returns
Type
Description
ActivityDefinitionThe copied ActivityDefinition.
Exceptions
Type
Description
ExceptionThrown when BaseDefinition.Clone() does not produce an ActivityDefinition.
Remarks
BaseDefinition.Clone() supplies the initial copy. This method then creates new ActivityDefinition.Implementation, ActivityDefinition.PreExecutionImplementation, and ActivityDefinition.Annotations collections and clones their elements. The copied ActivityDefinition.ExecutionTimeout, ActivityDefinition.IdleTimeout, and ActivityDefinition.ExceptionsHandlers references are retained.
public T GetAnnotation<T>(string name) #Gets an Annotation.JsonValue and deserializes it to
T.Parameters
Name
Type
Description
Returns
Type
Description
{T}The annotation value deserialized as
T.public string GetAnnotation(string name) #Gets the stored string value for an annotation.
Parameters
Name
Type
Description
Returns
Type
Description
StringThe Annotation.JsonValue of the first annotation whose Annotation.Name matches
name; otherwise, null.Remarks
An ActivityType.Ordinary activity is a stable point where a process instance waits between transitions and can run actions on entry. An ActivityType.Inline activity marks where another process scheme is embedded during scheme building.