I implement a cud process similar to what is in the documentation
describing cud using a local method as the processor and think I found
a minor problem or I don't understand something.
My incomplete local method with some debugging:
method "cudAssessment"($cudAction; $cudPhase; $cudTable; $cudResult;
$params; $cudTimestampField; $cudTimestamp)
writebr('$cudAction $cudPhase $cudResult')
case of
:($cudPhase = "query")
query([assessments]; [assessments]id =
num($params{"assessment.id"}))
:($cudPhase = "update")
buildFromParams("assessments";$params)
:($cudPhase = "delete")
// delete questions and answers
end case
return ("success")
end method
What I noticed is that my record was not being updated, (action =
update) but it was returning "success". I put the writebr in and saw
that it only did the query phase and the cleanup phase. That pointed
out that I had an error in my query as it reported missing out of
query. It then it fell through to the cleanup phase, which was
successful and the overall result was success.
Looking at the code for cud, that is exactly what will happen if your
processor does not respond to the cleanup phase.
" If you are not using transactions, most of the time you will ignore
this phase."
That leads me to believe that:
1 - You can't ignore the cleanup phase since any error would be
overwritten in the cleanup phase if not handled.
2 - If the status is not success before calling the cleanup phase, it
should report that result.
Steve Alex
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/