elsa-workflows / elsa-workflows/elsa-core

Allow signaling of custom activities

Open
#1,053 2 comments 0 reactions 0 assignees View on GitHub
elsa 2 elsa 3 enhancement triaged
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.