View ConfigureJavaScriptEngineWithCustomFunctions1.cs
This file contains 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 | |
{ |
View ArchiveDocument.cs
This file contains 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; |
View StartDocumentWorkflows.cs
This file contains 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 | |
{ |
View CoreServiceCollectionExtensions.cs
This file contains 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) |
View ServiceCollectionExtensions.cs
This file contains 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 |
View Startup.cs
This file contains 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; |
View ElsaWorkflows.snippet.cs
This file contains 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; |
View ElsaWorkflows.snippet.cs
This file contains 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) |
View ElsaWorkflows.snippet.cs
This file contains 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}"); | |
} | |
} |
View QuartzJob.snippet.cs
This file contains 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
services.AddQuartz(quartz => | |
{ | |
quartz.AddJob<MyJob>(j => j.WithIdentity("MyJob")); | |
quartz.AddTrigger(t => t | |
.ForJob("MyJob") | |
.StartNow() | |
.WithCronSchedule("* * * * * * *")); | |
}); |
NewerOlder