Making changes to EO after validation?
Making changes to EO after validation?
- Subject: Making changes to EO after validation?
- From: Stirling Olson <email@hidden>
- Date: Thu, 12 May 2005 19:59:15 -0600
Hi,
I would like to make a change to an EO just AFTER it has validated
but just BEFORE it has saved to the graph/DB. Is this possible?
It appears an update goes something like this (I'm using Wonder):
willUpdate() -> validateForUpdate() -> validateForSave() -> SAVE ->
didUpdate()
What I really want is something like didValidate() which would happen
just before the SAVE. Any ideas?
To let you know what I'm trying to accomplish here:
I have Shift and CashBox EOs. When I try to close out a Shift and
Shift.endingCashBoxBalance != CashBox.balance the validation fails
UNLESS a discrepancy note has been added to the Shift EO. What I
would like to do is to update the CashBox.balance but ONLY after all
other validations have occurred and have been successful. This
allows for me to keep the "old" CashBox.balance until all other
validation problems have been cleared up. I can trick this behavior
in the components by saving twice (i.e. updating CashBox.balance and
then doing a second saveChanges() if the first succeeded) but what
I'm trying to do seems to me like a business logic problem and
therefore I'd like to put it in my EOs and not in the apps
themselves. FYI: CashBox is related to Shift through Shift.cashBox().
I can't make changes to the EOs in validateForUpdate() or
validateForSave() according to Practical WebObjects, right? Any
other ideas other than the above suggestions in each and every
component which deals with this issue?
Thanks!
-Stirling
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden