Fix Break activity
This commit is contained in:
parent
66dabb8ce9
commit
fe915fc6fd
|
|
@ -157,5 +157,19 @@ namespace Elsa.Services.Models
|
|||
public T? GetOutputFrom<T>(string activityName, T? defaultValue) => (T?) GetOutputFrom(activityName, () => defaultValue)!;
|
||||
public void SetWorkflowContext(object? value) => WorkflowExecutionContext.SetWorkflowContext(value);
|
||||
public T GetWorkflowContext<T>() => WorkflowExecutionContext.GetWorkflowContext<T>();
|
||||
|
||||
public JObject GetActivityData(string activityId)
|
||||
{
|
||||
var activityData = WorkflowInstance.ActivityData;
|
||||
var state = activityData.ContainsKey(activityId) ? activityData[activityId] : default;
|
||||
|
||||
if (state != null)
|
||||
return state;
|
||||
|
||||
state = new JObject();
|
||||
activityData[activityId] = state;
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ namespace Elsa.Activities.ControlFlow
|
|||
var supportedScope = query.FirstOrDefault();
|
||||
|
||||
if(supportedScope != null)
|
||||
context.WorkflowInstance.ActivityData[supportedScope.ActivityId].SetState("Break", true);
|
||||
context.GetActivityData(supportedScope.ActivityId).SetState("Break", true);
|
||||
|
||||
return Done();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue