| | | 1 | | using Elsa.Workflows.Management; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Runtime; |
| | | 4 | | |
| | | 5 | | /// <inheritdoc /> |
| | 138 | 6 | | public class DefaultRegistriesPopulator(IWorkflowDefinitionStorePopulator workflowDefinitionStorePopulator, IActivityReg |
| | | 7 | | { |
| | | 8 | | /// <inheritdoc /> |
| | | 9 | | public async Task PopulateAsync(CancellationToken cancellationToken = default) |
| | | 10 | | { |
| | | 11 | | // Stage 1: Populate the activity registry. |
| | | 12 | | // Because workflow definitions can be used as activities, we need to make sure that the activity registry is po |
| | 139 | 13 | | await activityRegistryPopulator.PopulateRegistryAsync(cancellationToken); |
| | | 14 | | |
| | | 15 | | // Stage 2: Populate the workflow definition store. |
| | 139 | 16 | | await workflowDefinitionStorePopulator.PopulateStoreAsync(false, cancellationToken); |
| | | 17 | | |
| | | 18 | | // Stage 3: Re-populate the activity registry. |
| | | 19 | | // After the workflow definition store has been populated, we need to re-populate the activity registry to make |
| | 139 | 20 | | await activityRegistryPopulator.PopulateRegistryAsync(cancellationToken); |
| | | 21 | | |
| | | 22 | | // Stage 4. Re-update the workflow definition store with the current set of activities. |
| | | 23 | | // Finally, we need to re-populate the workflow definition store to make sure that the workflow definitions are |
| | 139 | 24 | | await workflowDefinitionStorePopulator.PopulateStoreAsync(true, cancellationToken); |
| | 139 | 25 | | } |
| | | 26 | | } |