Merge pull request #6290 from elsa-workflows/feature/blue-delete-fix
Added DeleteVariablesAsync method for the workflow context
This commit is contained in:
commit
646fb92535
1
.github/workflows/packages.yml
vendored
1
.github/workflows/packages.yml
vendored
|
|
@ -4,6 +4,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- 'blueberry'
|
||||
- 'feature/*'
|
||||
release:
|
||||
types: [ prereleased, published ]
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,12 @@ public interface IVariablePersistenceManager
|
|||
Task SaveVariablesAsync(WorkflowExecutionContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified variables from the <see cref="WorkflowExecutionContext"/>.
|
||||
/// Deletes the specified variables from the <see cref="ActivityExecutionContext"/>.
|
||||
/// </summary>
|
||||
Task DeleteVariablesAsync(ActivityExecutionContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified variables from the <see cref="WorkflowExecutionContext"/>.
|
||||
/// </summary>
|
||||
Task DeleteVariablesAsync(WorkflowExecutionContext context);
|
||||
}
|
||||
|
|
@ -110,6 +110,17 @@ public class VariablePersistenceManager : IVariablePersistenceManager
|
|||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DeleteVariablesAsync(WorkflowExecutionContext context)
|
||||
{
|
||||
var activityContexts = context.ActivityExecutionContexts.ToList();
|
||||
|
||||
foreach (var activityContext in activityContexts)
|
||||
{
|
||||
await DeleteVariablesAsync(activityContext);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<Variable> GetLocalVariables(IExecutionContext context) => context.Variables;
|
||||
|
||||
private MemoryBlock EnsureBlock(MemoryRegister register, Variable variable)
|
||||
|
|
|
|||
Loading…
Reference in a new issue