Custom event: Pass Along Value Rather Than Token Name

Created on 30 March 2024, 8 months ago
Updated 12 June 2024, 5 months ago

Problem/Motivation

The sub models can be triggered using custom event, which is cool! However, every time to call a model, I need to assign set token value to each of them so I can pass these token names over. If I have multiple models to call this sub model, I need to make sure to use the same token names. Is it possible to make it like function, we just pass alone variables (value) rather than token name? That will make the process a lot easier and parent model much cleaner.

There are two type of events, one with entity awareness and on without. What are differences?

Regards,

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.1

Component

Code

Created by

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

Comments & Activities

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

    Is it possible to make it like function, we just pass alone variables (value) rather than token name?

    I've though about that in the past as well, and we should consider adding such a feature in the future. We could optionally allow the usage of Yaml as we already do in other areas, so that the action could define an array of tokens like e.g. this:

    node: "[entity]"
    myvar1: 5
    myvar2: "some fixed string"
    

    With that, the receiving event would then know the tokens node, myvar1 and myvar2.

    There are two type of events, one with entity awareness and on without. What are differences?

    The entity aware custom event also receives the content entity from the dispatching context. Other than that, they are the same.

  • Thank you for considering that! Looking forward to this feature being available.

  • 🇩🇪Germany jurgenhaas Gottmadingen
Production build 0.71.5 2024