Script variable and Send Mail event.


I Have the following part of a diagram Script1->Task1->Script2->Task2. I have set Send Email on Task2.

On Script1 I initialiaze a Variable Task2Var := 0, then on Script2 I set Task2Var := IncMinutes(Now,20);

On the SendEmail event I'm loading the workflow instance to read the value of Task2Var, but I always get the Value of 0,
looks like SendMail event is executed before the Script2 has been executed. What I'm looking is to include on the email the updated value of

Any hints?

Thanks in adavnce,

Omar Zelaya

While the workflow is being executed, it's not saved in the database yet. If you are trying to load the instance during the SendEmail, the instance is still in execution, and you will load only the previous copy of it in the database, with the old variable value.