Update Workflow ctor to read variables from definition
This commit is contained in:
parent
b8a990658b
commit
4fcfaf61f9
|
|
@ -49,13 +49,15 @@ namespace Elsa.Models
|
|||
return SetVariable(name, variable.Value);
|
||||
}
|
||||
|
||||
public void SetVariables(Variables variables) =>
|
||||
public Variables SetVariables(Variables variables) =>
|
||||
SetVariables((IEnumerable<KeyValuePair<string, Variable>>) variables);
|
||||
|
||||
public void SetVariables(IEnumerable<KeyValuePair<string, Variable>> variables)
|
||||
public Variables SetVariables(IEnumerable<KeyValuePair<string, Variable>> variables)
|
||||
{
|
||||
foreach (var variable in variables)
|
||||
SetVariable(variable.Key, variable.Value);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasVariable(string name)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Elsa.Services.Models
|
|||
CorrelationId = correlationId;
|
||||
Activities = activities.ToList();
|
||||
Connections = connections.ToList();
|
||||
Input = new Variables(input ?? Variables.Empty);
|
||||
Input = new Variables().SetVariables(definition.Variables).SetVariables(new Variables(input ?? Variables.Empty));
|
||||
}
|
||||
|
||||
public Workflow()
|
||||
|
|
|
|||
Loading…
Reference in a new issue