Re: WODisplayGroup, ERXWORepetition and object deletion
Re: WODisplayGroup, ERXWORepetition and object deletion
- Subject: Re: WODisplayGroup, ERXWORepetition and object deletion
- From: Theodore Petrosky <email@hidden>
- Date: Thu, 03 Dec 2015 12:09:33 -0500
> On Dec 3, 2015, at 6:59 AM, Paul Hoadley <email@hidden> wrote:
>
> Hi Ted,
>
> On 3 Dec 2015, at 9:47 pm, Theodore Petrosky <email@hidden> wrote:
>
>> Would it be better to not delete the Job, but instead mark it isDeleted=true. then you have the best of both worlds?
>
> Say that we did that.
>
>> You could also ask the system, Show me all the deleted Jobs.
>
> Then say that we did that—one display group for active Jobs, another for deleted Jobs. Now what we’ve got is a minimal variation on what I described:
>
>>> Is that the best I can do? In this slightly abridged scenario, the Job got deleted, and that was the only action available, so the informational message can say “The selected Job was already deleted”. But all I really know is that the Job is no longer where it once was in displayedObjects()—right? Say it just got moved by that action method above—
>
> Say, indeed, that user A caused J1.isDeleted to now be true. Assume that the display group of interest shows non-deleted Jobs (for which isDeleted() returns false), and B still sees J1 on it. We’re back to square one, because J1 has still been _moved out of_ that display group (because it no longer matches the qualifier on isDeleted). At this point, we’re back at the original question:
User A caused J1 (PK=7654) to update isDeleted=true. J1 isn’t moved out of the displayGroup. If you click the edit button, you can still ‘edit’ the job, but maybe you set a message to say, “Sorry, this job has been marked completed so you can not edit it unless you reopen it!"
I have done this before, I have a delete button that passes the object and sets the isDeleted=true on this object then saveChanges().
It shouldn’t matter if User B is looking at a displayGroup that is sorted differently (stale data) and has this object. The object still exists. When I click the delete button, the method that is fired sees that isDeleted=true on the object.
if (object.isDeleted=true) {
tell the user that it was already deleted (and by whom and when)
}
I feel like I did this a number of times on job tracking systems I have created for various companies, and I never had a problem.
I am going to look at the project I did before and see if there were an issue.
Of course, I may be totally misunderstanding!!!!
>
>>> is there any way to retrieve J1 when user B hits that method? (I’m not convinced you’d want that in every case, or even many cases, because the selection has been made based on stale data in front of user B. Let’s just consider this a thought experiment.)
>
> Finally:
>
>> Doesn’t it also imply that you could have 10 users delete the same stale data on their screen, with no badness. So what if 10 users mark a record isDeleted=true.
>
>
> That’s not the problem here. The problem (within the constraints that I’ve set up) is that the first user can do that, but the remaining nine _can’t find the object they select_.
>
>
> --
> Paul Hoadley
> http://logicsquad.net/
>
>
>
_______________________________________________
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