if (datasource.contains ("createuser")) { Then here createuser validation will be execute }
if (datasource.contains ("edituser")) { Then here edit user validaton will be execute }
if (datasource.contains ("logoutuser ")) { Then here logout validaton will be execute }
This is the groovy script you provided. You need these three events to happen one after another, instead of roughly at the same time? The way your groovy script is, depending on how fast it goes, it is going to process all three blocks quickly. What I propose is putting in something like this:
sleep(100);
Using that sort of command can force the groovy script to sleep to give the individual events enough time to process. Outside of that, screenshots and/or a sample of your project may help us troubleshoot.