elsa-workflows / elsa-workflows/elsa-core
Allow signaling of custom activities
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
This idea originates from a conversation I had with [TedDBarr on Discord](https://discord.com/channels/814605913783795763/814605914212270101/847546670132101140).
Currently, the `/signals/trigger` endpoint that is invoked by generated signal token URLs only triggers the `SignalReceived` activity,
But if we include the **activity type** from where one generates the token (e.g. `WitingOnTaskCompletion` in below sample custom activity) then the endpoint that the URL points to can read the activity type and trigger that one instead of `SignalReceived`.
Which is great, because it simplifies implementing custom "signal" activities such as your example tremendously!
```csharp
public class WaitingOnTaskCompletion : Activity
{
protected override IActivityExecutionResult OnExecute(ActivityExecutionContext context)
{
var signalUrl = context.GenerateSignalUrl("Done");
return Suspend();
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.