diff --git a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/Workflow.cs b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/Workflow.cs index 9e9fbacd4..711328af9 100644 --- a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/Workflow.cs +++ b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/Workflow.cs @@ -1,5 +1,4 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -70,7 +69,7 @@ namespace LINGYUN.Abp.WorkflowCore.Persistence IGuidGenerator guidGenerator, ICurrentTenant currentTenant) { - Data = JsonConvert.SerializeObject(instance.Data); + Data = instance.Data.SerializeObject(); CreationTime = instance.CreateTime; WorkflowDefinitionId = instance.WorkflowDefinitionId; Version = instance.Version; diff --git a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/WorkflowExecutionPointer.cs b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/WorkflowExecutionPointer.cs index 6fb62299f..0ed49aba8 100644 --- a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/WorkflowExecutionPointer.cs +++ b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore.Persistence/LINGYUN/Abp/WorkflowCore/Persistence/WorkflowExecutionPointer.cs @@ -1,9 +1,7 @@ -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; using WorkflowCore.Models; @@ -114,16 +112,16 @@ namespace LINGYUN.Abp.WorkflowCore.Persistence StepId = pointer.StepId; StepName = pointer.StepName; Active = pointer.Active; - PersistenceData = JsonConvert.SerializeObject(pointer.PersistenceData); + PersistenceData = pointer.PersistenceData.SerializeObject(); EventName = pointer.EventName; EventKey = pointer.EventKey; EventPublished = pointer.EventPublished; - EventData = JsonConvert.SerializeObject(pointer.EventData); + EventData = pointer.EventData.SerializeObject(); RetryCount = pointer.RetryCount; Children = pointer.Children.JoinAsString(";"); - ContextItem = JsonConvert.SerializeObject(pointer.ContextItem); + ContextItem = pointer.ContextItem.SerializeObject(); PredecessorId = pointer.PredecessorId; - Outcome = JsonConvert.SerializeObject(pointer.Outcome); + Outcome = pointer.Outcome.SerializeObject(); Scope = pointer.Scope.JoinAsString(";"); Status = pointer.Status; SleepUntil = pointer.SleepUntil; @@ -135,8 +133,7 @@ namespace LINGYUN.Abp.WorkflowCore.Persistence var findAttr = FindAttribute(attribute.Key); if (findAttr == null) { - findAttr = new WorkflowExtensionAttribute(Id, attribute.Key, attribute.Value.SerializeObject()); - + AddAttribute(attribute.Key, attribute.Value.SerializeObject()); } else { diff --git a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore/System/ObjectSerializerExtensions.cs b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore/System/ObjectSerializerExtensions.cs index 898edaaf8..f157609ac 100644 --- a/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore/System/ObjectSerializerExtensions.cs +++ b/aspnet-core/modules/workflow/LINGYUN.Abp.WorkflowCore/System/ObjectSerializerExtensions.cs @@ -8,6 +8,10 @@ namespace System public static string SerializeObject(this object obj, JsonSerializerSettings serializerSettings = null) { + if (obj is string objStr) + { + return objStr; + } return JsonConvert.SerializeObject(obj, serializerSettings ?? SerializerSettings); }