OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.43k stars 2.4k forks source link

Implement workflow versioning and keep the existing instance upon import #15496

Open hyzx86 opened 7 months ago

hyzx86 commented 7 months ago

Is your feature request related to a problem? Please describe.

At present, the imported workflow type always cleans up the workflow instances of the process.

In some cases, we want to keep them, otherwise the process in progress will be cleaned up.

Describe the solution you'd like

There was a note in the source code before, which gave the scheme. We should implement the workflow version.

Describe alternatives you've considered

No

sebastienros commented 7 months ago

I assume this is cleaned up because the instances might be in a state that is incompatible with the new definition? Can you link to the code that is doing it?

An option could be to have a flag in the workflow definition step to not clean the instances.

hyzx86 commented 7 months ago

Yes, here , at line 77.

https://github.com/OrchardCMS/OrchardCore/blob/7d83e81af56809a2dc8669ca25f12b40ea9ad8ca/src/OrchardCore.Modules/OrchardCore.Workflows/Recipes/WorkflowTypeStep.cs#L49-L80

hyzx86 commented 7 months ago

And here

https://github.com/OrchardCMS/OrchardCore/blob/7d83e81af56809a2dc8669ca25f12b40ea9ad8ca/src/OrchardCore.Modules/OrchardCore.Workflows/Services/WorkflowTypeStore.cs#L71-L84