Rename Memory to MemoryBlocks

This commit is contained in:
Sipke Schoorstra 2022-06-04 20:02:59 +02:00
parent 951149b5d4
commit 1fc93afcb2
3 changed files with 6 additions and 6 deletions

View file

@ -8,17 +8,17 @@ public class MemoryRegister
public MemoryRegister(MemoryRegister? parent = default, IDictionary<string, MemoryBlock>? locations = default)
{
Parent = parent;
Memory = locations ?? new Dictionary<string, MemoryBlock>();
MemoryBlocks = locations ?? new Dictionary<string, MemoryBlock>();
}
public MemoryRegister? Parent { get; }
public IDictionary<string, MemoryBlock> Memory { get; }
public IDictionary<string, MemoryBlock> MemoryBlocks { get; }
public bool TryGetMemoryDatum(string id, out MemoryBlock datum)
{
datum = null!;
if (Memory.TryGetValue(id, out datum!))
if (MemoryBlocks.TryGetValue(id, out datum!))
return true;
return Parent?.TryGetMemoryDatum(id, out datum) == true;
@ -33,7 +33,7 @@ public class MemoryRegister
public MemoryBlock Declare(MemoryReference reference)
{
var datum = reference.Declare();
Memory[reference.Id] = datum;
MemoryBlocks[reference.Id] = datum;
return datum;
}
}

View file

@ -71,7 +71,7 @@ namespace Elsa.JavaScript.Implementations
while (currentContext != null)
{
foreach (var l in currentContext.MemoryRegister.Memory)
foreach (var l in currentContext.MemoryRegister.MemoryBlocks)
{
if(!dictionary.ContainsKey(l.Key))
dictionary.Add(l.Key, l.Value);

View file

@ -109,7 +109,7 @@ public class WorkflowStateSerializer : IWorkflowStateSerializer
{
ActivityExecutionContextState CreateActivityExecutionContextState(ActivityExecutionContext activityExecutionContext)
{
var registerState = new RegisterState(activityExecutionContext.ExpressionExecutionContext.MemoryRegister.Memory);
var registerState = new RegisterState(activityExecutionContext.ExpressionExecutionContext.MemoryRegister.MemoryBlocks);
var activityExecutionContextState = new ActivityExecutionContextState
{
Id = activityExecutionContext.Id,