| | | 1 | | using System.Diagnostics.CodeAnalysis; |
| | | 2 | | using System.Linq.Expressions; |
| | | 3 | | using System.Text.Json.Serialization; |
| | | 4 | | using Elsa.Common.Entities; |
| | | 5 | | using Elsa.Common.Models; |
| | | 6 | | using Elsa.Extensions; |
| | | 7 | | using Elsa.Workflows; |
| | | 8 | | using Elsa.Workflows.Management; |
| | | 9 | | using Elsa.Workflows.Management.Entities; |
| | | 10 | | using Elsa.Workflows.Management.Filters; |
| | | 11 | | using Elsa.Workflows.Management.Models; |
| | | 12 | | using Elsa.Workflows.Memory; |
| | | 13 | | using Elsa.Workflows.Models; |
| | | 14 | | using JetBrains.Annotations; |
| | | 15 | | using Microsoft.EntityFrameworkCore; |
| | | 16 | | using Microsoft.Extensions.Logging; |
| | | 17 | | using Open.Linq.AsyncExtensions; |
| | | 18 | | |
| | | 19 | | namespace Elsa.Persistence.EFCore.Modules.Management; |
| | | 20 | | |
| | | 21 | | /// <inheritdoc /> |
| | | 22 | | [UsedImplicitly] |
| | 457 | 23 | | public class EFCoreWorkflowDefinitionStore(EntityStore<ManagementElsaDbContext, WorkflowDefinition> store, IPayloadSeria |
| | | 24 | | : IWorkflowDefinitionStore |
| | | 25 | | { |
| | | 26 | | /// <inheritdoc /> |
| | | 27 | | public async Task<WorkflowDefinition?> FindAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToke |
| | | 28 | | { |
| | 3329 | 29 | | var orderBy = new WorkflowDefinitionOrder<DateTimeOffset>(x => x.CreatedAt, OrderDirection.Ascending); |
| | 3329 | 30 | | return await FindAsync(filter, orderBy, cancellationToken); |
| | 3329 | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <inheritdoc /> |
| | | 34 | | public async Task<WorkflowDefinition?> FindAsync<TOrderBy>(WorkflowDefinitionFilter filter, WorkflowDefinitionOrder< |
| | | 35 | | { |
| | 6680 | 36 | | return await store.QueryAsync(queryable => Filter(queryable, filter).OrderBy(order), OnLoadAsync, filter.TenantA |
| | 3340 | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <inheritdoc /> |
| | | 40 | | public async Task<Page<WorkflowDefinition>> FindManyAsync(WorkflowDefinitionFilter filter, PageArgs pageArgs, Cancel |
| | | 41 | | { |
| | 0 | 42 | | var orderBy = new WorkflowDefinitionOrder<DateTimeOffset>(x => x.CreatedAt, OrderDirection.Ascending); |
| | 0 | 43 | | return await FindManyAsync(filter, orderBy, pageArgs, cancellationToken); |
| | 0 | 44 | | } |
| | | 45 | | |
| | | 46 | | /// <inheritdoc /> |
| | | 47 | | public async Task<Page<WorkflowDefinition>> FindManyAsync<TOrderBy>(WorkflowDefinitionFilter filter, WorkflowDefinit |
| | | 48 | | { |
| | 4 | 49 | | var count = await store.QueryAsync(queryable => Filter(queryable, filter), cancellationToken).LongCount(); |
| | 4 | 50 | | var results = await store.QueryAsync(queryable => Filter(queryable, filter).OrderBy(order).Paginate(pageArgs), O |
| | 2 | 51 | | return new(results, count); |
| | 2 | 52 | | } |
| | | 53 | | |
| | | 54 | | /// <inheritdoc /> |
| | | 55 | | public async Task<IEnumerable<WorkflowDefinition>> FindManyAsync(WorkflowDefinitionFilter filter, CancellationToken |
| | | 56 | | { |
| | 5754 | 57 | | var orderBy = new WorkflowDefinitionOrder<DateTimeOffset>(x => x.CreatedAt, OrderDirection.Ascending); |
| | 5754 | 58 | | return await FindManyAsync(filter, orderBy, cancellationToken); |
| | 5754 | 59 | | } |
| | | 60 | | |
| | | 61 | | /// <inheritdoc /> |
| | | 62 | | public async Task<IEnumerable<WorkflowDefinition>> FindManyAsync<TOrderBy>(WorkflowDefinitionFilter filter, Workflow |
| | | 63 | | { |
| | 11508 | 64 | | return await store.QueryAsync(queryable => Filter(queryable, filter).OrderBy(order), OnLoadAsync, filter.TenantA |
| | 5754 | 65 | | } |
| | | 66 | | |
| | | 67 | | /// <inheritdoc /> |
| | | 68 | | [RequiresUnreferencedCode("The method 'FindSummariesAsync' is used for serialization and requires unreferenced code |
| | | 69 | | public async Task<Page<WorkflowDefinitionSummary>> FindSummariesAsync(WorkflowDefinitionFilter filter, PageArgs page |
| | | 70 | | { |
| | 0 | 71 | | var orderBy = new WorkflowDefinitionOrder<DateTimeOffset>(x => x.CreatedAt, OrderDirection.Ascending); |
| | 0 | 72 | | return await FindSummariesAsync(filter, orderBy, pageArgs, cancellationToken); |
| | 0 | 73 | | } |
| | | 74 | | |
| | | 75 | | /// <inheritdoc /> |
| | | 76 | | [RequiresUnreferencedCode("The method 'FindSummariesAsync' is used for serialization and requires unreferenced code |
| | | 77 | | public async Task<Page<WorkflowDefinitionSummary>> FindSummariesAsync<TOrderBy>(WorkflowDefinitionFilter filter, Wor |
| | | 78 | | { |
| | 0 | 79 | | await using var dbContext = await store.CreateDbContextAsync(cancellationToken); |
| | 0 | 80 | | var set = dbContext.WorkflowDefinitions.AsNoTracking(); |
| | 0 | 81 | | var queryable = Filter(set.AsQueryable(), filter).OrderBy(order); |
| | | 82 | | |
| | 0 | 83 | | if (filter.TenantAgnostic) |
| | 0 | 84 | | queryable = queryable.IgnoreQueryFilters(); |
| | | 85 | | |
| | 0 | 86 | | var count = await queryable.LongCountAsync(cancellationToken); |
| | 0 | 87 | | queryable = Paginate(queryable, pageArgs); |
| | 0 | 88 | | var results = await queryable.Select(WorkflowDefinitionSummary.FromDefinitionExpression()).ToListAsync(cancellat |
| | 0 | 89 | | return Page.Of(results, count); |
| | 0 | 90 | | } |
| | | 91 | | |
| | | 92 | | /// <inheritdoc /> |
| | | 93 | | [RequiresUnreferencedCode("The method 'FindSummariesAsync' is used for serialization and requires unreferenced code |
| | | 94 | | public async Task<IEnumerable<WorkflowDefinitionSummary>> FindSummariesAsync(WorkflowDefinitionFilter filter, Cancel |
| | | 95 | | { |
| | 7 | 96 | | var orderBy = new WorkflowDefinitionOrder<DateTimeOffset>(x => x.CreatedAt, OrderDirection.Ascending); |
| | 7 | 97 | | return await FindSummariesAsync(filter, orderBy, cancellationToken); |
| | 7 | 98 | | } |
| | | 99 | | |
| | | 100 | | /// <inheritdoc /> |
| | | 101 | | [RequiresUnreferencedCode("The method 'FindSummariesAsync' is used for serialization and requires unreferenced code |
| | | 102 | | public async Task<IEnumerable<WorkflowDefinitionSummary>> FindSummariesAsync<TOrderBy>(WorkflowDefinitionFilter filt |
| | | 103 | | { |
| | 7 | 104 | | await using var dbContext = await store.CreateDbContextAsync(cancellationToken); |
| | 7 | 105 | | var set = dbContext.WorkflowDefinitions.AsNoTracking(); |
| | 7 | 106 | | var queryable = Filter(set.AsQueryable(), filter).OrderBy(order); |
| | | 107 | | |
| | 7 | 108 | | if (filter.TenantAgnostic) |
| | 0 | 109 | | queryable = queryable.IgnoreQueryFilters(); |
| | | 110 | | |
| | 7 | 111 | | return await queryable.Select(WorkflowDefinitionSummary.FromDefinitionExpression()).ToListAsync(cancellationToke |
| | 7 | 112 | | } |
| | | 113 | | |
| | | 114 | | /// <inheritdoc /> |
| | | 115 | | public async Task<WorkflowDefinition?> FindLastVersionAsync(WorkflowDefinitionFilter filter, CancellationToken cance |
| | | 116 | | { |
| | 34 | 117 | | return await store.QueryAsync(queryable => Filter(queryable, filter).OrderByDescending(x => x.Version), OnLoadAs |
| | 17 | 118 | | } |
| | | 119 | | |
| | | 120 | | /// <inheritdoc /> |
| | | 121 | | public async Task SaveAsync(WorkflowDefinition definition, CancellationToken cancellationToken = default) |
| | | 122 | | { |
| | 37 | 123 | | await store.SaveAsync(definition, OnSaveAsync, cancellationToken); |
| | 36 | 124 | | } |
| | | 125 | | |
| | | 126 | | /// <inheritdoc /> |
| | | 127 | | public async Task SaveManyAsync(IEnumerable<WorkflowDefinition> definitions, CancellationToken cancellationToken = d |
| | | 128 | | { |
| | 2761 | 129 | | await store.SaveManyAsync(definitions, OnSaveAsync, cancellationToken); |
| | 2760 | 130 | | } |
| | | 131 | | |
| | | 132 | | /// <inheritdoc /> |
| | | 133 | | public async Task<WorkflowDefinitionUpdateResult> TryUpdateLatestAsync( |
| | | 134 | | WorkflowDefinitionFilter filter, |
| | | 135 | | Func<WorkflowDefinition, bool> matchesExpected, |
| | | 136 | | Func<WorkflowDefinition, WorkflowDefinition> update, |
| | | 137 | | CancellationToken cancellationToken = default) |
| | | 138 | | { |
| | 0 | 139 | | await using var dbContext = await store.CreateDbContextAsync(cancellationToken); |
| | 0 | 140 | | await using var transaction = await dbContext.Database.BeginTransactionAsync(cancellationToken); |
| | | 141 | | |
| | 0 | 142 | | var queryable = Filter(dbContext.WorkflowDefinitions.AsTracking(), filter); |
| | | 143 | | |
| | 0 | 144 | | if (filter.TenantAgnostic) |
| | 0 | 145 | | queryable = queryable.IgnoreQueryFilters(); |
| | | 146 | | |
| | 0 | 147 | | var current = await queryable.OrderBy(x => x.CreatedAt).FirstOrDefaultAsync(cancellationToken); |
| | | 148 | | |
| | 0 | 149 | | if (current == null) |
| | 0 | 150 | | return WorkflowDefinitionUpdateResult.NotFound(); |
| | | 151 | | |
| | 0 | 152 | | await OnLoadAsync(dbContext, current, cancellationToken); |
| | | 153 | | |
| | 0 | 154 | | if (!matchesExpected(current)) |
| | 0 | 155 | | return WorkflowDefinitionUpdateResult.Conflict(); |
| | | 156 | | |
| | 0 | 157 | | var expectedId = current.Id; |
| | 0 | 158 | | var expectedVersion = current.Version; |
| | 0 | 159 | | var expectedStringData = current.StringData; |
| | 0 | 160 | | var expectedName = current.Name; |
| | 0 | 161 | | var expectedDescription = current.Description; |
| | 0 | 162 | | var expectedData = (string?)dbContext.Entry(current).Property("Data").CurrentValue; |
| | | 163 | | |
| | | 164 | | // Preserve shadow state while loading, then keep the callback outside change tracking. |
| | 0 | 165 | | dbContext.Entry(current).State = EntityState.Detached; |
| | | 166 | | |
| | 0 | 167 | | var next = update(current); |
| | 0 | 168 | | var nextData = SerializeState(next); |
| | 0 | 169 | | var nextUsableAsActivity = next.Options.UsableAsActivity; |
| | | 170 | | |
| | 0 | 171 | | if (next.Id != expectedId) |
| | | 172 | | { |
| | 0 | 173 | | var unmarked = await dbContext.WorkflowDefinitions |
| | 0 | 174 | | .Where(MatchesLoadedSnapshot(expectedId, expectedVersion, expectedStringData, expectedName, expectedDesc |
| | 0 | 175 | | .ExecuteUpdateAsync(setters => setters.SetProperty(x => x.IsLatest, false), cancellationToken); |
| | | 176 | | |
| | 0 | 177 | | if (unmarked == 0) |
| | 0 | 178 | | return WorkflowDefinitionUpdateResult.Conflict(); |
| | | 179 | | |
| | 0 | 180 | | dbContext.WorkflowDefinitions.Add(next); |
| | 0 | 181 | | dbContext.Entry(next).Property("Data").CurrentValue = nextData; |
| | 0 | 182 | | dbContext.Entry(next).Property("UsableAsActivity").CurrentValue = nextUsableAsActivity; |
| | 0 | 183 | | await dbContext.SaveChangesAsync(cancellationToken); |
| | 0 | 184 | | await transaction.CommitAsync(cancellationToken); |
| | 0 | 185 | | return WorkflowDefinitionUpdateResult.Updated(next); |
| | | 186 | | } |
| | | 187 | | |
| | 0 | 188 | | var updated = await dbContext.WorkflowDefinitions |
| | 0 | 189 | | .Where(MatchesLoadedSnapshot(expectedId, expectedVersion, expectedStringData, expectedName, expectedDescript |
| | 0 | 190 | | .ExecuteUpdateAsync( |
| | 0 | 191 | | setters => setters |
| | 0 | 192 | | .SetProperty(x => x.Name, next.Name) |
| | 0 | 193 | | .SetProperty(x => x.Description, next.Description) |
| | 0 | 194 | | .SetProperty(x => x.StringData, next.StringData) |
| | 0 | 195 | | .SetProperty(x => EF.Property<string?>(x, "Data"), nextData) |
| | 0 | 196 | | .SetProperty(x => EF.Property<bool?>(x, "UsableAsActivity"), nextUsableAsActivity), |
| | 0 | 197 | | cancellationToken); |
| | | 198 | | |
| | 0 | 199 | | if (updated == 0) |
| | 0 | 200 | | return WorkflowDefinitionUpdateResult.Conflict(); |
| | | 201 | | |
| | 0 | 202 | | await transaction.CommitAsync(cancellationToken); |
| | 0 | 203 | | return WorkflowDefinitionUpdateResult.Updated(next); |
| | 0 | 204 | | } |
| | | 205 | | |
| | | 206 | | /// <summary> |
| | | 207 | | /// The loaded snapshot <see cref="TryUpdateLatestAsync"/> will only overwrite: identity, the ETag-covered |
| | | 208 | | /// graph, the serialized <c>Data</c> blob (source XML, variables, options) and the name/description columns |
| | | 209 | | /// a metadata-only save changes. The row must still be <c>IsLatest</c> so a published→draft loser |
| | | 210 | | /// is Conflict rather than a unique-key failure on <c>(DefinitionId, Version)</c>. Zero rows means |
| | | 211 | | /// another writer got there first. |
| | | 212 | | /// </summary> |
| | | 213 | | private static Expression<Func<WorkflowDefinition, bool>> MatchesLoadedSnapshot( |
| | | 214 | | string expectedId, |
| | | 215 | | int expectedVersion, |
| | | 216 | | string? expectedStringData, |
| | | 217 | | string? expectedName, |
| | | 218 | | string? expectedDescription, |
| | | 219 | | string? expectedData) => |
| | 0 | 220 | | x => x.Id == expectedId |
| | 0 | 221 | | && x.Version == expectedVersion |
| | 0 | 222 | | && x.IsLatest |
| | 0 | 223 | | && x.StringData == expectedStringData |
| | 0 | 224 | | && x.Name == expectedName |
| | 0 | 225 | | && x.Description == expectedDescription |
| | 0 | 226 | | && EF.Property<string?>(x, "Data") == expectedData; |
| | | 227 | | |
| | | 228 | | /// <inheritdoc /> |
| | | 229 | | public async Task<long> DeleteAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) |
| | | 230 | | { |
| | 8 | 231 | | await using var dbContext = await store.CreateDbContextAsync(cancellationToken); |
| | 8 | 232 | | var set = dbContext.WorkflowDefinitions; |
| | 8 | 233 | | var queryable = set.AsQueryable(); |
| | | 234 | | |
| | 8 | 235 | | if (filter.TenantAgnostic) |
| | 0 | 236 | | queryable = queryable.IgnoreQueryFilters(); |
| | | 237 | | |
| | 8 | 238 | | var ids = await Filter(queryable, filter).Select(x => x.Id).Distinct().ToListAsync(cancellationToken); |
| | 8 | 239 | | return await store.DeleteWhereAsync(x => ids.Contains(x.Id), cancellationToken); |
| | 8 | 240 | | } |
| | | 241 | | |
| | | 242 | | /// <inheritdoc /> |
| | | 243 | | public async Task<bool> AnyAsync(WorkflowDefinitionFilter filter, CancellationToken cancellationToken = default) |
| | | 244 | | { |
| | 2 | 245 | | return await store.QueryAsync(queryable => Filter(queryable, filter), filter.TenantAgnostic, cancellationToken). |
| | 1 | 246 | | } |
| | | 247 | | |
| | | 248 | | /// <inheritdoc /> |
| | | 249 | | public async Task<long> CountDistinctAsync(CancellationToken cancellationToken = default) |
| | | 250 | | { |
| | 1 | 251 | | return await store.CountAsync(x => true, x => x.DefinitionId, false, cancellationToken); |
| | 1 | 252 | | } |
| | | 253 | | |
| | | 254 | | /// <inheritdoc /> |
| | | 255 | | public async Task<bool> GetIsNameUnique(string name, string? definitionId = null, CancellationToken cancellationToke |
| | | 256 | | { |
| | 0 | 257 | | var exists = await store.AnyAsync(x => x.Name == name && x.DefinitionId != definitionId, false, cancellationToke |
| | 0 | 258 | | return !exists; |
| | 0 | 259 | | } |
| | | 260 | | |
| | | 261 | | private ValueTask OnSaveAsync(ManagementElsaDbContext managementElsaDbContext, WorkflowDefinition entity, Cancellati |
| | | 262 | | { |
| | 2802 | 263 | | var json = SerializeState(entity); |
| | | 264 | | |
| | 2802 | 265 | | managementElsaDbContext.Entry(entity).Property("Data").CurrentValue = json; |
| | 2802 | 266 | | managementElsaDbContext.Entry(entity).Property("UsableAsActivity").CurrentValue = entity.Options.UsableAsActivit |
| | 2802 | 267 | | return ValueTask.CompletedTask; |
| | | 268 | | } |
| | | 269 | | |
| | | 270 | | private string SerializeState(WorkflowDefinition entity) |
| | | 271 | | { |
| | 2802 | 272 | | var data = new WorkflowDefinitionState(entity.Options, entity.Variables, entity.Inputs, entity.Outputs, entity.O |
| | 2802 | 273 | | return payloadSerializer.Serialize(data); |
| | | 274 | | } |
| | | 275 | | |
| | | 276 | | private ValueTask OnLoadAsync(ManagementElsaDbContext managementElsaDbContext, WorkflowDefinition? entity, Cancellat |
| | | 277 | | { |
| | 10077 | 278 | | if (entity == null) |
| | 0 | 279 | | return ValueTask.CompletedTask; |
| | | 280 | | |
| | 10077 | 281 | | var data = new WorkflowDefinitionState(entity.Options, entity.Variables, entity.Inputs, entity.Outputs, entity.O |
| | 10077 | 282 | | var json = (string?)managementElsaDbContext.Entry(entity).Property("Data").CurrentValue; |
| | | 283 | | |
| | | 284 | | try |
| | | 285 | | { |
| | 10077 | 286 | | if (!string.IsNullOrWhiteSpace(json)) |
| | 10077 | 287 | | data = payloadSerializer.Deserialize<WorkflowDefinitionState>(json); |
| | 10077 | 288 | | } |
| | 0 | 289 | | catch (Exception exp) |
| | | 290 | | { |
| | 0 | 291 | | logger.LogError(exp, "Could not deserialize workflow definition state: {DefinitionId}. Reverting to default |
| | 0 | 292 | | } |
| | | 293 | | |
| | 10077 | 294 | | entity.Options = data.Options; |
| | 10077 | 295 | | entity.Variables = data.Variables; |
| | 10077 | 296 | | entity.Inputs = data.Inputs; |
| | 10077 | 297 | | entity.Outputs = data.Outputs; |
| | 10077 | 298 | | entity.Outcomes = data.Outcomes; |
| | 10077 | 299 | | entity.CustomProperties = data.CustomProperties; |
| | | 300 | | |
| | 10077 | 301 | | return ValueTask.CompletedTask; |
| | | 302 | | } |
| | | 303 | | |
| | | 304 | | private IQueryable<WorkflowDefinition> Filter(IQueryable<WorkflowDefinition> queryable, WorkflowDefinitionFilter fil |
| | | 305 | | { |
| | 9131 | 306 | | var definitionId = filter.DefinitionId ?? filter.DefinitionHandle?.DefinitionId; |
| | 9131 | 307 | | var versionOptions = filter.VersionOptions ?? filter.DefinitionHandle?.VersionOptions; |
| | 9131 | 308 | | var id = filter.Id ?? filter.DefinitionHandle?.DefinitionVersionId; |
| | | 309 | | |
| | 17656 | 310 | | if (definitionId != null) queryable = queryable.Where(x => x.DefinitionId == definitionId); |
| | 9142 | 311 | | if (filter.DefinitionIds != null) queryable = queryable.Where(x => filter.DefinitionIds.Contains(x.DefinitionId) |
| | 9633 | 312 | | if (id != null) queryable = queryable.Where(x => x.Id == id); |
| | 9133 | 313 | | if (filter.Ids != null) queryable = queryable.Where(x => filter.Ids.Contains(x.Id)); |
| | 17719 | 314 | | if (versionOptions != null) queryable = queryable.WithVersion(versionOptions.Value); |
| | 9131 | 315 | | if (filter.MaterializerName != null) queryable = queryable.Where(x => x.MaterializerName == filter.MaterializerN |
| | 9131 | 316 | | if (filter.Name != null) queryable = queryable.Where(x => x.Name == filter.Name); |
| | 9131 | 317 | | if (filter.Names != null) queryable = queryable.Where(x => filter.Names.Contains(x.Name!)); |
| | 9372 | 318 | | if (filter.UsableAsActivity != null) queryable = queryable.Where(x => EF.Property<bool>(x, "UsableAsActivity") = |
| | 9131 | 319 | | if (!string.IsNullOrWhiteSpace(filter.SearchTerm)) queryable = queryable.Where(x => x.Name!.ToLower().Contains(f |
| | | 320 | | |
| | | 321 | | // TEMP: IsSystem may be null when upgrading from older versions of Elsa to 3.2. See issue #5366. |
| | | 322 | | // In a future version, we should remove this check and simply do queryable.Where(x => x.IsSystem == filter.IsSy |
| | 9131 | 323 | | if (filter.IsSystem != null) |
| | 1 | 324 | | queryable = filter.IsSystem == true |
| | 1 | 325 | | ? queryable.Where(x => x.IsSystem == true) |
| | 1 | 326 | | #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never eq |
| | 1 | 327 | | : queryable.Where(x => x.IsSystem == false || x.IsSystem == null!); |
| | | 328 | | #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never eq |
| | | 329 | | |
| | 9142 | 330 | | if (filter.IsReadonly != null) queryable = queryable.Where(x => x.IsReadonly == filter.IsReadonly); |
| | 9131 | 331 | | return queryable; |
| | | 332 | | } |
| | | 333 | | |
| | | 334 | | private IQueryable<WorkflowDefinition> Paginate(IQueryable<WorkflowDefinition> queryable, PageArgs? pageArgs) |
| | | 335 | | { |
| | 0 | 336 | | if (pageArgs?.Offset != null) queryable = queryable.Skip(pageArgs.Offset.Value); |
| | 0 | 337 | | if (pageArgs?.Limit != null) queryable = queryable.Take(pageArgs.Limit.Value); |
| | 0 | 338 | | return queryable; |
| | | 339 | | } |
| | | 340 | | |
| | | 341 | | private class WorkflowDefinitionState |
| | | 342 | | { |
| | | 343 | | [JsonConstructor] |
| | 10077 | 344 | | public WorkflowDefinitionState() |
| | | 345 | | { |
| | 10077 | 346 | | } |
| | | 347 | | |
| | 12879 | 348 | | public WorkflowDefinitionState( |
| | 12879 | 349 | | WorkflowOptions options, |
| | 12879 | 350 | | ICollection<Variable> variables, |
| | 12879 | 351 | | ICollection<InputDefinition> inputs, |
| | 12879 | 352 | | ICollection<OutputDefinition> outputs, |
| | 12879 | 353 | | ICollection<string> outcomes, |
| | 12879 | 354 | | IDictionary<string, object> customProperties |
| | 12879 | 355 | | ) |
| | | 356 | | { |
| | 12879 | 357 | | Options = options; |
| | 12879 | 358 | | Variables = variables; |
| | 12879 | 359 | | Inputs = inputs; |
| | 12879 | 360 | | Outputs = outputs; |
| | 12879 | 361 | | Outcomes = outcomes; |
| | 12879 | 362 | | CustomProperties = customProperties; |
| | 12879 | 363 | | } |
| | | 364 | | |
| | 58791 | 365 | | public WorkflowOptions Options { get; set; } = new(); |
| | 58791 | 366 | | public ICollection<Variable> Variables { get; set; } = new List<Variable>(); |
| | 58791 | 367 | | public ICollection<InputDefinition> Inputs { get; set; } = new List<InputDefinition>(); |
| | 58791 | 368 | | public ICollection<OutputDefinition> Outputs { get; set; } = new List<OutputDefinition>(); |
| | 58791 | 369 | | public ICollection<string> Outcomes { get; set; } = new List<string>(); |
| | 58791 | 370 | | public IDictionary<string, object> CustomProperties { get; set; } = new Dictionary<string, object>(); |
| | | 371 | | } |
| | | 372 | | } |