Assembly: OptimaJet.Workflow.Core

Class ActivityBase

OptimaJet.Workflow.Core.ActivityBase

Defines a custom activity type that adds a reusable, domain-specific activity to workflow schemes.

public abstract class ActivityBase : FormBase

Type Hierarchy

Constructors

public ActivityBase(Func<bool> getDisabled = null) #
Initializes a new instance of the ActivityBase class.

Parameters

Name
Type
Description
getDisabled
Func<Boolean>
A callback evaluated when the runtime determines whether to expose this activity type to the workflow designer. Return true to omit it from the designer's element palette. If null, the activity is exposed by default.

Remarks

The constructor initializes FormBase.Parameters with a required text field for BaseDefinition.Name and an optional text field for ActivityDefinition.State so parameter-based custom activity forms can edit the node name and state.

Properties

public virtual string Description { get; set; } #
Gets or sets the explanatory text displayed in the information tooltip for this activity in the workflow designer's element palette.
public virtual string Image { get; set; } #
Gets or sets the image path included in the custom activity metadata for designer clients that display a raster icon in the element palette.

Remarks

This value does not determine how an activity node is drawn on the scheme canvas. Use ActivityBase.SVGTemplate to select the canvas template.
public virtual string SVGTemplate { get; set; } #
Gets or sets the name of the SVG element template used by the workflow designer to draw nodes of this activity type on the scheme canvas.
public virtual bool AllowCycleTransition { get; } #
Gets a value indicating whether the workflow designer allows a user to create a transition from a node of this activity type back to the same node.

Remarks

This property controls the designer interaction; it is not a runtime validation rule for schemes created or modified through other APIs.
public virtual string PluginName { get; } #
Gets the name of the plugin that contributes this activity type to the workflow designer.

Remarks

The value is included in the custom activity metadata and allows designer clients to group or otherwise identify plugin-provided activities. For example, the workflow designer places activities provided by the BPMN plugin on its BPMN palette tab. Built-in activities return null.
public virtual bool IsOutgoingTransitionsReadonly { get; } #
Gets a value indicating whether outgoing transitions are configured through this activity's editor instead of the standard transition editor.

Remarks

Set this property when the custom activity form owns the configuration of its outgoing branches, as decision activity forms do.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<BaseTemplate>))] public virtual BaseTemplate BaseTemplate { get; } #
Gets the data model that the workflow designer uses with FormBase.Template when editing this activity.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<SaveToAnnotationsPolicy>))] public virtual SaveToAnnotationsPolicy SaveToAnnotationsPolicy { get; } #
Gets the policy that the workflow designer applies when saving values returned by this activity's editor to ActivityDefinition.Annotations.

Remarks

Regardless of this policy, the designer preserves the internal annotation used to associate an activity node with its custom type.
public virtual ImmutableHashSet<string> OrdinaryActivityParameters { get; } #
Gets the names of editor fields that the workflow designer maps directly to native ActivityDefinition properties instead of treating them as custom annotation values.

Remarks

With SaveToAnnotationsPolicy.SaveAllExceptOrdinary, these fields are also excluded from the annotations generated from the form values. The following fields are included by default: - BaseDefinition.Name: Specifies the name of the activity. - ActivityDefinition.State: Specifies the activity state. - ActivityDefinition.IsInitial: Specifies whether the activity is an initial activity. - ActivityDefinition.IsFinal: Specifies whether the activity is a final activity. - ActivityDefinition.IsForSetState: Specifies whether the activity sets the process state. - DesignerSettings.Color: Specifies the activity color in the designer. - ActivityDefinition.IsAutoSchemeUpdate: If true, obsolete process schemes are upgraded automatically when this activity is current. - ActivityDefinition.UserComment: Specifies the user comment for the activity. - ActivityDefinition.Annotations: Specifies the annotations for the activity. - ActivityDefinition.ExecutionTimeout: Specifies the execution timeout. - ActivityDefinition.IdleTimeout: Specifies the idle timeout. - ActivityDefinition.ExceptionsHandlers: Specifies the exception handlers. - ActivityDefinition.DisablePersistState: Specifies whether the activity state should not be persisted. - ActivityDefinition.DisablePersistTransitionHistory: Specifies whether the activity transition history should not be persisted. - ActivityDefinition.DisablePersistParameters: Specifies whether the activity parameters should not be persisted. - ActivityDefinition.Implementation: Specifies the implementation of the activity. - ActivityDefinition.PreExecutionImplementation: Specifies the pre-execution implementation of the activity.
public virtual ImmutableHashSet<string> AnnotationActivityParameters { get; } #
Gets the names of editor fields that the workflow designer is allowed to save to ActivityDefinition.Annotations when ActivityBase.SaveToAnnotationsPolicy is SaveToAnnotationsPolicy.SaveSpecified.

Remarks

This set is ignored for the other annotation storage policies. With SaveToAnnotationsPolicy.SaveSpecified, an empty set means that no editor fields are stored as annotations; the designer still preserves the internal custom type annotation.
public override bool Disabled { get; set; } #
Gets a value, calculated by the callback supplied to the constructor, indicating whether this activity type is hidden from the workflow designer.

Exceptions

Type
Description
NotImplementedException
The property setter is not implemented.

Remarks

Hiding an activity affects designer discovery only: it remains registered with the runtime, so existing scheme nodes can still execute it. The set accessor is not implemented by this base class.

Remarks

A custom activity is used when a workflow step needs its own representation and configuration form in the workflow designer, together with activity-specific execution behavior. An implementation defines how the activity appears and is edited, including its type identifier, title, description, visual representation, configurable parameters, and default values. After the type is registered with WorkflowRuntime, the workflow designer exposes it as an activity that can be added to a scheme. When a process reaches an ActivityDefinition whose ActivityDefinition.CustomType matches FormBase.Type, the runtime passes the values configured for that activity to FormBase.ExecutionAsync(WorkflowRuntime, ProcessInstance, Dictionary<string, string>, CancellationToken) during normal execution or to FormBase.PreExecutionAsync(WorkflowRuntime, ProcessInstance, Dictionary<string, string>, CancellationToken) during pre-execution simulation.