# Appel d'une scène depuis une autre scène

**URL:** <https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038>\
**Category:** Demandes livrées\
**Created:** [Janvier 20, 2021, 10:58 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038 "2021-01-20T10:58:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrien-cardinale](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/adrien-cardinale/32/6465_2.png) [@adrien-cardinale](https://community.gladysassistant.com/u/adrien-cardinale)\
**Post date:** [Janvier 20, 2021, 10:58 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038/1 "2021-01-20T10:58:23Z")

</div>

Ca peut être pas mal pour éviter la redondance quand on programme une scène

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [Janvier 20, 2021, 4:20 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038/2 "2021-01-20T16:20:55Z")

</div>

J’y pensais aussi justement !

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Janvier 20, 2021, 5:04 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038/3 "2021-01-20T17:04:55Z")

</div>

Bonne idée 🙂 La seule chose auquel il faut être sûr, c’est qu’il n’y ait pas de dépendance circulaire (une scène A appelle une scène B qui elle même appelle la scène A) ce qui ferait boucler Gladys et bloquerait l’instance de l’utilisateur…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Mai 10, 2021, 4:39 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038/4 "2021-05-10T04:39:08Z")

</div>

Hop cette fonctionnalité a été mergée ici:

> <https://github.com/GladysAssistant/Gladys/pull/1124>
>
> \### Pull Request check-list
> 
> \- \[x\] If your changes affects code, did your writ…e the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[x\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/v4-website) and the \[website\](https://gladysassistant.com).
> \- \[x\] Did you add fake requests data for the demo mode (\`front/src/config/demo.json\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> \### Description of change
> 
> This change adds an action to scenes which triggers another scene.
> 
> !\[image\](https://user-images.githubusercontent.com/412744/113777609-398b1d80-9723-11eb-8f3f-53ba8c090031.png)
> 
> A few assumptions have been made here which I'd be happy to revisit based on feedback:
> 
> \- There's no validation that a scene exists in the backend
> \- A scene can only trigger another scene once across all action groups
> - In the cyclical scenario (for example, Scene A that triggers Scene B that triggers Scene A), each scene will be called once only and a warning message logged. This is handled at execution time by remembers which scenes were already called.
> - There's no cyclical checks/validation done when a scene is created at the moment; I suggest this is handled in a separate PR to make this easier to review and in the interest of making it incrementally better :) 
> \- At the moment, there isnt trigger shown in the scene being called
> 
> If you're happy with the approach, I'll go ahead and update the docs.
> 
> Closes #797

Je ferme le sujet 🙂

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Mai 10, 2021, 4:39 UTC](https://community.gladysassistant.com/t/appel-dune-scene-depuis-une-autre-scene/6038/5 "2021-05-10T04:39:18Z")

</div>


