Im trying to create a function that can be triggered from different event on a custom component (ie. trigger the same function on the click event on two different buttons). I think that i can do that using component rule templates but i can't find any documentation on how they work.
We have many business rules stating that we have to end the user's session (ie. if there's a service error, you must end the session, but we also have to end the session if there's 2 minutes of inactivity), so i would like to have the code in a "session component" inside the template so the form developers can call it with something like
Form.fireRule('endSession', item, data)
In order to answer you question accurately, it would be very helpful to understand better exactly what you are trying to do. The answer will differ depending on exactly what you are trying to achieve.
However, here are some possible suggestions:
I'm personally have not heard about "component rule templates" - can you give me a reference to where you found information on this.