Problem/Motivation

I am trying to learn ECA content creation with a simple example. When an article is created, I want to create a node in content type promotion with two fields, title and body. An export of the model is attached. The model saves without error and the first part runs displaying a message but does not create a new promotion node.
Trying to understand what I'm doing wrong, I looked up the example in the documentation Auto create entity with values from another one and the current user I've installed the recipe OK but I cannot apply the recipe. Here is the command line code:
[root@127518 d11tmqp]# cd web
[root@127518 web]# php core/scripts/drupal recipe ../recipes/eca_lib_0020
In ConfigConfigurator.php line 68:
The configuration 'node.type.article' exists already and does not match the recipe's configuration
recipe [-i|--input INPUT] [--]
[root@127518 web]#

Steps to reproduce

Look at the exported recipe and see what I might be doing wrong.
Look at the SSH application error mesaage and again point out where I'm in error. Thanks.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

peterk900 created an issue. See original summary.

jurgenhaas’s picture

Your step "Entity: get field value" should be "Entity: set field value" and the field name is title. So that sets the title value of the entity newpromotion. The value should then be [node:title].

peterk900’s picture

Thank you jurgenhaas. Of course it should be set not get. Ugh. Also important to use the token name for the entity, not the entity machine name. Brilliant.
I'm keen to explore ECA using the example models in the ECA Library. Can you make any suggestions as to why I couldn't apply the recipe? I've looked at the message "The configuration 'node.type.article' exists already and does not match the recipe's configuration
recipe [-i|--input INPUT] [--]" and wonder if it means the article content type in the recipe isn't the default structure that comes with a new Drupal build? Any pointers so I can play with the library material would be great.
Thanks again for your speedy solution to my problem!

jurgenhaas’s picture

There should be the strict: false setting in all recipes. But I just realised that this is only set if there is the config property in the recipe.yml file. For the recipe you've tried, that section is not required and therefore omitted.

Please add the following to the recipe.yml:

config:
  strict: false

Let me know if that then works if you apply that to your site.

peterk900’s picture

Thanks.

I've amended recipe.yml as below

name: 'Auto create entity with values from another one and the current user'
description: |-
This model reacts upon creating a new page node. It then creates a new article node, its title is populated with the page auther's name, some static text and the title of the created page.

