Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ await host.RunAsync();

```csharp
using ConductorSharp.Engine.Builders.Metadata;
using ConductorSharp.Engine.Interface;
using MediatR;
using ConductorSharp.Engine;

public class PrepareEmailRequest : IRequest<PrepareEmailResponse>
{
Expand All @@ -103,7 +102,7 @@ public class PrepareEmailResponse
[OriginalName("EMAIL_prepare")]
public class PrepareEmailHandler : TaskRequestHandler<PrepareEmailRequest, PrepareEmailResponse>
{
public async Task<PrepareEmailResponse> Handle(PrepareEmailRequest request, CancellationToken cancellationToken)
public override async Task<PrepareEmailResponse> Handle(PrepareEmailRequest request, CancellationToken cancellationToken)
{
var body = $"Hello {request.CustomerName} at {request.Address}!";
return new PrepareEmailResponse { EmailBody = body };
Expand Down Expand Up @@ -135,8 +134,8 @@ public class SendNotificationWorkflow : Workflow<SendNotificationWorkflow, SendN
WorkflowDefinitionBuilder<SendNotificationWorkflow, SendNotificationInput, SendNotificationOutput> builder
) : base(builder) { }

public CustomerGetV1 GetCustomer { get; set; }
public EmailPrepareV1 PrepareEmail { get; set; }
public GetCustomerHandler GetCustomer { get; set; }
public PrepareEmailHandler PrepareEmail { get; set; }

public override void BuildDefinition()
{
Expand Down Expand Up @@ -175,8 +174,8 @@ public class MyWorkflow : Workflow<MyWorkflow, MyWorkflowInput, MyWorkflowOutput
: base(builder) { }

// Task properties - these become task references in the workflow
public SomeTaskV1 FirstTask { get; set; }
public AnotherTaskV1 SecondTask { get; set; }
public SomeTaskHandler FirstTask { get; set; }
public AnotherTaskHandler SecondTask { get; set; }

public override void BuildDefinition()
{
Expand Down Expand Up @@ -729,7 +728,7 @@ builder.Services.AddHealthChecks()
Access workflow/task metadata in handlers:

```csharp
public class MyHandler : ITaskRequestHandler<MyRequest, MyResponse>
public class MyHandler : TaskRequestHandler<MyRequest, MyResponse>
{
private readonly ConductorSharpExecutionContext _context;

Expand All @@ -738,7 +737,7 @@ public class MyHandler : ITaskRequestHandler<MyRequest, MyResponse>
_context = context;
}

public async Task<MyResponse> Handle(MyRequest request, CancellationToken cancellationToken)
public override async Task<MyResponse> Handle(MyRequest request, CancellationToken cancellationToken)
{
var workflowId = _context.WorkflowId;
var taskId = _context.TaskId;
Expand Down
Loading
Loading