Class UnityTaskDefinition
Abstract Unity ScriptableObject-based task definition providing base functionality for initialization tasks. Implements ITaskDefinition and IFoundationSettings to support configurable task creation with criticality levels, weights, and unique identification for the initialization pipeline.
Namespace: Serenity.Global.Infrastructure.Settings
Assembly: Serenity.UnityGlobal.Infrastructure.dll
Syntax
public abstract class UnityTaskDefinition : ScriptableObject, ITaskDefinition, IFoundationSettings
Constructors
UnityTaskDefinition()
Declaration
protected UnityTaskDefinition()
Fields
Guid
Declaration
public string Guid
Field Value
| Type | Description |
|---|---|
| string | Global unique identifier (GUID) for this task definition asset. |
Id
Declaration
public string Id
Field Value
| Type | Description |
|---|---|
| string | Unique identifier for this task definition. |
_criticality
Declaration
public TaskCriticality _criticality
Field Value
| Type | Description |
|---|---|
| TaskCriticality | Criticality level of the task (Critical, High, Medium, Low).Determines how task failures are handled during initialization. |
_weight
Declaration
public float _weight
Field Value
| Type | Description |
|---|---|
| float | Weight of the task for progress calculation and scheduling.Minimum value is 0.01f to ensure meaningful progress contribution. |
Properties
Criticality
Gets or sets the criticality level of this task.
Declaration
public TaskCriticality Criticality { get; set; }
Property Value
| Type | Description |
|---|---|
| TaskCriticality | The criticality level of the task. |
Weight
Gets or sets the weight of this task for progress calculations.
Declaration
public float Weight { get; set; }
Property Value
| Type | Description |
|---|---|
| float | The weight of the task. |
Methods
Build(TaskBuildContext)
Abstract method to build the actual task instance from this definition. Must be implemented by concrete task definition classes.
Declaration
public abstract ITask Build(TaskBuildContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TaskBuildContext | context | Context containing services and build information |
Returns
| Type | Description |
|---|---|
| ITask | A configured task instance |