4 changed files with 100 additions and 1 deletions
@ -0,0 +1,42 @@ |
|||||
|
using Elsa.Mediator.Contracts; |
||||
|
using Elsa.Workflows.Notifications; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using Microsoft.Extensions.Logging.Abstractions; |
||||
|
using System; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace LINGYUN.Abp.ElsaNext.Notifications.Handlers; |
||||
|
|
||||
|
public class ActivityNotificationHandler : |
||||
|
INotificationHandler<ActivityExecuting>, |
||||
|
INotificationHandler<ActivityExecuted>, |
||||
|
INotificationHandler<ActivityCancelled>, |
||||
|
INotificationHandler<ActivityCompleted> |
||||
|
{ |
||||
|
public ILogger<ActivityNotificationHandler> Logger { protected get; set; } |
||||
|
public ActivityNotificationHandler() |
||||
|
{ |
||||
|
Logger = NullLogger<ActivityNotificationHandler>.Instance; |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(ActivityExecuting notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(ActivityExecuted notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(ActivityCancelled notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(ActivityCompleted notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
using Elsa.Mediator.Contracts; |
||||
|
using Elsa.Workflows.Notifications; |
||||
|
using Elsa.Workflows.Runtime.Notifications; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using Microsoft.Extensions.Logging.Abstractions; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace LINGYUN.Abp.ElsaNext.Notifications.Handlers; |
||||
|
|
||||
|
public class WorkflowNotificationHandler : |
||||
|
INotificationHandler<WorkflowExecuting>, |
||||
|
INotificationHandler<WorkflowStarted>, |
||||
|
INotificationHandler<WorkflowFinished>, |
||||
|
INotificationHandler<WorkflowExecuted>, |
||||
|
INotificationHandler<WorkflowCancelling>, |
||||
|
INotificationHandler<WorkflowCancelled> |
||||
|
{ |
||||
|
public ILogger<WorkflowNotificationHandler> Logger { protected get; set; } |
||||
|
public WorkflowNotificationHandler() |
||||
|
{ |
||||
|
Logger = NullLogger<WorkflowNotificationHandler>.Instance; |
||||
|
} |
||||
|
public async virtual Task HandleAsync(WorkflowExecuting notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(WorkflowStarted notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(WorkflowFinished notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(WorkflowExecuted notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(WorkflowCancelling notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
|
||||
|
public async virtual Task HandleAsync(WorkflowCancelled notification, CancellationToken cancellationToken) |
||||
|
{ |
||||
|
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString()); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue