Add warning for ID mismatch in workflow definitions
Added a check and corresponding log warning in the 'DefaultWorkflowDefinitionStorePopulator' class for cases where an imported workflow definition has a different ID than the existing one in the store. This will help in identifying ID discrepancies that may impact workflow execution or management. Future updates may include storing these discrepancies for troubleshooting purposes.
This commit is contained in:
parent
65604b6563
commit
dc2184fba4
|
|
@ -129,7 +129,17 @@ public class DefaultWorkflowDefinitionStorePopulator : IWorkflowDefinitionStoreP
|
|||
var workflowDefinitionsToSave = new HashSet<WorkflowDefinition>();
|
||||
|
||||
if (existingDefinitionVersion != null)
|
||||
{
|
||||
workflowDefinitionsToSave.Add(existingDefinitionVersion);
|
||||
|
||||
if(existingDefinitionVersion.Id != workflow.Identity.Id)
|
||||
{
|
||||
// It's possible that the imported workflow definition has a different ID than the existing one in the store.
|
||||
// In a future update, we might store this discrepancy in a "troubleshooting" table and provide tooling for managing these, and other, discrepancies.
|
||||
// See https://github.com/elsa-workflows/elsa-core/issues/5540
|
||||
_logger.LogWarning("Workflow with ID {WorkflowId} already exists with a different ID {ExistingWorkflowId}", workflow.Identity.Id, existingDefinitionVersion.Id);
|
||||
}
|
||||
}
|
||||
|
||||
await UpdateIsLatest();
|
||||
await UpdateIsPublished();
|
||||
|
|
|
|||
Loading…
Reference in a new issue