Fix a serialization/casting issue in WorkflowExecutionContext.SetLastResult
This commit is contained in:
parent
3fd0cb5270
commit
ab514ede04
|
|
@ -86,8 +86,8 @@ namespace Elsa.Services.Models
|
|||
public Task<T> EvaluateAsync<T>(IWorkflowExpression<T> expression, CancellationToken cancellationToken) =>
|
||||
ExpressionEvaluator.EvaluateAsync(expression, this, cancellationToken);
|
||||
|
||||
public void SetLastResult(object value) => CurrentScope.LastResult = (JValue)value;
|
||||
public void SetLastResult(JValue value) => CurrentScope.LastResult = value;
|
||||
public void SetLastResult(object value) => SetLastResult(JToken.FromObject(value));
|
||||
public void SetLastResult(JToken value) => CurrentScope.LastResult = value;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageVersion>1.0.0</PackageVersion>
|
||||
<Authors>Elsa Contributors</Authors>
|
||||
<Description>
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ namespace Sample17.Activities
|
|||
var age = await expressionEvaluator.EvaluateAsync(AgeExpression, context, cancellationToken);
|
||||
var person = new Person { FullName = name, Age = age };
|
||||
|
||||
Output["Person"] = person;
|
||||
Output["FullName"] = person.FullName;
|
||||
Output["Age"] = person.Age;
|
||||
Output.SetVariable("Person", person);
|
||||
Output.SetVariable("FullName", person.FullName);
|
||||
Output.SetVariable("Age", person.Age);
|
||||
|
||||
return Done();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue