Switch Case Default¶
Version v2
Instead of downloading the archive, you can download and apply this model as a recipe (Drupal 10.3 or later):
1 2 |
|
Purpose¶
Demonstrate how typical switch-case PHP constructors could be simulated in ECA models - similar to if-elsif-else statements.
The model is similar to what you would normally do in PHP like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Important note: after the action "Set default Status to 2", ECA first checks the conditions of ALL successors; only then does it execute the actions that follow for those conditions that return TRUE. That's why the "no condition" link has no condition, as we want to execute that path in any case, but not before the top two paths had a chance to change the status. Therefore the condition, if the status is still 2, happens with a delay, i.e. really after everything else has been completed.
Dependencies¶
- config
- node.type.article
- module
- eca_base
- eca_content
Used plugins¶
Events¶
Conditions¶
Actions¶
Changelog¶
v1
-
Initial version
v2
-
Add the "no condition" for the default value