Filtering On Unsaved Changes

Here is the scenario. I'm in a module making several object changes and will like to filter on all the objects I have changed but yet not saved. Is it possible to filter on red change bars? Remember, a red change bar signifies a change was made but unsaved.

If it's not possible then no sweat. It just means more coding for me to implement this feature.

Thanks.
pete.kowalski - Fri Jul 03 12:42:18 EDT 2009

Re: Filtering On Unsaved Changes
SystemAdmin - Wed Jul 08 09:29:24 EDT 2009

I don't think that can be done via the DOORS GUI, but the following script should do the job:
 

Object obj
for obj in entire current Module do {
    if (unsaved obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

Re: Filtering On Unsaved Changes
dpechacek - Wed Jul 08 14:28:28 EDT 2009

SystemAdmin - Wed Jul 08 09:29:24 EDT 2009

I don't think that can be done via the DOORS GUI, but the following script should do the job:
 

Object obj
for obj in entire current Module do {
    if (unsaved obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

I thought there was an unsaved(object) function but didn't find it in the documentation so didn't want to post it.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Filtering On Unsaved Changes
pete.kowalski - Sat Jul 11 18:42:28 EDT 2009

@noillagr:

thanks the code. it did exactly what i wanted.
@dpechacek:

i thought there was a "unsaved" function as well. i vaguely doing something with it back in the DOORS 5.2 or DOORS 6 days but as you couldn't find any documentation about it.

Re: Filtering On Unsaved Changes
UdoA - Tue Aug 11 04:32:18 EDT 2009

SystemAdmin - Wed Jul 08 09:29:24 EDT 2009

I don't think that can be done via the DOORS GUI, but the following script should do the job:
 

Object obj
for obj in entire current Module do {
    if (unsaved obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

@noillagr

On which DOORS version did you run this script?
We currently use 8.1 and I get an "incorrect arguments for function (unsaved)" error.

I guess that in 8.1 only a unsaved(Module m) function is available, but not an unsaved(Object o)
In which version the unsaved(Object o) function was introduced?

Re: Filtering On Unsaved Changes
llandale - Tue Aug 11 10:43:56 EDT 2009

SystemAdmin - Wed Jul 08 09:29:24 EDT 2009

I don't think that can be done via the DOORS GUI, but the following script should do the job:
 

Object obj
for obj in entire current Module do {
    if (unsaved obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

Here are some other related commands. I'm too lazy to prove it but put my suspisions in comments; perhaps someone can confirm.

bool sectionNeedsSaved(Object)SectionNeedsSaved // ?Shared section has changes
bool saved(Object) SavedObj // ?Yellow? changes to object have been saved?
bool unsaved(Object) UnsavedObj // ?Red? Not been saved
bool baselined(Object) BaselinedObj // ?Green? no changes since module baseline
bool new(Object) NewObj // ?Created and Red? not yet saved
bool modified(Object) ModifiedObj // ?modified since module open? Even if saved?

  • louie

Re: Filtering On Unsaved Changes
llandale - Tue Aug 11 10:46:23 EDT 2009

You could also probably do this using the intOf(o."Last Modified On") compared to the intOf(the current module session start date). If so, this filter can be calculated (w/o accept/reject) and saved in a view.

  • Louie

Re: Filtering On Unsaved Changes
dofstead - Tue Oct 18 11:30:50 EDT 2011

llandale - Tue Aug 11 10:43:56 EDT 2009
Here are some other related commands. I'm too lazy to prove it but put my suspisions in comments; perhaps someone can confirm.

bool sectionNeedsSaved(Object)SectionNeedsSaved // ?Shared section has changes
bool saved(Object) SavedObj // ?Yellow? changes to object have been saved?
bool unsaved(Object) UnsavedObj // ?Red? Not been saved
bool baselined(Object) BaselinedObj // ?Green? no changes since module baseline
bool new(Object) NewObj // ?Created and Red? not yet saved
bool modified(Object) ModifiedObj // ?modified since module open? Even if saved?

  • louie

I found that newly created objects need special attention in order to shown in the filtered results. Using Louie's suggestion, I found this to show unsaved and newly created objects. "New", "red" objects are apparently not conisdered to be "unsaved" objects.
 

Object obj
for obj in entire current Module do {
    if (unsaved obj || new obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

 


Dave

 

Re: Filtering On Unsaved Changes
llandale - Tue Oct 18 13:19:30 EDT 2011

dofstead - Tue Oct 18 11:30:50 EDT 2011

I found that newly created objects need special attention in order to shown in the filtered results. Using Louie's suggestion, I found this to show unsaved and newly created objects. "New", "red" objects are apparently not conisdered to be "unsaved" objects.
 

Object obj
for obj in entire current Module do {
    if (unsaved obj || new obj) {
                accept obj
        } else {
                reject obj
        }
}
filtering on

 


Dave

 

In another thread we discovered that a deleted or undeleted object does not qualify as "unsaved" and does not turn the bars red, but does qualify as asking you to save the mdoule if you try to close it before saving. We did not come up with a convenient way to query for that. We could query History in the current Session looking for softDelete or undelete history, but will need to also figure out if the module was saved After that History was generated.

  • Louie