bugfixing issues related to new PropertyBag in workflow definition (#5778)

This commit is contained in:
Mohamed Ali 2024-07-16 15:54:20 +03:00 committed by GitHub
parent 49c0a29427
commit a0846effae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -22,7 +22,7 @@ public static class PropertyBagExtensions
if (!propertyBag.TryGetValue(key, out var value))
return defaultValue();
var json = (string)value;
var json = value.ToString();
return JsonSerializer.Deserialize<T>(json);
}

View file

@ -79,7 +79,8 @@ internal class Post(
draft.Name = model.Name?.Trim();
draft.ToolVersion = model.ToolVersion;
draft.Description = model.Description?.Trim();
draft.CustomProperties = model.CustomProperties ?? new Dictionary<string, object>();
draft.CustomProperties = model.CustomProperties ?? new Dictionary<string, object>();
draft.PropertyBag = model.PropertyBag ?? new PropertyBag();
draft.Variables = variables;
draft.Inputs = inputs;
draft.Outputs = outputs;

View file

@ -63,7 +63,8 @@ namespace Elsa.Workflows.Management.Services
draft.MaterializerName = JsonWorkflowMaterializer.MaterializerName;
draft.Name = model.Name?.Trim();
draft.Description = model.Description?.Trim();
draft.CustomProperties = model.CustomProperties ?? new Dictionary<string, object>();
draft.CustomProperties = model.CustomProperties ?? new Dictionary<string, object>();
draft.PropertyBag = model.PropertyBag ?? new PropertyBag();
draft.Variables = variables;
draft.Inputs = model.Inputs ?? new List<InputDefinition>();
draft.Outputs = model.Outputs ?? new List<OutputDefinition>();