elsa-core/src/modules/Elsa.Http
Sipke Schoorstra fa04e1ebcd
Adds activity host registration support (#7172)
* Add support for activity host registration across workflows

Introduced new APIs and updates to enable registering custom activity hosts in the workflow management system. This includes modifications to attributes, service registrations, and extensions to streamline integration for advanced activity hosting scenarios.

* Remove unused `using` directives across Workflow Management module

* Add support for host method activity registration and description

Introduce new APIs to enable activity registration from public async methods (Task/Task<T>) on CLR types. Includes `HostMethodActivitiesOptions`, `HostMethodActivity`, `HostMethodActivityProvider`, and `HostMethodActivityDescriber` for dynamic activity generation and execution.

* Refactor host method activity execution and cleanup.

Reworked `HostMethodActivity` to support resumable workflows, improved parameter handling with pluggable value providers, and removed obsolete `AgentExecutionContext`. Enhanced method resolution, async handling, and input/output descriptor logic for better flexibility and maintainability.

* Refactor `Bookmark` model to use mutable properties and update XML documentation.

* Refactor `BookmarkExecutionContextExtensions` to improve structure, add `GenerateBookmarkTriggerToken` method, and enhance maintainability.

* Add extensibility for host method parameter binding with pluggable value providers

Introduced `IHostMethodParameterValueProvider` interface for custom parameter resolution, along with `DefaultHostMethodParameterValueProvider`, `DelegateHostMethodParameterValueProvider`, and `FromServicesAttribute` for flexible binding options. Enhances host method activity execution by supporting DI resolution and workflow input handling.

* Refactor nullable usage and improve bookmark management logic

Updated null assignment for consistency across files and refined logic for detecting and handling newly added bookmarks. Adjusted method signatures and parameters in the DecoratedStoryWriterAgent class for more explicit input handling. These changes enhance code readability, maintainability, and robustness.

* Update src/modules/Elsa.Workflows.Management/Activities/CodeFirst/HostMethodActivityProvider.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Ensure `CallbackMethodName` is set and skip bookmarks with empty values

* Update src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Elsa.Workflows.Management/Contracts/IHostMethodActivityDescriber.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/Elsa.Workflows.Core/Attributes/InputAttribute.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor `CodeFirst` namespace to `HostMethod` for improved clarity and align with updated activity execution logic. Enhance DI-based parameter resolution and update XML documentation for `HostMethodActivitiesOptions`.

* Add `Penguin` activity host with sample activity methods and register in Elsa pipeline

* Add `TestHostMethod` activities and corresponding component tests. Register `TestHostMethod` as an activity host in the workflow server.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-27 20:52:52 +01:00
..
Abstractions Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Activities Merge remote-tracking branch 'origin/patch/3.5.3' into develop/3.6.0 2025-12-10 20:48:50 +01:00
Bookmarks Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Constants Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
ContentWriters Merge remote-tracking branch 'origin/develop/3.6.0' 2025-11-27 21:41:59 +01:00
Contexts Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
Contracts Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
DownloadableContentHandlers Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Exceptions Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Extensions Adds activity host registration support (#7172) 2025-12-27 20:52:52 +01:00
Features Fix typo in AddTriggerPaylodValidator method name across Scheduling, Http, and Runtime modules 2025-10-04 19:34:19 +02:00
FileCaches Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Handlers Addresses warnings and enforces null safety (#7051) 2025-11-12 16:56:31 +01:00
Middleware Implement retry attempt capturing (#6674) 2025-05-26 11:47:09 +02:00
Models Add support for flow authorization activities and bookmark trigger URL generation (#6828) 2025-07-29 20:22:39 +02:00
Options Add support for flow authorization activities and bookmark trigger URL generation (#6828) 2025-07-29 20:22:39 +02:00
Parsers Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
PortResolvers Expand HttpClient configuration and improve SendHttpRequest activity port handling 2025-09-17 18:31:03 +02:00
Resilience Implement retry attempt capturing (#6674) 2025-05-26 11:47:09 +02:00
Scripting/JavaScript Merge remote-tracking branch 'origin/develop/3.5.0' 2025-06-01 18:19:32 +02:00
Selectors Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Serialization Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Services Implement retry attempt capturing (#6674) 2025-05-26 11:47:09 +02:00
Tasks Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
TriggerPayloadValidators Create trigger payload validation, refacto HttpEndpoint validator and create Cron validator (#6641) 2025-05-20 19:52:43 +02:00
UIHints Addresses warnings and enforces null safety (#7050) 2025-11-12 15:53:23 +01:00
BookmarkMetadata.cs Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
Elsa.Http.csproj Refactor workflow services and update project references 2025-08-01 22:44:15 +02:00
Elsa.Http.csproj.DotSettings Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
FodyWeavers.xml Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00
HttpStimulusNames.cs Return Http and Scripting from Extensions. 2025-05-20 12:38:24 +01:00