Multiple trigger syntax in file-based JSR223 Javascript

In OH3, I’ve already established that the Javascript rule format is like this:

function doStuff(event) 
{
}
when("Member of gRecordLastUpdate changed")(doStuff);
rule
(
    "Stuff",
    "Does stuff"
)(doStuff);

When including multiple triggers, what’s the exact syntax. Is it like this?

function doStuff(event) 
{
}
when("Member of gRecordLastUpdate changed")(doStuff);
when("Item BalconyAeotec_SensorTemperature received update")(doStuff);
rule
(
    "Stuff",
    "Does stuff"
)(doStuff);

Or perhaps like this?

function doStuff(event) 
{
}
when("Member of gRecordLastUpdate changed")
when("Item BalconyAeotec_SensorTemperature received update")(doStuff);
rule
(
    "Stuff",
    "Does stuff"
)(doStuff);

I can’t find a single example anywhere, except for Jython, which has slightly different syntax anyway.

This is the correct syntax

1 Like

OK thanks. I had it like that but I wasn’t sure.