elsa-workflows / elsa-workflows/elsa-core
EventBase the best CompleteActivity position
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Enhancement Request
### Enhancement Overview
Elsa: 3.5 RC1. EventBase.EventReceivedAsync. await context.CompleteActivityAsync(); In practical project ,we may use await context.CompleteWithOutcomesActivityAsync("Error"); How to complete , the best position is : protected virtual void OnEventReceived(ActivityExecutionContext context, TResult? input)
{
}
You suggest use only output according input EventData?
### Proposed Enhancement
In general, we judge input Event Data, to decide next workflow activity.
### Use Cases
input.Ack is OK/NG. next Acitivity. such as.
protected override void OnEventReceived(ActivityExecutionContext context, SecondaryReceivedEvent? input)
{
if (input.DeviceId == DeviceId && input.TransactionId == TransactionId)
{
context.CompleteActivityWithOutcomesAsync(input.Ack);
}
else
{
var logger = context.GetRequiredService();
logger.LogError($"Expect TransactionId:{TransactionId}, Actual is {input.TransactionId}; " +
$"Expect DeviceId {DeviceId}, Actual is {input.DeviceId}");
context.CompleteActivityWithOutcomesAsync("Error");
}
}
Contributor guide
Assessment
This issue has not been assessed yet.