question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to update workflow definition through designer using ef core for persistency

See original GitHub issue

Hey, when I try to update an existing workflow through the designer I get the following error. I am using version 2.0.0.159

[02:24:02 ERR] An unhandled exception has occurred while executing the request.
Newtonsoft.Json.JsonSerializationException: Error reading object reference '6'. Path 'activities[1].properties[0].name', line 36, position 17.
 ---> System.ArgumentException: A different value already has the Id '6'.
   at Newtonsoft.Json.Utilities.BidirectionalDictionary`2.Set(TFirst first, TSecond second)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.AddReference(JsonReader reader, String id, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.AddReference(JsonReader reader, String id, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkWorkflowDefinitionStore.OnLoading(ElsaContext dbContext, WorkflowDefinition entity)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.ReadShadowProperties(ElsaContext dbContext, T entity)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.<>c__DisplayClass12_1.<FindManyAsync>b__1(T x)
   at System.Linq.Enumerable.SelectListIterator`2.ToList()
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.<>c__DisplayClass12_0.<<FindManyAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.DoWork[TResult](Func`2 work, CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.DoWork[TResult](Func`2 work, CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.FindManyAsync(ISpecification`1 specification, IOrderBy`1 orderBy, IPaging paging, CancellationToken cancellationToken)
   at Elsa.WorkflowProviders.DatabaseWorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.WorkflowProviders.DatabaseWorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at Elsa.Services.WorkflowRegistry.ListAsync(CancellationToken cancellationToken)
   at Open.Linq.AsyncExtensions.Extensions.ToList[TSource](Task`1 source)
   at Elsa.Decorators.CachingWorkflowRegistry.<>c__DisplayClass10_0.<<GetWorkflowBlueprints>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
   at Elsa.Decorators.CachingWorkflowRegistry.GetWorkflowBlueprints(CancellationToken cancellationToken)
   at Elsa.Decorators.CachingWorkflowRegistry.FindManyAsync(Func`2 predicate, CancellationToken cancellationToken)
   at Elsa.Activities.Http.Middleware.HttpEndpointMiddleware.InvokeAsync(HttpContext httpContext, IWorkflowLaunchpad workflowLaunchpad, IWorkflowInstanceStore workflowInstanceStore, IWorkflowRegistry workflowRegistry, IWorkflowBlueprintReflector workflowBlueprintReflector, IEnumerable`1 contentParsers)
   at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
   at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
[02:24:02 INF] Request finished HTTP/2 POST https://localhost:44339/v1/workflow-definitions application/json;charset=UTF-8 1807 - 500 - text/plain 114.5062ms

If I then stop the application I can not even restart it because of this error.

[02:28:59 FTL] Host terminated unexpectedly!
Newtonsoft.Json.JsonSerializationException: Error reading object reference '6'. Path 'activities[1].properties[0].name', line 36, position 17.
 ---> System.ArgumentException: A different value already has the Id '6'.
   at Newtonsoft.Json.Utilities.BidirectionalDictionary`2.Set(TFirst first, TSecond second)
   at Newtonsoft.Json.Serialization.DefaultReferenceResolver.AddReference(Object context, String reference, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.AddReference(JsonReader reader, String id, Object value)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.AddReference(JsonReader reader, String id, Object value)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeAnonymousType[T](String value, T anonymousTypeObject, JsonSerializerSettings settings)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkWorkflowDefinitionStore.OnLoading(ElsaContext dbContext, WorkflowDefinition entity)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.ReadShadowProperties(ElsaContext dbContext, T entity)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.<>c__DisplayClass12_1.<FindManyAsync>b__1(T x)
   at System.Linq.Enumerable.SelectListIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.<>c__DisplayClass12_0.<<FindManyAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.DoWork[TResult](Func`2 work, CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.DoWork[TResult](Func`2 work, CancellationToken cancellationToken)
   at Elsa.Persistence.EntityFramework.Core.Stores.EntityFrameworkStore`1.FindManyAsync(ISpecification`1 specification, IOrderBy`1 orderBy, IPaging paging, CancellationToken cancellationToken)
   at Elsa.WorkflowProviders.DatabaseWorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.WorkflowProviders.DatabaseWorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at Elsa.Services.WorkflowRegistry.ListAsync(CancellationToken cancellationToken)
   at Elsa.Services.WorkflowRegistry.ListActiveWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
   at Elsa.Services.WorkflowRegistry.ListActiveWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
   at Elsa.Services.WorkflowRegistry.ListActiveAsync(CancellationToken cancellationToken)
   at Elsa.Triggers.TriggerIndexer.IndexTriggersAsync(CancellationToken cancellationToken)
   at Elsa.StartupTasks.IndexTriggers.ExecuteAsync(CancellationToken cancellationToken)
   at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
   at Elsa.HostedServices.StartupRunnerHostedService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at CantorPowerTools.Program.Main(String[] args) in C:\Repos\CantorPowerTools\src\CantorPowerTools.HttpApi.Host\Program.cs:line 32

Workflow Version 1:

{
  "$id": "1",
  "activities": [
    {
      "$id": "2",
      "activityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "type": "Cron",
      "displayName": "Cron",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": false,
      "properties": [
        {
          "$id": "3",
          "name": "CronExpression",
          "expressions": {
            "$id": "4",
            "Literal": "0 * * ? * * *"
          }
        }
      ]
    },
    {
      "$id": "5",
      "activityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "type": "ExecuteSelectQuery",
      "displayName": "Execute select SQL Query",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": true,
      "properties": [
        {
          "$id": "6",
          "name": "CantorConnectInformationId",
          "expressions": {
            "$id": "7",
            "Literal": "122633de-6b89-7e45-faaa-39fd94479d30"
          }
        },
        {
          "$id": "8",
          "name": "SqlFullFilename",
          "expressions": {
            "$id": "9",
            "Literal": "C:\\Repos\\cantor-setup\\scripts\\select_mitarb.sql"
          }
        }
      ]
    }
  ],
  "connections": [
    {
      "$id": "10",
      "sourceActivityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "targetActivityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "outcome": "Done"
    }
  ],
  "variables": {
    "$id": "11",
    "data": {}
  },
  "customAttributes": {
    "$id": "12",
    "data": {}
  }
}

Workflow Version 2:

{
  "$id": "1",
  "activities": [
    {
      "$id": "2",
      "activityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "type": "Cron",
      "displayName": "Cron",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": false,
      "properties": [
        {
          "$id": "3",
          "name": "CronExpression",
          "expressions": {
            "$id": "6",
            "Literal": "0 * * ? * * *"
          }
        }
      ]
    },
    {
      "$id": "5",
      "activityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "type": "ExecuteSelectQuery",
      "displayName": "Execute select SQL Query",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": true,
      "properties": [
        {
          "$id": "6",
          "name": "CantorConnectInformationId",
          "expressions": {
            "$id": "9",
            "Literal": "122633de-6b89-7e45-faaa-39fd94479d30"
          }
        },
        {
          "$id": "8",
          "name": "SqlFullFilename",
          "expressions": {
            "$id": "11",
            "Literal": "C:\\Repos\\cantor-setup\\scripts\\select_mitarb.sql"
          }
        }
      ]
    },
    {
      "$id": "10",
      "activityId": "b19f147e-9d72-4861-806b-8c4b514da87c",
      "type": "WriteLine",
      "displayName": "Write Line",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": false,
      "properties": [
        {
          "$id": "11",
          "name": "Text",
          "syntax": "Liquid",
          "expressions": {
            "$id": "12",
            "Literal": "",
            "JavaScript": "",
            "Liquid": "{{ Activities.ExecuteSelectQuery.Output }}"
          }
        }
      ]
    }
  ],
  "connections": [
    {
      "$id": "13",
      "sourceActivityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "targetActivityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "outcome": "Done"
    },
    {
      "$id": "14",
      "sourceActivityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "targetActivityId": "b19f147e-9d72-4861-806b-8c4b514da87c",
      "outcome": "Done"
    }
  ],
  "variables": {
    "$id": "15",
    "data": {}
  },
  "customAttributes": {
    "$id": "16",
    "data": {}
  }
}

If I manually update version 2 to the following the application starts again:

{
  "$id": "1",
  "activities": [
    {
      "$id": "2",
      "activityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "type": "Cron",
      "displayName": "Cron",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": false,
      "properties": [
        {
          "$id": "3",
          "name": "CronExpression",
          "expressions": {
            "$id": "4",
            "Literal": "0 * * ? * * *"
          }
        }
      ]
    },
    {
      "$id": "5",
      "activityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "type": "ExecuteSelectQuery",
      "displayName": "Execute select SQL Query",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": true,
      "properties": [
        {
          "$id": "6",
          "name": "CantorConnectInformationId",
          "expressions": {
            "$id": "7",
            "Literal": "122633de-6b89-7e45-faaa-39fd94479d30"
          }
        },
        {
          "$id": "8",
          "name": "SqlFullFilename",
          "expressions": {
            "$id": "9",
            "Literal": "C:\\Repos\\cantor-setup\\scripts\\select_mitarb.sql"
          }
        }
      ]
    },
    {
      "$id": "10",
      "activityId": "b19f147e-9d72-4861-806b-8c4b514da87c",
      "type": "WriteLine",
      "displayName": "Write Line",
      "persistWorkflow": false,
      "loadWorkflowContext": false,
      "saveWorkflowContext": false,
      "persistOutput": false,
      "properties": [
        {
          "$id": "11",
          "name": "Text",
          "syntax": "Liquid",
          "expressions": {
            "$id": "12",
            "Literal": "",
            "JavaScript": "",
            "Liquid": "{{ Activities.ExecuteSelectQuery.Output }}"
          }
        }
      ]
    }
  ],
  "connections": [
    {
      "$id": "13",
      "sourceActivityId": "8b268826-7b0c-49df-9b47-0b9638ef85f1",
      "targetActivityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "outcome": "Done"
    },
    {
      "$id": "14",
      "sourceActivityId": "1f8b520f-8464-4995-961c-73b654c58171",
      "targetActivityId": "b19f147e-9d72-4861-806b-8c4b514da87c",
      "outcome": "Done"
    }
  ],
  "variables": {
    "$id": "15",
    "data": {}
  },
  "customAttributes": {
    "$id": "16",
    "data": {}
  }
}

it seems like $id is not incremented correctly.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SayHelloGsxcommented, Jul 14, 2021

I have the same problem. I use elsa with abp. It should be system.json problem. Use this code disable system.json. Use newtonsoft instead of system.json public override void PreConfigureServices(ServiceConfigurationContext context) { PreConfigure<AbpJsonOptions>(options => { options.UseHybridSerializer = false; }); }

1reaction
nebula2commented, Jul 10, 2021

I want to test a few more things out and provide something reproducable.

Also forgot to mention that i am using blazor wasm.

I tried to run the sample dashboard applications but somehow neither the blazor wasm sample nor the aspnetcore one do even show the dashboard for me.

As soon as I have this all together I will make an update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workflow instances are not persisted when they should be
This issue is to diagnose and fix this issue with workflow persistence. It has been proven to affect MongoDb and also anecdotally affects...
Read more >
Problem fetching workflow intance from DB
I'm pretty sure this is an issue with the EF Core persistence provider for Elsa 1.x. Elsa 2 makes sure this doesn't happen...
Read more >
What's New in Windows Workflow Foundation in .NET ...
Windows Workflow Foundation in .NET Framework 4.5 introduces many new features, such as new activities, designer capabilities, and workflow ...
Read more >
Setting up the Dashboard and Workflow Host · ELSA
In this guide, we will see what it takes to setup the Dashboard and a Workflow Host that will run workflows created from...
Read more >
Data persistence in Xamarin using Entity Framework Core
Let's start by creating a subclass of DbContext called PostDatabaseContext . There, we'll first define the SQLite database path by overriding ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found