Dynamic Workflow voting

I am using the following peice of code for dynamic voting of workflow : 


StringBuilder voteXml = new StringBuilder("");
voteXml.Append("<Item type=\"Activity\" action=\"EvaluateActivity\">");
voteXml.Append(" <Activity>{0}</Activity>");
voteXml.Append(" <ActivityAssignment>{1}</ActivityAssignment>");
voteXml.Append(" <Paths>");
voteXml.Append(" <Path id=\"{2}\">{3}</Path>");
voteXml.Append(" </Paths>");
voteXml.Append(" <DelegateTo>0</DelegateTo>");
voteXml.Append(" <Tasks />");
voteXml.Append(" <Variables />");
voteXml.Append(" <Authentication mode=\"\" />");
voteXml.Append(" <Comments>{4}</Comments>");
voteXml.Append(" <Complete>1</Complete>");
voteXml.Append("</Item>");

Item result = inno.newItem();
result.loadAML(String.Format(voteXml.ToString(), arrActivity[i], arrActivityAssignment[i], Path, Paths, "Done"));
result = result.apply();

However there are some validations on the pre transition method of an activity, as long as the validation passes the method runs fine. However in case of an error message , the respective workflow activity is getting closed (it is supposed to remain active).

Could someone please let me know why this is happening.

Thanks.

Parents
No Data
Reply Children
No Data