workflow-core
workflow-core copied to clipboard
WorkflowCompleted event never get published by SingleNodeEventHub (simple example included)
Describe the bug
The WorkflowCompleted event never gets published when a workflow completes.
To Reproduce See this GitHub repo: https://github.com/mamift/WorkflowCoreTests
Expected behavior
The WorkflowCompleted should get published by the SingleNodeEventHub when the workflow completes.
Additional context
I was playing around with this gist to asynchronously await workflow completion, but it never worked for me; hanging as if deadlocked, but now I realised it wasn't because of the aforementioned gist code, it's because WorkflowCompleted never got published. For instance at this [line],(https://github.com/mamift/WorkflowCoreTests/blob/e75cac0aa2b092725ee2ce5ae8eabac3f2051ef7/SimpleWfTest/Program.cs#L31), it simply never triggers.
I suspect too in my simple example (link above) I may be using the API wrong, but I based it off the HelloWorld example found here.
@danielgerlag I've created PR to fix this https://github.com/danielgerlag/workflow-core/pull/912 please have a look.
My impression is that it would be better to re-factor DetermineNextExecutionTime and move notification out of it. I will experiment with this later. Now I think we need just a quick fix in production.
@danielgerlag it has been about 5 month since I've provided quick fix. Any feedback on it?