The [recorded video](https://tube.tchncs.de/w/2nSZ9TDmtZ5YYrnyFfaNUC) provides more explanation as we go on.
type: 'Modeler API'
install:
- eca_content
config:
strict: false

But running the code to apply the recipe ( taken from the Library documentation) from the web root fails as below:

[root@127518 d11tmqp]# dir
composer.json composer.lock recipes vendor vendor.zip web web.zip
[root@127518 d11tmqp]# php core/scripts/drupal recipe ../recipes/eca_lib_0020
Could not open input file: core/scripts/drupal
[root@127518 d11tmqp]#

(I tried inserting a dash before strict: false i.e
config:
- strict: false
but I get the same message)

The web root is d11tmqp. Drupal version is 11.2.3 The folder structure follows from a Drupal install with composer where the files in the web directory are...
[root@127518 web]# dir
autoload.php example.gitignore INSTALL.txt profiles recipes sites update.php
core index.php modules README.md robots.txt themes
[root@127518 web]#

Does this help identify what's causing the error message? Thanks for any on-going help you can give on this.

jurgenhaas’s picture

The script php core/scripts/drupal recipe ../recipes/eca_lib_0020 needs to be executed in the web/ directory, like you did originally.

And I can verify if the syntax in your recipe.yml file is correct, you should always wrap code blocks in comments in a code element so that the formatting remains as it was.

peterk900’s picture

Thanks for your continued help.
Sorry if I'm being silly on this but I'm getting a new error when I run the script from the web directory. Here's the snippet...

[root@127518 web]# php core/scripts/drupal recipe ../recipes/eca_lib_0020
In RecipeFileException.php line 56:
Validation errors were found in ../recipes/eca_lib_0020/recipe.yml:
- [config][0]: This field was not expected.

Here is the amended recipe.yml...

name: 'Auto create entity with values from another one and the current user'
description: |-
This model reacts upon creating a new page node. It then creates a new article node, its title is populated with the page auther's name, some static text and the title of the created page.

The [recorded video](https://tube.tchncs.de/w/2nSZ9TDmtZ5YYrnyFfaNUC) provides more explanation as we go on.
type: 'Modeler API'
install:
- eca_content
config:
strict: false

(BTW - The video in the recipe is really helpful!)

jurgenhaas’s picture

Status: Active » Postponed (maintainer needs more info)

As I mentioned in my comment #6 I can't really evaluate the code you've pasted. Code blocks need to be encapsulated in code block tags so that the formatting will be shown as well.

peterk900’s picture

Sorry!

name: 'Auto create entity with values from another one and the current user'
description: |-
  This model reacts upon creating a new page node. It then creates a new article node, its title is populated with the page auther's name, some static text and the title of the created page.

  The [recorded video](https://tube.tchncs.de/w/2nSZ9TDmtZ5YYrnyFfaNUC) provides more explanation as we go on.
type: 'Modeler API'
install:
  - eca_content
config:
  strict: false



jurgenhaas’s picture

That syntax is correct, and I have the same which works just fine without any error message. So, I can't reproduce your latest error. I can force that error, though, by changing the last 2 lines to this:

config:
  - strict: false

Then I get your error message too. But not, with the correct syntax in the recipe.

peterk900’s picture

Thank you.

But I still get an error when using the recipe.yml you have verified.

The snippet below shows running php core/scripts/drupal recipe ../recipes/eca_lib_0020 from the /web folder.

[root@127518 eca_lib_0020]# sudo vi recipe.yml
[root@127518 eca_lib_0020]# cd ..
[root@127518 recipes]# cd ..
[root@127518 web]# php core/scripts/drupal recipe ../recipes/eca_lib_0020

In RecipeFileException.php line 56:

  Validation errors were found in ../recipes/eca_lib_0020/recipe.yml:
  - [config][0]: This field was not expected.


recipe [-i|--input INPUT] [--] <path>

[root@127518 web]#

The web server error log does not contain any error.

The site is hosted by cPanel and is running php 8.3. The Drupal version is 11.2.3.

You have got the model import to work so unless your set up is significantly different to mine, it looks like the problem is at my end. I've tried to think if I'm doing something silly, but nothing comes to mind. Unless you have any futher ideas for me to try, I suggest you close this issue as fixed. Over the coming days, I'll try another model and maybe return to this one set up on another domain/server. But as each of the models has a video, it makes importing the model code less important as I can copy it from the slides. Thanks again for your persistence with this!

jurgenhaas’s picture

I can't really help, this can't be reproduced. With the syntax you showed, the error message is impossible. It would be possible, though, with the syntax that I mentioned in #10, but you're saying that's not what you're having.

Maybe you just try again on a fresh installation of Drupal and try to reproduce it there. The recipes have all been updated, so if you install everything completely fresh, you should already get the fixed versions so that you don't have to manually edit files.

peterk900’s picture

Thank you. I'll do this and post back.

peterk900’s picture

StatusFileSize
new1.04 KB

I've succesfully installed the "Auto create entity with values from another one and the current user" example on a new D10.5.2 site with ECA 3.0.8 and BPMN.io 3.0.2. Without any recipe.yml editing.

Here are the command line instructions:
[root@127518 web]# php core/scripts/drupal recipe ../recipes/eca_lib_0020
2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓]
Applied Auto create entity with values from another one and the current user recipe.
[OK] Auto create entity with values from another one and the current user applied successfully
[root@127518 web]#

All looks good but the model, which appears in the list with the title 'dummy', just shows an Article Create start event. This can't be right. I sense I'm doing something wrong! I've uploaded the model as installed.

jurgenhaas’s picture

new D10.5.2 site with ECA 3.0.8 and BPMN.io 3.0.2

That's impossible. ECA 3 and BPMN 3 can not be installed on Drupal 10.

jurgenhaas’s picture

And the ECA model in your upload does indeed only contain an event, nothing else. Not sure where that model comes from. It's certainly not what comes with the eca_lib_0020 recipe.

peterk900’s picture

Sorry about the delay in coming back. I'll re-check the versions - problem right now is I can't remember which test site I used! I'll post back shortly.

Found site. You are right BPMN.iO Version: 2.0.11 Drupal 10.5.2 ECA 2.1.6 Sorry to mess you around. One thing I'm fairly sure I was right over is that the model did come from the ECA Examples page. But best thing is over the next day or so, I'll create another D10 site and try again.

peterk900’s picture

I've built a fresh D10.5.2 installed in a sub-domain. All works I believe up to the application of the recipe which fails because a command cannot be found.

The details of what I've done follow.

BPMN.iO Version: 2.0.11. ECA Version: 2.1.17 php Version 8.3.28.
I can build a simple ECA model which works fine.

I have run composer require drupal-eca-recipe/eca_lib_0020 as follows:

[root@mystifying-taussig test500.xxx.com]# /opt/plesk/php/8.4/bin/php /usr/lib64/plesk-9.0/composer.phar require drupal-eca-recipe/eca_lib_0020
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
./composer.json has been updated
Running composer update drupal-eca-recipe/eca_lib_0020
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
40 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Found 9 security vulnerability advisories affecting 2 packages.
Run "composer audit" for a full list of advisories.
Using version ^1.1 for drupal-eca-recipe/eca_lib_0020
[root@mystifying-taussig test500.xxx.com]

The results:

[root@mystifying-taussig test500.xxx.com]# dir
composer.json composer.lock recipes vendor web
[root@mystifying-taussig test500.xxx.com]# cd recipes
[root@mystifying-taussig recipes]# dir
eca_lib_0020
[root@mystifying-taussig recipes]# cd eca_lib_0020
[root@mystifying-taussig eca_lib_0020]# dir
composer.json config README.md recipe.yml
[root@mystifying-taussig eca_lib_0020]# sudo vi recipe.yml
[root@mystifying-taussig eca_lib_0020]#

The content of recipe.yml file is as follows:

name: 'Auto create entity with values from another one and the current user'
description: |-
This model reacts upon creating a new page node. It then creates a new article node, its title is populated with the page auther's name, some static text and the title of the created page.

The [recorded video](https://tube.tchncs.de/w/2nSZ9TDmtZ5YYrnyFfaNUC) provides more explanation as we go on.
type: ECA
install:
- eca_content

Running php core/scripts/drupal recipe ../recipes/eca_lib_0020 from the /web directory produces an error.

[root@mystifying-taussig test500.xxx.com]# cd web
[root@mystifying-taussig web]# php core/scripts/drupal recipe ../recipes/eca_lib_0020
-bash: php: command not found
[root@mystifying-taussig web]#

If I've not exhausted your patience, maybe your can explain what I'm doing wrong. Thanks.

Edited:

I've found the directory where the drupal file is run: test500.xxx.com/web/core/scripts and tried running drupal recipe ../recipes/eca_lib_0020 from here...

[root@mystifying-taussig scripts]# drupal recipe ../recipes/eca_lib_0020
-bash: drupal: command not found

php drupal recipe ../recipes/eca_lib_0020 gives a similar error.

jurgenhaas’s picture

Those errors that you are experiencing are all from the operating system, i.e. it doesn't find the programs you ask it to execute. I'm afraid, I can't really help with that.

peterk900’s picture

Thanks.

I've installed Drush and tried the model install using...

drush recipe ../recipes/eca_lib_0020

This is D 10.3.10 php 8.4.15

The composer install of the model works but when I try to apply the recipe with Drush I get another error in ConfigConfigurator.php line 47 - "The configuration 'node.type.article' exists already and does not match the recipe's configuration"

Here's the full install script...

[root@716881 d10314a]# /opt/plesk/php/8.4/bin/php /usr/lib64/plesk-9.0/composer.phar require 'drupal/b
pmn_io:^2.0'
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
./composer.json has been updated
Running composer update drupal/bpmn_io
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
  - Locking drupal/bpmn_io (2.0.11)
  - Locking drupal/eca_modeller_bpmn (2.1.17)
  - Locking drupal/eca_ui (2.1.17)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Downloading drupal/bpmn_io (2.0.11)
  - Installing drupal/eca_ui (2.1.17)
  - Installing drupal/eca_modeller_bpmn (2.1.17)
  - Installing drupal/bpmn_io (2.0.11): Extracting archive
Generating autoload files
45 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Found 17 security vulnerability advisories affecting 2 packages.
Run "composer audit" for a full list of advisories.
[root@716881 d10314a]# composer require drupal-eca-recipe/eca_lib_0020
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
./composer.json has been updated
Running composer update drupal-eca-recipe/eca_lib_0020
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking drupal-eca-recipe/eca_lib_0020 (1.1.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Syncing drupal-eca-recipe/eca_lib_0020 (1.1.0) into cache
  - Installing drupal-eca-recipe/eca_lib_0020 (1.1.0): Cloning 8adf3c24cb from cache
Generating autoload files
45 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Found 17 security vulnerability advisories affecting 2 packages.
Run "composer audit" for a full list of advisories.
Using version ^1.1 for drupal-eca-recipe/eca_lib_0020
[root@716881 d10314a]# drush recipe ../recipes/eca_lib_0020

In ConfigConfigurator.php line 47:
                                                                                                     
  The configuration 'node.type.article' exists already and does not match the recipe's configuration

                                                                                            
                                                                                                     

[root@716881 d10314a]# 

Is this still another OS issue? If it is then I'll try it on a cPanel platform.

jurgenhaas’s picture

What's a first indication that Drupal 10.3 is long EOL (end of life) and not supported anymore. And other Drupal 10 versions are going to become unsupported in a few months as well. Any reason why not testing with the latest Drupal version, i.e. 11.3? If it works there, you can work backwards from there, if you really need to.

peterk900’s picture

Good point. Will do. Thanks.

peterk900’s picture

What excellent advice!
Drupal 11.3.0
php 8.4.15
10.11.15-MariaDB
ECA 3.09
BPMN.iO Version: 3.0.4
Model installed perfectly with Drush. Thank you so much for your persitence in guiding me to use the ECA examples.

jurgenhaas’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks a lot for all your feedback.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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