01-28-2022 09:37 AM
Hi!
I try to generate a user event from a notifier. Unfortunately, the code that I created doesn't work as expected... and I can't explain why!
Why the notification generated in the second loop is not transmitted through the user event?
Thank you in advance for your answers!
Julien
01-28-2022 10:08 AM
Your second loop generates a notification. But nothing in your code captures the notification, and nothing generates a user event.
On top of that, I don't see any point in trying to make your code so convoluted.
01-28-2022 10:25 AM
I agree with the "convoluted" comment. I can't tell what you're trying to do, but I can almost guarantee there's a better (and very likely simpler) way. Having an event case that includes a potentially infinite wait time makes it clear this hasn't been planned out properly.
-Kevin P
01-28-2022 10:49 AM
If you look at the input where you have connected the notifier reference to "Create User Event" you'll see that it says "user event data type" instead of user event data. You have to actually generate the user event - it does not detect a change in the notifier.
As others have said I'm not sure what you're trying to accomplish, but there is almost definitely a better, simpler way to accomplish it.
01-28-2022 11:16 AM
The way you generate a user event is by using the "Generate User Event" function. In this case, your event data is a notifier reference. If you generate a user event (using the event reference), you will feed in a notifier reference and that will come out in the data node of the event structure. You are passing around the notifier reference, not the boolean data as you intended.
The simplest thing to do would be to create a user event with boolean data, if that is what you want to pass around.
If you are married to the notifier for some reason, you could add another loop which waits for the notification, and generates the user event (with boolean data) when it comes in.
01-31-2022 09:53 AM
Hi!
Thanks for all your answers.
Maybe I should have started with this explanation: this example is a PoC that could be implemented in a much complicated application. As this was not functional, I though it would be easier to find the solution in this PoC instead of the final application.
Anyway, I changed the way it works by using user event only, without notification.
Thank you for your answers and help!
Julien