Multiple server event get created

  • 1 February 2005
  • 1 reply
  • 0 views

Badge
I have an activity which has both client and server events.

WriteAuditEventToDatabase (server event writing a row to a SQL db)
CheckDocumentScreen (client screen)

The activity is set to go to a destination queue which has currently 2 members and has 1 slot.

What I have found is that because there are two activity instances created, one for each destination, two rows are being written in the database by the first server event. Is there anyway that this can be changed? I only want the first server event to be called once but the client event needs to go to each user in the destination queue. I would appreciate any ideas. I know I could split this event into its own activity but that isn't the most elegant solution!

Thanks, Chris. :?

1 reply

Badge +8
you could do a test in before running the code that runs the server event. Set a process datafield during the server event and when the event fires again the process field should be set to a value that prevents the server event from updating the DB again. This isn't elegant either, though, because your SQL might still be updating by the time the next server event comes around (I'm not sure whether k2 will handle each seperate server event as a seperate transaction)

I'd recommend that you put the server event into its own activity if at all possible.

Reply