Search



Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The most common type of error when generating a snapshot is to ignore rule 3 and/or 4considerations pertaining to dates and active status. For example, it is reasonable to want to filter a view so that only active components are included. However, if you apply that filter in a way that restricts the substrate from which the snapshot is generated you will get incorrect results in which all components appear to be active even after they have been inactivated. An example of this error is shown on has been presented below.

Caption label
CapIdfull-release-as-at-2019-01-31
CapTypeTable
Full Release as at 2019-01-31


ideffectiveTimeactivevalue
A201701311Red
B201701311Amber
C201701311Yellow
A201801310Red
B201801311Orange
D201801311Green
B201901310Orange
E201901311Blue


The following query when applied to the full release data shown in  generates in 

Caption reference
CapRefIdfull-release-as-at-2019-01-31
CapRefTypeTable
 generates the erroneous snapshot view shown in 
Caption reference
CapRefIderroneous-snapshot-view-as-at-2019-01-31
CapRefTypeTable
.  This query excludes inactive rows at the same time as identifying the most recent effectiveTime. The result is that components A and B are shown as active because the later rows that inactivated those components were excluded.

Code Block
Select * from `component` `c` where
 `c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id` and active=1)



Caption label
CapIderroneous-snapshot-view-as-at-2019-01-31
CapTypeTable
Erroneous Snapshot view as at 2019-01-31


ideffectiveTimeactivevalue
A201701311Red
C201701311Yellow
B201801311Orange
D201801311Green
E201901311Blue


The following query when applied to the full release data shown in  generates in 

Caption reference
CapRefIdfull-release-as-at-2019-01-31
CapRefTypeTable
 generates the correct snapshot view shown in 
Caption reference
CapRefIdcorrect-snapshot-view-as-at-2019-01-31
CapRefTypeTable
. The most recent versions of all the components A-E are included. In the case of components A and B these are both inactive.

...

Code Block
Select * from `component` `c` 
 where `c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id`)


Caption label
CapIdcorrect-snapshot-view-as-at-2019-01-31
CapTypeTable
Correct Snapshot view as at 2019-01-31


ideffectiveTimeactivevalue
C201701311Yellow
A201801310Red
D201801311Green
B201901310Orange
E201901311Blue


The following query when applied to the full release data shown in  generates in 

Caption reference
CapRefIdfull-release-as-at-2019-01-31
CapRefTypeTable
 generates the correct snapshot view shown in  with in 
Caption reference
CapRefIdcorrect-snapshot-view-as-at-2019-01-31-with-inactive-rows-excluded
CapRefTypeTable
 with inactive rows filtered out after generating the snapshot view. Only components C-E are included as the most recent versions of components A and B are inactive.

...

Code Block
Select * from `component` `c` 
 where `c`.`active`=1
 and `c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id`)


Caption label
CapIdcorrect-snapshot-view-as-at-2019-01-31-with-inactive-rows-excluded
CapTypeTable
Correct Snapshot view as at 2019-01-31 with inactive rows excluded


ideffectiveTimeactivevalue
C201701311Yellow
D201801311Green
E201901311Blue