Created on 31 January 2024, over 1 year ago

Is it possible to use the AL for a "dummy field" that could trigger an event in ECA?

e.g. Click Action Link to trigger an ECA Event that would change the value of a term reference field on the entity, via an ECA Task/Action. Ideally, I wouldn't need the overhead of an additional field on the bundle, just use the AL to start the ECA flow. Hope that makes sense.

💬 Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

🇺🇸United States eswiderski

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @eswiderski
  • 🇬🇧United Kingdom joachim

    Yes, you could use an Action Link to trigger an ECA, that's exactly the sort of thing it's for.

  • 🇮🇹Italy kopeboy Milan

    How to?

  • 🇬🇧United Kingdom joachim

    > It would be more straightforward to directly fire an ECA custom event from the action link, so we can specifically react to that in an ECA model, without writing to & reading from the database... Would that be possible?

    Yes, that's what I meant. Sorry, I know very little about how ECA works.

    You'd probably want a State Action plugin which lets you choose which ECA event to fire.

  • 🇬🇧United Kingdom jacobupal Leeds

    I've played around trying to do the above but it's a little bit beyond me... this would be a really useful example/template if anyone is up to it.

  • 🇺🇸United States eswiderski

    I ended up just creating an html button that links to a an ECA Endpoint Response Event url. Works great, no need for other modules.

  • Status changed to Needs work 3 months ago
  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    This would be a very useful example for documentation. Please consider to contribute to this great project by documenting your use cases. Make yourself familiar with how the drupal docs work, if you not know already. There are great examples of how users wrote down their use cases to help other users to understand what this module is for.

  • 🇬🇧United Kingdom joachim

    I'm not sure if #7 is directed at me or the OP, but here are my thoughts on ECA integration:

    1. Decide on whether you want to have either:

    a. just one plugin for ECA links, where you configure it for which ECA it uses
    b. each ECA derives an action link plugin

    I think this depends on what parameters an ECA takes. Do different ECAs have different numbers of parameters? If so, you want option b, as each action link plugin defines its parameters, but a particular plugin can't change its parameters.

    2. Your plugin needs to obtain the definition of the ECA's parameters, and declare them.

    3. Similarly, the plugin needs to obtain the definition of the ECA's states and declare them if possible

  • 🇩🇰Denmark ressa Copenhagen

    Another request for ECA integration:

    I want have a link or even better an action link, to change a field value in an existing node. To be more detailed:

    I'm using Drupal 11.x with Entity registrations and ECA. I want to change the registration status, when the author of the node (not registrant) click on a link with a confirmation page. When a user is accepting registration, the node status should also change to "In progress". What do i need to realize my thoughts? Do i need to write a custom module? Or it is even possible with ECA? 

    From https://www.drupal.org/forum/support/module-development-and-code-questio...

  • 🇬🇧United Kingdom joachim

    > I want to change the registration status, when the author of the node (not registrant) click on a link with a confirmation page.

    There is already an Action Link plugin for toggling the value of a boolean field. So you could just create an action link that uses that plugin and configure it to work on your registration status field.

    The latest alpha release added a link style that uses a confirmation form.

    I'm not sure about the combination of node, user, and registrant.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for a fast answer @joachim, @killah89 can try that approach, and hopefully report back if it works.

  • 🇹🇭Thailand AlfTheCat

    @ressa, in case action_link isn't yet sufficient for your use case, for instance if you need to collect data after clicking a link and pass it to ECA, you can use the flag module. It's heavier so for just switching a Boolean this module here is better. But flag will give you different kinds of links, modal dialogs with confirmation steps, and any fields you add to your flag entities, can be rendered to the user after they flag.

    More complex to setup, and you're left with flagging entities each time a user flags, but you can delete those via ECA automatically.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for providing additional info to a possible solution @alfthecat, I really appreciate it!

    @killah89: Does this work for you? You reached out to the Drupal community for help, and several users have now stepped up and helped out with solving your task

    It would be awesome if you could give it a try, and report back.

  • 🇩🇪Germany killah89 Schneverdingen

    Thanks for all suggestions. I'm currently developing a small module with a simple confirmation form, with simple logic. In my module i pass a route with parameters like https://example.com/request/{id}/accept and load a confirmation form with ConfirmationFormBase .

  • 🇬🇧United Kingdom joachim

    > and you're left with flagging entities each time a user flags,

    I think that creating flagging entities only to delete them is rather inelegant! My opinion on Flag is that you should only use it if you actually want what it does -- storing the flaggings.
    It wouldn't be hard to create a custom Action Link link style plugin that extends the confirmation form to show additional form elements.

Production build 0.71.5 2024