Hi, in a custom plugin i’m sending event like this, it can send multiple events in less than a second.
instance.publishState(“task_changed”, mytask);
instance.publishState(“startdate_changed”, start);
instance.publishState(“finishdate_changed”, end);
instance.triggerEvent(“on_date_change”)
On the app side I’m using “my componnent date changed” , im well receiving multiple events but the state is not working as expected. Because the workflow do (make a change to a thing), i’m getting only 50% of the exposed states. Is there a way to triggerEvent with parameters instead of using exposed states ? Or a way to ensure events are treated in sequences ?
I can throttle event sending in js but it seems hacky 
Thanks !
When you say only 50% what do you mean exactly?
I say the events are sent too quickly and the processing time of the event does not allow me to capture all the states. If in the “my componnent date changed” I put only Console.writeline(), I’m capturing all the exposed states. I’m sorry not easy to explain.
If I understand correctly you have a workflow that lasts many seconds and you need to trigger it multiple times per second.
Are you sure you need to trigger it so often?
Is there anything else that you can do inside the plugin?
I created a plugin to isolate the issue
I can workaround, but it should work, it works with vanilla js, if we could send parameters with triggerEvent(), i think it could resolve this.
You can’t send parameters with triggerEvent.
What it is that you need to teigger multiple times per second?
If you just need to update data and display it you don’t need to trigger an event, you can just update the state in the plugin and reference the state in the editor (eg. in a text).
If you really need the event multiple times then you should try to handle as much logic as you can in the plugin
1 Like