Can't get a simple model to work

Created on 16 August 2023, about 1 year ago
Updated 4 September 2023, about 1 year ago

Problem/Motivation

I am trying to get started with ECA - which looks very promising - but I cannot get even the simplest test model to work.

I'm user 1 on a near-empty D9.5.10 system. I installed ECA modules manually, so can't use BPMN - therefore I'm using the core modeller.

I'm trying to display a message on viewing a node. I've attached the exported model, but basically it's:

  • Event: View content entity, type: 'node_all'
  • Condition: none
  • Action: Display a message to the user, message: 'hello world'

The result is... nothing. I turned on the debugging log, but even that is giving me no results.
I suspect I'm doing something very basic and stupid, and would be grateful if you could give me any advice.

💬 Support request
Status

Fixed

Version

1.1

Component

Documentation

Created by

🇬🇧United Kingdom adam_b

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

Comments & Activities

  • Issue created by @adam_b
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Never mind, this happens to almost any user who starts with the core modeller: you have an event, but that event has no successor. So you have to set your action as a successor to the event, and everything should be working.

    On the topic of module installation, it's a concern if Drupal and modules are not installed with composer. It is pretty sure that this will not last for very long anymore.

  • 🇬🇧United Kingdom adam_b

    Thanks very much for the quick response :)

    I set the action as a successor, and I am indeed seeing a message now - but only when I save a node, rather than when I view it. Any thoughts?

    Re Composer - this is just me as a site builder messing around - any live installations will be done by real devs who use Composer

  • 🇩🇪Germany jurgenhaas Gottmadingen

    The event "view entity" is not what most users think. The naming from drupal core is a bit misleading. That event is triggered, when an entity is prepared for rendering, and that happens rarely. The result gets cached and then the event never dispatched any more.

  • Status changed to Postponed: needs info about 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @adam_b here is an example that is more precise in terms of only but always triggering when a node page is being viewed: https://ecaguide.org/library/simple/route_test/

    Please let us know if that resolves your issue.

  • 🇬🇧United Kingdom adam_b

    Thanks for the link @jurgenhaas - I've looked at and I can see how it works but I'm still having trouble getting it to do something. I think I'll have to wait until the dev loads it properly with Composer before I can test it.

    Re 'The event "view entity" is not what most users think. The naming from drupal core is a bit misleading.' - is there any glossary which details what the events really mean? I see that there is more info in the BPM modeller, but I wondered if anyone has provided a general resource.

  • 🇩🇪Germany jurgenhaas Gottmadingen

    I think I'll have to wait until the dev loads it properly with Composer before I can test it.

    If you get started with your Drupal installation as documented - which is only composer-based, but following the available guides should be possible also for non-geeks - then there is e.g. the project browser module in Drupal 10.1 which allows you to install any module from drupal.org through the UI of your Drupal site. That uses composer in the background, but it does it all for you, so no need to learn all the new tricks.

    is there any glossary which details what the events really mean?

    All the available information in the UI of the BPMN.io UI is also available in the ECA Guide at https://ecaguide.org/plugins/ where all the event, condition and action plugins are being documented. There are still gaps and we constantly try to improve the documentation part as well.

    As for View content entity event, it says "Reacts when specific content entities are viewed." which is kind of accurate, but still may not make it obvious that viewing an entity is not only when a node page is being requested by a website visitor.

    Most of that documentation comes from the source code of these plugins. So, to improve that, new issues should be started in the respective project. In this case, that would be Drupal core.

    However, the ECA Guide has a mechanism to manually add extra explanation for each plugin. So, this change can be contributed in the ECA Guide project, which is hosted over at our own GitLab instance.

    Let us know if we can further help with your current issue or when we can mark this as fixed.

  • 🇬🇧United Kingdom adam_b

    Thanks Jurgen

    I still don't have access to Composer or D10, but I used simplytest.me to try it in a raw D9.5.8 site. I:
    - enabled all the ECA modules
    - imported https://ecaguide.org/library/simple/route_test/
    - turned logging to Debug
    - created an article
    - viewed the article
    - saw no message...

    I can see in the log (attached) that things are happening, but there's a line which looks suspicious to me:

    Not asserting condition Flow_0vgujvv for Add node from route to token from ECA Route test (eca_lib_0001) for event Drupal\eca_misc\Event\RequestEventFacade.

    If this doesn't help, feel free to mark the ticket as "Needs more info" until I'm able to look at it further - which probably won't be for a couple of weeks

  • 🇩🇪Germany jurgenhaas Gottmadingen

    Oh, interesting. That was the first model of the library and never updated ever since its initial creation. It had indeed a couple of bugs and typos in it. I've now fixed them and uploaded v2 of this sample. This should now be working.

  • 🇬🇧United Kingdom adam_b

    Success!

    I got https://ecaguide.org/library/simple/route_test/ to work

    And I had another go at https://ecaguide.org/library/simple/add_role_to_inserted_or_updated_user/ - took a bit of fiddling, but I managed to get that to work after a bit

    I'm sure I'll have more problems later on, but now I have a starting point - many thanks for your help

  • Status changed to Active about 1 year ago
  • 🇨🇦Canada joseph.olstad

    pebkac issue?

    any suggestions for the documentation?

  • 🇬🇧United Kingdom adam_b

    pebkac issue?

    How dare you, sir! ;)

    any suggestions for the documentation?

    Some thoughts:

    • Who is your audience? If you want sitebuilders to be able to use the module, then you will need more detail than if it's only intended for developers (who, in my experience, will want to write their own code anyway)
    • Give an example for the core modeller - "this happens to almost any user who starts with the core modeller: you have an event, but that event has no successor"
    • Supply better descriptions for the ECA plugins

    But I do appreciate that this module has far more documentation than most - thanks for this.

    And, not documentation, but if at all possible please address the issue in https://www.drupal.org/project/eca/issues/3381483 💬 Library download can't be imported Fixed - I can see many occasions when it would be useful to import and test a model on existing content.

  • Status changed to Fixed about 1 year ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Give an example for the core modeller - "this happens to almost any user who starts with the core modeller: you have an event, but that event has no successor"

    That modeller is now called "Classic modeller" and its project page makes it clear, that it is only a very rudimentary modeller with limited functionality. However, the missing successor issue has been addressed there as well, it now shows a warning if successors are missing.

    And, not documentation, but if at all possible please address the issue in https://www.drupal.org/project/eca/issues/3381483 💬 Library download can't be imported Fixed - I can see many occasions when it would be useful to import and test a model on existing content.

    That would require a new issue, so that it can be addressed.

    Documentation in general is an ongoing task and any help is much appreciated.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024