elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

How to disable built-in activities registration?

Open cr0fters opened this issue 9 months ago • 3 comments

Discussed in https://github.com/elsa-workflows/elsa-core/discussions/5183

Originally posted by defunky April 4, 2024 In V2, there was a method named NoCoreActivities that’s not present in V3. I’ve looked into the source code and found a property called DisableAutomaticActivityRegistration within ElsaFeature. Inserting elsa.Configure<ElsaFeature>(x => x.DisableAutomaticActivityRegistration = true) within the services.AddElsa() didn’t seem to have any effect. Adding it as a chained method after .AddElsa() extension method was also unsuccessful.

I even tried to create a separate extension method similar to AddElsa, placing module.Configure<ElsaFeature>(x => x.DisableAutomaticActivityRegistration = true); before the Apply method. This approach seemed to trigger a reaction, as it resulted in an exception: System.Exception: Activity descriptor not found. What would be the correct approach to utilize this feature?

cr0fters avatar May 10 '24 21:05 cr0fters

To disable automatic activity registration in Elsa 3, you should be able to configure the ElsaFeature options directly within the AddElsa call. However, based on your description, it seems like you've encountered issues with this approach.

Given that you've tried using elsa.Configure<ElsaFeature>(x => x.DisableAutomaticActivityRegistration = true) and it didn't work, and considering that you've also attempted to create a separate extension method without success, it's possible that there might be a bug or a missing piece in the documentation or the implementation.

The error Activity descriptor not found suggests that the system is trying to locate an activity that has not been registered, which could be a result of disabling the automatic registration.

To resolve this issue, I would recommend the following steps:

  1. Ensure that you are using the latest version of Elsa 3, as there might have been updates or bug fixes related to this feature.
  2. Review the Elsa 3 documentation and GitHub repository for any updates or examples on how to correctly use the DisableAutomaticActivityRegistration property.
  3. If the documentation is lacking or you suspect a bug, consider reaching out to the Elsa community or maintainers via GitHub discussions or issues for guidance. It's possible that others have encountered this issue and might have a solution or workaround.

If you provide the exact code snippet you're using to configure Elsa without automatic activity registration, I might be able to offer more specific advice.

This comment was generated by Glime.

glime-ai[bot] avatar May 10 '24 21:05 glime-ai[bot]

I think this is a bug in the latest version, in that setting the property doesn't seem to have any effect

cr0fters avatar May 10 '24 21:05 cr0fters

wonder if you've any advice @sfmskywalker ?

cr0fters avatar May 10 '24 21:05 cr0fters