elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.49k stars 1.2k forks source link

[BUG]Why the "ActivityExecuted" Implement Can't get the "Completed" status of Container activity? #5365

Open coolshun opened 6 months ago

coolshun commented 6 months ago

I Implement "ActivityExecuted" and "ActivityExecuting" to get the status of Activity,but I cant get the "Completed" status of Container Activity(the type is "Elsa.FlowNode"),only geted "Pending"、"Running".

glime-ai[bot] commented 6 months ago

Based on the information provided, it seems that you are trying to capture the "Completed" status of a container activity within Elsa Workflows, but you are only able to get "Pending" and "Running" statuses. This could be due to the way the workflow execution lifecycle is managed within Elsa, or it might be related to the specific implementation of your ActivityExecuted and ActivityExecuting event handlers.

Elsa Workflows has a concept of middleware that can be used to intercept the workflow execution pipeline. You can implement IActivityExecutionMiddleware to create custom middleware that can capture various activity statuses. However, capturing the "Completed" status of a container activity might require additional considerations, such as subscribing to events or notifications that Elsa might publish when activities change their status.

If you are using Elsa 3.0, as indicated in one of the GitHub issues, you might want to look into the event system that Elsa provides. Elsa 3.0 has an event bus that publishes events for various workflow and activity lifecycle events, including when an activity is executed and completed.

To troubleshoot further, you may want to:

  1. Ensure that your middleware is correctly registered and configured in your application.
  2. Verify that you are subscribing to the correct events or using the middleware pipeline correctly to capture the "Completed" status.
  3. Check the Elsa documentation and community forums for any known issues or updates related to activity status events.

If you continue to face issues, consider reaching out to the Elsa community or creating an issue on the Elsa GitHub repository for more specific guidance.

This comment was generated by Glime.