using System.Collections.Generic; using AutoMapper.Configuration.Conventions; using Elsa.Comparers; using Elsa.Models; using NodaTime; namespace Elsa.Persistence.YesSql.Documents { public class WorkflowInstanceDocument : YesSqlDocument { private HashSet _blockingActivities = new(BlockingActivityEqualityComparer.Instance); public string InstanceId { get; set; } = default!; public string DefinitionId { get; set; } = default!; public string? TenantId { get; set; } public int Version { get; set; } public WorkflowStatus WorkflowStatus { get; set; } public string? CorrelationId { get; set; } public string? ContextId { get; set; } public Instant CreatedAt { get; set; } public Instant? LastExecutedAt { get; set; } public Instant? FinishedAt { get; set; } public Instant? CancelledAt { get; set; } public Instant? FaultedAt { get; set; } public Variables Variables { get; set; } = new(); public object? Output { get; set; } public ICollection Activities { get; set; } = new List(); public HashSet BlockingActivities { get => _blockingActivities; set => _blockingActivities = new HashSet(value, BlockingActivityEqualityComparer.Instance); } public ICollection ExecutionLog { get; set; } = new List(); public WorkflowFault? Fault { get; set; } public Stack ScheduledActivities { get; set; } = new(); public Stack PostScheduledActivities { get; set; } = new(); public Stack ParentActivities { get; set; } = new(); } }