await is only valid in async functions
Posted: Wed Jan 12, 2022 4:42 pm
Hi,
need some help with my "newbie" question. I'm new to scripting with NodeJS and switch. I played around with it.
i copied the example from the documentation.
But this give me the error: await is only valid in async functions and the top level bodies of modules
What I'm doing wrong here? Can someone explain?
thanks
need some help with my "newbie" question. I'm new to scripting with NodeJS and switch. I played around with it.
i copied the example from the documentation.
Code: Select all
async function jobArrived(s, flowElement, job) {
const outConnections = flowElement.getOutConnections();
for (const connection of outConnections) {
if (job.isFile() && connection.getName() === 'Freigabe-Ordner') {
await job.sendTo(connection); // here it is
};
};
};
What I'm doing wrong here? Can someone explain?
thanks