Skip to content

Commit

Permalink
feat: Added typed workflow support
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Jun 20, 2024
1 parent 04ccdc1 commit c9a6411
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/WorkflowEngine.Core/IWorkflow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;

namespace WorkflowEngine.Core
{
Expand All @@ -14,5 +14,9 @@ public interface IWorkflow // Documentet

}

public interface IWorkflowInputs<TInput> where TInput : class
{

}

}
3 changes: 3 additions & 0 deletions src/WorkflowEngine.Core/IWorkflowExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Security.Claims;
using System.Threading.Tasks;

namespace WorkflowEngine.Core
Expand All @@ -16,6 +17,8 @@ public T CopyTo<T>(T other)
other.PrincipalId = PrincipalId;
return other;
}


}
public interface IWorkflowExecutor
{
Expand Down
7 changes: 6 additions & 1 deletion src/WorkflowEngine.Core/Workflow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;

namespace WorkflowEngine.Core
Expand All @@ -24,6 +24,11 @@ public string ToString(string format, IFormatProvider formatProvider)
return string.Empty;
}
}
public class Workflow<TInput> : Workflow, IWorkflowInputs<TInput>
where TInput : class
{

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
jobs.AddOrUpdate(workflow.Id.ToString() + trigger.Key,
(System.Linq.Expressions.Expression<System.Action<IHangfireWorkflowExecutor>>)((executor) => executor.TriggerAsync(new TriggerContext
{
PrincipalId = "1b714972-8d0a-4feb-b166-08d93c6ae328",
Workflow = workflow,
Trigger = new Trigger
{
Expand Down

0 comments on commit c9a6411

Please sign in to comment.