Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to retrieve memory block with reference e5096ef278eb4cbeb42fc42ac22a0f15 #6171

Open
franjosuerr opened this issue Dec 2, 2024 Discussed in #6167 · 1 comment
Open

Comments

@franjosuerr
Copy link

Captura de pantalla 2024-11-29 164409

Discussed in #6167

Originally posted by franjosuerr November 29, 2024
at Elsa.Expressions.Models.ExpressionExecutionContext.GetBlock(MemoryBlockReference blockReference) at Elsa.Expressions.Models.ExpressionExecutionContext.Get(MemoryBlockReference blockReference) at Elsa.Expressions.Models.MemoryBlockReference.Get(ExpressionExecutionContext context) at Elsa.Workflows.Expressions.VariableExpressionHandler.EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options) at Elsa.Expressions.Services.ExpressionEvaluator.EvaluateAsync(Expression expression, Type returnType, ExpressionExecutionContext context, ExpressionEvaluatorOptions options) at Elsa.Extensions.ActivityExecutionContextExtensions.EvaluateInputPropertyAsync(ActivityExecutionContext context, ActivityDescriptor activityDescriptor, InputDescriptor inputDescriptor) at Elsa.Extensions.ActivityExecutionContextExtensions.EvaluateInputPropertiesAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.EvaluateInputPropertiesAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.DefaultActivityInvokerMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.NotificationPublishingMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.ExecutionLogMiddleware.InvokeAsync(ActivityExecutionContext context) at Elsa.Workflows.Middleware.Activities.ExceptionHandlingMiddleware.InvokeAsync(ActivityExecutionContext context)

When I run a flowchart workflow where I pass a numeric value to an activity as a parameter, I get this error. I fix it by removing the default constructor in this activity, but when I remove it, I get a JSON exception. According to the documentation, the default constructor is necessary, but it blocks the execution of the activities.

@franjosuerr
Copy link
Author

thanks to @sfmskywalker i solved it
He recommended me:
1-On the Activity class, make sure it has a default constructor that is decorated with the [JsonConstructor] attribute.
2-In the workflow class, make sure that the variables are scoped to the workflow. builder.WithVariable is a helper for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant