Event Handler is executing multiple times

Issue:

  • The event handlers are executing more than once.

Setup:

  • Parent Screen: Notes.aspx toggles a modal
  • Modal has a web block containing a link button
  • Link button method does an Ajax submit and contains Event triggers
  • Event trigger handlers are on the parent screen

Description:

After clicking the link button with an Ajax submit, the destination calls a screen action which performs the closing of modal window, 2 event triggers, and ends with a destination redirect.

The parent screen event action handler for one of the triggers, EventCompleteInvestigation, is doing the following:

  • LaunchInvestigationComplete process is sending two emails
  • LaunchTrainingRequiredNotification process is sending two emails

Note: The initial design was to have only 1 event trigger inside the modal web block.  The EventCompleteInvestigationComment was pulled out to its own event handler, because multiple comments were being created. Now that it is in its own event only a single comment is created.

Please see the attached document with screenshots. Sorry I cannot upload an oml due to company restrictions.

Any help on this would be appreciated.  Thank you.

Tim

Hi Tim,

I'm trying to follow here.  A few things that come to mind :


- you say the modal contains the webblock ? Not the other way around ?  So how does the webblock get the Id of the modal widget to be able to toggle it, from the input ?

- so in first instance, you created comment in one and the same event, and there were 2 comments, effectively another indication that the event handler is running twice.

- could you either debug, or add some logging in both your button action on the webblock as in your handler on the screen, just to make sure that it's not your button action running twice

- why do you have a destination of Notes screen at the end of the Webblock Action, I would just expect an end node there?  At the end of the handler of the screen, I can imagine maybe you see reason to flow to own screen instead of just End.

- is it possible to build same in your personal environment and get same behaviour (in other words can you reproduce the problem )?


Dorine

Dorine,

Thank you for your response.  Your questions made me rethink the unnecessarily complex functionality and it was redeveloped.  The parent screen now contains all actions, no use of web blocks or event triggers. The functionality is now working as expected. 

Thanks for taking the time.

Tim

Solution

Hi Tim,

that's how it works, right?  Questions can open up new outlook / answers to a problem...

And what you did is what it is all about in designing software, find the sweet spot between too simple and too complex. 

Glad my questions set you on a path to a solution, but curiosity about what exactly was happening is nagging a bit ;-)

Dorine

Solution