This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>Groundwork: Modular Persistence Without Relational Lock-In</title> | |
| <meta name="description" content="Groundwork came from a concrete Elsa maintenance problem: avoiding per-module EF Core migrations across providers, without giving up document databases such as MongoDB." /> | |
| <link rel="canonical" href="https://www.elsaworkflows.io/blog/groundwork-and-the-persistence-boundary-in-elsa" /> | |
| <meta property="og:type" content="article" /> | |
| <meta property="og:title" content="Groundwork: Modular Persistence Without Relational Lock-In" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Elsa.Scripting.JavaScript.Events; | |
| using Elsa.Scripting.JavaScript.Messages; | |
| using MediatR; | |
| using Microsoft.AspNetCore.StaticFiles; | |
| namespace DocumentManagement.Workflows.Scripting.JavaScript | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading.Tasks; | |
| using DocumentManagement.Core.Models; | |
| using DocumentManagement.Core.Services; | |
| using Elsa.ActivityResults; | |
| using Elsa.Attributes; | |
| using Elsa.Expressions; | |
| using Elsa.Providers.WorkflowStorage; | |
| using Elsa.Services; | |
| using Elsa.Services.Models; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using DocumentManagement.Core.Events; | |
| using Elsa.Models; | |
| using Elsa.Services; | |
| using MediatR; | |
| using Open.Linq.AsyncExtensions; | |
| namespace DocumentManagement.Workflows.Handlers | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using DocumentManagement.Core.Options; | |
| using DocumentManagement.Core.Services; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Storage.Net; | |
| namespace DocumentManagement.Core.Extensions | |
| { | |
| public static class ServiceCollectionExtensions | |
| { | |
| public static IServiceCollection AddDomainServices(this IServiceCollection services) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using Elsa.Persistence.EntityFramework.Core.Extensions; | |
| using Elsa.Providers.Workflows; | |
| using Elsa.Server.Hangfire.Extensions; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Storage.Net; | |
| namespace DocumentManagement.Workflows.Extensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using DocumentManagement.Workflows.Extensions; | |
| using Elsa.Activities.Email.Options; | |
| using Elsa.Activities.Http.Options; | |
| using Elsa.Persistence.EntityFramework.Sqlite; | |
| using Elsa.Server.Hangfire.Extensions; | |
| using Hangfire; | |
| using Hangfire.SQLite; | |
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.Configuration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ThisIsMyMonday : IWorkflow | |
| { | |
| private ITrashCleanupService _cleanupService; | |
| private IDogWalkingService _dogWalkingService; | |
| private IDishCleaningService _dishCleaningService; | |
| public CleanTrash(ITrashCleanupService cleanupService, IDogWalkingService dogWalkingService, IDishCleaningService dishCleaningService) | |
| { | |
| _cleanupService = cleanupService; | |
| _dogWalkingService = dogWalkingService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CleanTrash : IWorkflow | |
| { | |
| private ITrashCleanupService _cleanupService; | |
| public CleanTrash(ITrashCleanupService cleanupService) | |
| { | |
| _cleanupService = cleanupService; | |
| } | |
| public void Build(IWorkflowBuilder workflow) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyJob : IWorkflow | |
| { | |
| public void Build(IWorkflowBuilder workflow) | |
| { | |
| workflow | |
| .Cron("* * * * * * *") | |
| .WriteLine(() => $"CRON event at {DateTime.Now}"); | |
| } | |
| } |
NewerOlder