Method for collapsing a version tree which depicts a history of system data and processes for an enterprise5671398Abstract The method of the present invention is useful in a computer system having a user interface, a memory, a database and a repository operative in the computer system for accessing the database. The method is implemented by the computer system for collapsing a version tree that depicts a history of objects stored in the database. The method, which is stored in the memory at run-time, comprises the steps of validating collapse request by insuring that the target object is not a ghost object, the end object is not a ghost, the end object is on the same version tree as the target object, and the end object is a later version than the target object. An empty array representing path objects is initialized from the target object to the end object; and if an end object is supplied, a function is called to build up an array of objects representing paths from the target object to the end object. The array of objects built up in the preceding steps is processed. For each nextVersion of the target object, a function is called to collapse the versions starting from nextVersion; and, a function is also called to destruct the target object. Claims What is claimed is: Description FIELD OF THE INVENTION
TABLE I
______________________________________
Type Description
______________________________________
Array Creates a dynamic array of objects in which an
integer index can be used to access array
members. An array can contain duplicate
objects.
List Creates an ordered collection of objects. A
list can contain duplicate objects.
Set Creates an unordered collection of objects.
Objects in a set must be unique.
______________________________________
Operations An operation is a feature that represents a behavior that objects can possess. An operation can be thought of as a function: it has a name, an optional set of parameters, and an optional return type. Like properties, operations are applied to each object within the owning type. Consequently, an operation is generally invoked in the context of a specific object. An operation can have parameters that identify information a caller must provide when invoking the operation. If an operation has no parameters, a caller merely invokes the operation for the desired object. For example, consider the following features:
TABLE II
______________________________________
Domain/Return
Type Feature Type
______________________________________
Employee birthDate (attribute)
Date
age (operation)
Integer
______________________________________
As shown, the birthDate attribute has a domain of Date. Age is an operation (with no parameters) whose return type is Integer. The purpose of age is to compute an employee's current age (in years) from his or her birth date. Because the age operation is invoked for a specific employee, it is able to obtain the value of that employee's birthDate attribute, make the necessary computation, and return the appropriate integer without requiring parameters. When an operation has parameters, each parameter has semantics similar to those of properties. Each parameter has a name, a domain type, and a set of options that can be used to affect the behavior of the parameter. The following table shows an example of an operation, defined for the Employee type, that has parameters:
TABLE III
______________________________________
Parameter Parameter
Operation Parameter Domain Options
______________________________________
setSalary amount Real REQUIRED
authorizedBy
Manager REQUIRED
effective Date DEFAULT today's
date
______________________________________
The setSalary operation has three parameters: The amount parameter is a Real number (floating-point) that is required. Therefore, the caller must specify a value for this parameter. The authorizedBy parameter is a Manager object that also is required. The effective parameter is a date parameter that is not required. However, if the caller does not specify a value for this parameter, the current system date is used by default. A multi-valued parameter is a collection of values. Such a parameter is useful when the operation must operate on several objects even though it is invoked in the context of a single object. An operation optionally can return an object when it completes processing, just as a program function can return a value. An operation that returns an object is called typed because it has a return type specified. An operation that does not return an object is called un-typed because it does not have a return type specified. A return type must be one of the types recognized by the repository. An operation can return a collection of objects by specifying a collection as its return type. An operation can be defined for a type and then redefined for each subtype of the original type. This process is called overriding an operation. When an operation is overridden, a subtype that inherits the operation has a separate method that redefines the functionality of that operation. The technique that the repository uses to choose which method to call for a given operation is called dynamic binding. Dynamic binding (also called polymorphism) means that the repository chooses the method that is most specific for a given object and operation. The most specific method is the one defined in the lowest subtype of which the object is an instance. For example, assume setSalary is an operation defined for the Employee type. An employee object can be an instance of the Employee type or one of its subtypes. If you call the setSalary operation for an object that is an Employee instance, the repository selects the method associated with the setSalary operation defined for the employee type. If you call the setSalary operation for an object that is a Manager instance, the repository selects the method associated with the setSalary operation as it is redefined for the Manager type. If the Manager type does not redefine the setSalary operation, the repository selects the method associated with the setSalary operation defined for the Employee type as the immediate supertype of the Manager type. You can define an operation to be called with different sets of parameters. For example, you might define the setSalary operation to be called with only an amount parameter or with both an amount parameter and an effectiveDate parameter. Each combination of parameters that an operation can accept is called a signature. To define multiple signatures for an operation, you define the operation more than once in the same owner type and use the desired signature for each definition. Methods The operations defined for a model form an interface that can be seen by a caller. Separate from this definition, each operation must be implemented by a module of code called a method. Methods are typically written as separate functions and bound into a set of code libraries. The method code library name for each operation is then identified to the repository as part of the definition of the operation. When a caller invokes an operation, the request is received by the repository, which finds and calls the appropriate method. The operation passes to the method the appropriate parameters. When a method is called, it can then act as a caller and call back into the repository to invoke other operations. Consequently, a method can be thought of as a specialized kind of application program. Objects An object is an abstract representation of a real-world concept or thing-such as a person, a software package, or an event-that is stored in the repository. In the repository, the state of an object is represented by the values of the properties defined for the type. For example, the state of an integer is its numeric value. The state of a person is its name, birthDate, spouse and so on. The behavior of an object is the set of functions that the object can perform. In the repository, the behavior of an object is represented by the operations defined for the owner type. A characteristic of object behavior is the ability to return some of its state to a requester. For example, the object person can return its name. For this reason, some object models describe object behavior as the set of messages that an object can receive and respond to. One example of object behavior is the capability an integer has to perform such functions as addition, square root and absolute value. A Component Object is a versioned object (i.e., a particular historical state of an object) that is part of a composite object. The relationship of the component object to the composite object is defined by a composition relationship. A component object can itself be a composite object. In this case, the component object contains other component objects related to it by composition relationships. A component object can belong to several composite objects. This feature promotes sharing of objects in the repository. A Composite Context is a type that defines the scope of a composite hierarchy. The composite context identifies the top object for the hierarchy and the ghost objects that were created while the context was the current composite context. The term ghost as used herein means a value associated with a changeable object. Objects with ghost status can only be viewed in certain situations, i.e. they are only visible in the context in which they were created. A Composite Hierarchy is a tree structure composed of a composite object and its component objects. The hierarchy also includes the component objects for any component object that is itself a composite object. Thus, this structure defines the component objects of the top, or root object, the components of those components, and so on to the bottom of the hierarchy. A Composite Object is a versioned object for which at least one composite relationship is defined thus allowing the object to have components. A composite object can be thought of as owning its component objects. Some examples of these are: a car engine-the component objects include spark plugs, wires and pistons; a program-the component objects include files, record layouts and modules; a menu-the component objects are the various selections on the menu. A Composite Relationship is the relationship that links a composite object to its component objects. The relationship between a car engine and its parts-spark plugs, pistons, wires and so on-can be used to illustrate a composite relationship. The car engine and its components can be treated as a single object, yet each of the parts can be accessed individually. The term Visibility is used with versioned objects whose reserveStatus value is ghost. A ghost object is visible only in the composite context in which it was created. When this composite context is the current object, one can change the attributes of the ghost object, add or remove an object from the attributes of another object and so on. A Versionable Object is a repository object for which the version service records state changes over time. Each Module in FIG. 2 is a versionable object. A Versioned Object is a repository object that represents a particular historical state of a versionable object. In FIG. 2 each circle stands for a versioned object that represents a particular state of Module. Referring now to FIG. 2, a version tree is shown which represents the historical states of a versionable object in the repository. In particular, FIG. 2 shows an example of a version tree for a versionable repository object called Module. The following definitions will be helpful in understanding this invention when taken in conjunction with the tree shown in FIG. 2. A Variant Branch, which represents a single line of development, is a subset of versioned objects in a version tree. The variant branch is a linear path that shows the history of changes from one versioned object to another for a particular line of development. In FIG. 2, the version tree has three variant branches-mainline, variant A and variant B. The mainline branch is made up of objects 30 through 33. The variant A branch is the path including objects 34 and 35 (labeled Module v1 {mainline} and Module v4 {variant}). The variant B branch is the path including object 36 (labeled Module v3 {variant B}). A Variant is a versioned object on a variant branch. A version tree can contain multiple variants at the same level of ancestry. The terms Variant and Versioned Object are interchangeable. In FIG. 2 there are two variants of Module-object 34 on the variant A branch and object 33 on the mainline branch-as the final level (v4) The method of the present invention identifies each variant by its version number and its variant name. A Version Number is the first of two identifiers used by the method of this invention to distinguish a versioned object in a version tree. This number is an integer that represents a level of ancestry in the version tree. In FIG. 2 the version number is represented by a lowercase "v" followed by an integer. For example, the root Module is labeled v1. At the second level of the graph, the object derived from the root object is labeled v2. The Variant Name is the second of two identifiers used to distinguish a Versioned Object in a version tree. This name is a string that distinguishes a particular variant branch in the version tree. The Variant Name supports the maintenance of parallel lines of development. A Versioned Object can have many descendant variants representing different lines of development. In FIG. 2 the Variant Name is shown in braces. For example the main line of development is labeled {mainline}. The version service 22d uses the check-in/check-out model for creating and controlling versions of objects. This model requires that a versioned object be checked out before it can be modified. This step places the object in a state in which it can be modified. When the modifications have been completed the versioned object must be checked back in. As the objects are checked in and out, the reserved status changes. The version service enables one to determine whether the history of certain state changes to versionable objects should be retained. Specifically, the version service 22d enables one to modify properties defined as not significant without checking out the object. If one does not check out the object, the version service does not maintain a record of the changes. It should be pointed out however that the version service automatically checks out an object if a user makes a change to a significant property of that object. The reserve status of a versioned object indicates the visibility and availability of the object for different operations. The reserve status is determined by the value of the reserveStatus property defined for the repository VersionedObject type. The reserve status of a versioned object can be one of the following values:
TABLE IV
______________________________________
Value Description
______________________________________
available indicates that the versioned object has no
successor objects and therefore can be
reserved.
readOnly indicates that the versioned object has a
successor object on the same variant branch
and therefore can be reserved only if the
user defines the variant parameter for the
reserve operation.
source indicates that the versioned object has
successor objects, but that none of the
successor objects are on the same variant
branch as the versioned object. Therefore,
the variant name is optional when reserving
the object.
ghost indicates that the versioned object can be
modified. The object is visible only if it
is checked out in the current composite
context.
______________________________________
The reserve status is set when the following operations defined for the repository VersionedObject type are used:
TABLE V
______________________________________
Operation Description
______________________________________
merge Checks out a versioned object by merging the
current versioned object with a designated
object.
replace Checks in a previously reserved versioned
object and sets the reserveStatus property
value to available.
reserve Checks out a versioned object by creating a
copy of the object, and sets the
reserveStatus property value of the copy to
ghost.
unreserve Deletes the ghost object for a previously
reserved versioned object. If there are no
more next versions, the operation sets the
reserveStatus property value of the object to
available.
______________________________________
Referring now to FIG. 3, a more complex version tree is illustrated, which tree is helpful in understanding the steps performed by the method of the present invention. Like reference numerals are used in FIG. 3 to show expansion of the version tree shown in FIG. 2. To create another variant on the mainline branch, such as module v5 (object 37), the user calls the reserve operation for module v4 ›mainline!. The user defines the variant parameter of this operation as a "." (period). The reserve operation thus creates the new object 37 on the same variant branch as the object being reserved. The reserve operation sets the reserve status of the new object 37 as ghost; and, it derives the other property values for the new object from the object being reserved, i.e. module v4 ›mainline!. The reserve operation also changes the reserve status of the object being reserved, module v4 ›mainline!, to readOnly. To make the new object 37 visible to other users, the operator calls the replace operation for this object. The replace operation sets the reserve status of module v5 ›mainline! (object 37) to available. Object 38 (module v5 ›variantA!) is created the same way off of object 35 as object 37 was created off of object 33. In a similar manner, object 39 is created off of object 36 (module v3 ›variantB!), by repeating the above steps for each of the objects so created. Object 42 (module v5 ›variantD!) is created off of object 35 by use of the reserve operation. However, in this case a name is assigned to the branch by defining the variant parameter as variant D. In a similar manner, object 43 is created off of object 36 by the same reserve status operation. The user can merge an object from one variant branch into an object on a different variant branch by calling the merge operation defined for the repository VersionedObject type. For example, object 40 is derived by merging object 33 with object 39, and object 44 is derived by merging object 43 with object FIG. 4 shows the version tree of FIG. 3 after the Module v3 ›variantA! has been collapsed by using this Module as the target object and null as the end object. The operation is to remove all sub branches. As a result of this operation all objects on the variantA branch starting from v3 and all subbranches which emanate from any of these objects are deleted from the version tree (i.e., objects 34, 35, 38 and 42 are deleted). It is noted that if either the Module v5 ›variantA! or Module v5 ›varinatA! had been ghost, the operation would have failed. Another example of the version tree after a collapse operation is shown is shown in FIG. 5. Here the target object is Module v3 ›variantB! and the end object is laterVersion Module v6 ›variantB!. The operation is to remove all subbranches. As a result of this operation all objects on variantB from v3 (inclusive) up to but not including v6 are deleted. The variantC subbranch is also deleted. Hence, objects 39, 43 and 44 are deleted. Module v6 ›variantB! now takes the place of Module v3 ›variantB! in the version tree. Note that the previous versions-next versions relationships which had existed with Module v4 ›mainline! are no longer present. At this juncture of the description, the details of the method of the present invention will be more fully appreciated following the description hereinbelow when taken in conjunction with FIGS. 6A through 10C. Referring now to FIG. 6A, the first of a two-sheet flow chart illustrates the operations; performed in collapsing a version tree, such as that shown in FIG. 3 and described hereinabove, by the use of identifiers. The process begins with the start bubble 50 and then to a process block 51 wherein the request parameters are validated. Following this step an inquiry is made as depicted by a decision diamond 52 as to whether or not the validation is correct or ("OK"). That is, the collapse request is validated by insuring that (1) the variant name supplied is a viable variant name, and (2) the earlier version number is non-negative. If the answer is no then the process is exited as illustrated by a stop bubble 53. If the validation is correct then a step of initializing earlier and later versioned objects to null is performed (block 54). Next, it must be determined if the later version number is zero, which process step is depicted by an inquiry diamond 55. If the later version number is not zero, then a process step of locating the object with specified variant and later version number is performed (block 56). An inquiry is made as to whether or not the object was found (diamond 57). If the object was not found then an error is issued as shown by block 58. At this juncture, reference is made to FIG. 6B, as denoted by a connector X, for continuation of this flow-chart description. On the other hand, if the later version is equal to zero (diamond 55), or the object was found (diamond 57), or after an error was issued (block 58), then another inquiry is made as to whether or not the earlier version number is zero (decision diamond 59). If the earlier version number is zero, then a branch is made to a process step of locating the root object of the specified variant branch (block 60). On the other hand, if the earlier version number is not equal to zero, then a branch is made to another process step of locating the object at earlier branch and version (block 61. ). Once either of these process steps (i.e.,blocks 60 or 61) has been completed, then yet another inquiry is made as to whether or not the earlier object was found (diamond 62). If the earlier object was not found then an error is issued as depicted by process block 63. Once this step has been performed or if the object was found then still another inquiry is made as to whether or not the freeMode is null (diamond 64). If the freeMode is null, then the process step of setting freeMode to objectOnly is performed as shown by a process block 65. Once this process step has been performed or if freeMode is not equal to null, then another inquiry is made as to whether or not any errors have been issued (diamond 66). If any errors have been issued then the process is exited as depicted by a stop bubble 67. 0n the other hand, if no errors have been issued then a process step of calling collapseVersionsTo (by end object), which is sending a message to earlier object and specifying later object as the end object are performed (block 68). Once these steps have been performed then the process is exited as depicted by a stop bubble 69. The pseudo code for the process described above is set forth in Appendix A hereof. Referring now to FIG. 7A, the first of a two sheet flow chart illustrating a process for collapsing a version tree by providing the end object to the target is shown. The process begins with a start bubble 70 followed by a process step (block 71) for validating the collapse request. This step insures that (1) the target object is not a ghost object, (2) the end object, if supplied, is not a ghost, (3) the end object, if supplied, is in the same version tree as the target object, (4) the end object, if supplied, is on the same variant branch as the target object, and (5) the end object, if supplied, is a later version than the target object. Next an inquiry is made as to whether or not the collapse request is valid (diamond 72). If the request is not valid, then the process is exited as depicted by a stop bubble 73. On the other hand if the request is valid then a process step is entered for beginning an update transaction a represented by a block 74. Following this step, another process step is performed for initializing an empty array which represents the path objects from the target object to the end object (block 75). An inquiry is next made as to whether or not the end object was supplied (diamond 76). If an end object was supplied then a process step of calling the function to build up the array of objects representing the paths from the target object to the end object is performed (block 77). Next, another process step of processing the path built in the process step depicted by block 77 is performed (block 78). After this process step, another inquiry is made as to whether or not any errors were detected while processing the path (diamond 79). If any errors were detected, then an exit is taken as depicted by stop bubble 80. On the other hand, if no errors were detected, or no end object was supplied (from diamond 76), then a branch is taken to FIG. 7B, as denoted by a connector Y, for a continuation of this flow-chart description. A process sequence is next entered at process block 81 for each nextVersion of the target object. The function to collapse is called for each of the versions as depicted by process block 82. An inquiry is next made as to whether or not the result returned is false (diamond 83). If the answer to this inquiry is yes then an error is issued (block 84) followed by a step of aborting the transaction (block 85), which is followed by an exit of the process (bubble 86). On the other hand if the result was not false, then still another inquiry is made as to whether or not there are more nextVersions (diamond 87). If the answer to this inquiry is yes then a branch is taken back to process block 81 to retrieve the next object. Once all of the nextVersions have been processed then a process step of calling the function to destruct the target is performed (block 88). Next a process step of committing the transaction is performed (block 89) followed by an exit from the process as depicted by a stop bubble 90. The pseudo code for the process described hereinabove is set forth in Appendix B hereof. Referring now to FIG. 8A, the first of a two-sheet flow chart illustrates the steps of a recursive process for building the path to collapse. The process begins with a start bubble 91 followed by entry into a sequence of process steps for each nextVersion of the target object, beginning with a process block 92. Next, a process step (block 93) of initializing a continueWalk flag to TRUE is performed. An inquiry is next made as to whether or not this nextVersion is in the path or this nextVersion is the end object (diamond 94). If the answer is yes, then a process step for setting pathFound to TRUE is performed (block 95). On the other hand, if the answer to this inquiry is no then another inquiry is made as to whether or not the variant name of thisVersion is the same as the variant name of the target object (diamond 96). If the variant name of the nextVersion is not the same as the variant name of the endObject, then yet another inquiry is made as to whether the variant of the workObject is the same as the variant of EndOfPath (diamond 97). If the answer to this inquiry is no then another inquiry is made as to whether or not the nextVersion is the start of a branch (diamond 98). If it is not, then a process step of setting continueWalk to FALSE is performed (block 99). It is pointed out that the term nextVersion refers to a collection of objects, and the term workObject refers to each object obtained during the performance of the process. At this juncture, reference is made to FIG. 8B, as denoted by a connector Z, for a continuation of this flow-chart description. Following the process step depicted by the block 99, or the yes branch from any of the diamonds 96, 97, or 98, or after the process step block 99 entry is made to a decision diamond 100 to inquire if continueWalk is TRUE. If the answer to this inquiry is yes, then a process step of calling the function to collapse the versions starting from this nextVersion is performed (block 101). Another inquiry is made after this step as to whether or not the function returned is TRUE (diamond 102). If it is TRUE then another inquiry is made as to whether or not this nextVersion is the end of the path (diamond 103). If it is not the end of the path then a process step of adding this nextVersion to the path is performed (block 104). If the nextVersion is the end of the path or after the adding step (block 104) is complete, another process step of setting pathFound to TRUE is performed (block 105). If the answer to the inquiry if continueWalk is TRUE (diamond 100), or if the function returned is not TRUE (diamond 102) or after the step of setting pathFound to TRUE (block 105) entry is made to yet another decision diamond 106 to inquire if there are more nextVersions. If the answer is yes then a branch is taken back to the process step depicted by the block 92 to start the process anew. If the answer is no then the process is exited as depicted by a stop bubble 107 and the pathFound is returned. The pseudo code for the above-described process is set forth in Appendix C hereof. Referring now to FIG. 9A, the first of a two-sheet flow chart illustrating the steps for collapsing the path in collapseVersionsTo is shown. The process begins with a start bubble 108 followed by a sequence of process steps for each object in the path (block 109) and another process step for each nextVersion of this path object (block 110). If this object can be collapsed (diamond 111), which means (1) this object is not part of the path (2) this object is not the later version object (3) this object is not the result of a merge operation. If the answer to this inquiry is yes then the process step of calling the function to collapse the versions starting from this object (block 112). Next, an inquiry is made as to whether or not there are any errors (diamond 113). If any errors were detected then the process is exited as depicted by a stop bubble 114. On the other hand if there were no errors, or the object is not collapsible (diamond 111) then yet another inquiry is made as to whether or not there are more nextVersions (diamond 115). If the answer to this inquiry is yes then a return is made back to the process block 110 for the next nextVersion. If there are no more nextVersions then a branch is taken to FIG. 9B, as denoted by a connector H, wherein; a process step of removing the current path object from the path is performed (block 116). Next another process step of calling the function to destruct the current path object is performed (block 117). An inquiry is next made as to whether or not there were any errors (diamond 118). If an error was detected, then the process is exited as depicted by a stop bubble 119. On the other hand if there were no errors, then an inquiry is made as to whether or not there are more path objects (diamond 120). If yes, then a return is made back to process block 109 to begin the process anew. On the other hand if there are no more path objects then the process is exited as depicted by a stop bubble 121. The pseudo code for the above-described process is set forth in Appendix D hereof. Referring now to FIG. 10A, the first of a three-sheet flow chart illustrating the steps of a recursive process for collapsing versioned objects out of the tree is shown. The process begins with a start bubble 125 followed by an inquiry as to whether or not the target object state is ghost (diamond 126). If the answer to this inquiry is yes then an error is issued (block 127), return is set to FALSE and the process is exited as depicted by block 128. If the target object is not ghost, then another inquiry is made as to whether or not the target object is available (diamond 129). If the target object is available then a process step of calling the function to destruct the current object is performed (block 130). Next an inquiry is made as to whether or not any errors were detected (diamond 131). If any errors were detected then the process is exited and return is set to FALSE (block 132). On the other hand if no errors were detected then the process is also exited, returning TRUE (block 133). If the target object is not available, then a branch is taken to a continuation of the flow chart in FIG. 10B, as denoted by a connector. An inquiry is made as to whether or not it is readOnly or source (diamond 134). If the answer to this inquiry is yes then another inquiry is made as to whether or not remove sub-branches is TRUE (diamond 135). That is, if remove sub-branches was not indicated, prechecking that it is worth continuing the recursive walk by performing the after-described steps denoted by reference numbers 136-140 hereinbelow. If the answer is not TRUE, then a sequence is entered for each nextVersion of the target object starting with process block 136. Next an inquiry is made if the variant name of this object is the same as the variant name of target object, which inquiry is depicted by a decision diamond 137. If it is not the same, then an error is issued (block 138), the process is exited and return is set to FALSE (block 139). On the other hand if it is the same, then an inquiry is made as to whether or not there are more objects (diamond 140). If the answer is yes then a branch is taken back to block 136 for processing anew. Once all the nextVersions have been processed as above, or the answer to the inquiry in the diamond 135 is yes; a branch is taken to FIG. 10C, as denoted by a connector L, for a continuation of the flow-chart description. Another sequence of process steps for each nextVersion is entered at a process block 141. Next an inquiry is made if this object can be collapsed, which means (1) this object is not the result of a merge or (2) this object is on the same variant branch as the target object (decision diamond 142). If the answer to this inquiry is yes, then a process step for calling the function to collapse the versions starting from the nextVersion of the step depicted by process block 141 is performed (block 143). Next an inquiry is made as to whether or not there were any errors (decision diamond 144). If an error was detected an exit from the process is taken, returning FALSE (block 145). On the other hand if no errors were detected or if the answer to the inquiry in diamond 142 is no, then an inquiry is made as to whether or not there are more workObjects as depicted by a decision diamond 146. If yes, then a return is made to the step depicted by the block 141, and if no a process step of calling the function to destruct the current object is performed (block 147). After this process step another inquiry is made as to whether or not any errors were detected (diamond 148). If an error was detected, then the process is exited, returning FALSE (block 149). If no error was detected, then the process is also exited, returning TRUE (block 150). Referring back to decision diamond 134 in FIG. 10B, if the answer to this inquiry is that the target object is not readOnly or source, then an error is issued (block 151); and, the process is exited, returning FALSE (block 152). The pseudo code for the process described above is set forth in Appendix E hereof. Although the invention has been described with reference to a specific embodiment, this description is not meant to be construed in a limiting sense. Various modifications of the disclosed embodiment as well as alternative embodiments of the invention will become apparent to one skilled in the art upon reference to the description of the invention. It is therefore contemplated that the appended claims will cover any such modifications of embodiments that fall within the true scope of the invention. APPENDIX A Page 1 of 2 The collapseVersionsTo (by identifiers)-Pseudo Code performs the following steps:
______________________________________
Reference Pseudo
Number Code
______________________________________
50 Enter
51 Define a UrepBoolean errorPushed = FALSE
If variant ==the current variant branch flag
or variant =="*"(meaning any variant)
Issue invalidVariant error and set
errorPushed = TRUE
If earlierVersion < 0
Issue invalidEarlierVersion error and
set errorPushed = TRUE
52,53 If errorPushed == TRUE
Exit
54 Define null UrepVersionedObjects
earlierObject and laterObject
55-58 If laterVersion is not null and
laterVersion==0
59-61 If earlierVersion is null or earlierVersion
= TRUE
earlierObject = result of findVersion
on "this" and variant
else
earlierObject = result of findVersion on
"this" with parameters earlierVersion and
variant
62,63 If earlierObject is null
Issue noSuchLaterVersion error and set
errorPushed = TRUE
64,65 If freeMode is null
freeMode = objectOnly
66,67 If errorPushed == TRUE
Exit
68 Call collapseVersionsTo on earlierObject
with parameters freeMode, laterObject, and
removeSubbranches
69 Exit
______________________________________
APPENDIX B Page 1 of 2
______________________________________
Reference Pseudo
Number Code
______________________________________
70 Enter
71-73 Define a UrepId myVariantName variantName
of "this"
If reserveStatus of "this" == ghost and
previousVersions of "this" is not null
Issue notValidForGhost error and exit
If laterVersion is valid
Define a UrepBoolean errorPushed = FALSE
If reserveStatus of laterVersion ==ghost
Issue cannotCollapseToGhost error and
set errorPushed = TRUE
If findRootInternal of "this" |=
findRootInternal of laterVersion
Issue differentLogicalObject error and
set errorPushed = TRUE
else
If versionNumber of "this" >= versionNumber
of laterVersion
Issue notADescendant error and set
errorPushed = TRUE
If errorPushed == TRUE
Exit
74 Begin an update transaction
75 Declare a UrepArray of UrepVersionedObjects
called path
76-80 If laterVersion is valid
Call buildPathRecurse on "this" with
parameters "this", laterVersion, and
path (the processPath logic -see next
process- which is part of this method
is present here)
If any errors occurred in the processPath
logic, the transaction is aborted and this
process is exited
81-87 For the number of nextVersions of "this",
working backwards through the array of
nextVersions
If the next nextVersion |= later
version and the number of
previousVersions of this next
nextVersion
Call collapseVersionRecurse of this next
nextVersion with parameters myVariantName,
If the call returns FALSE
Issue cannotCollapseVersions error
Abort the update transaction
Exit
88 Call destructNode on "this" with parameter
freeMode
89 commit the update transaction
90 Exit
______________________________________
APPENDIX C Page 1 of 1
______________________________________
Reference Pseudo
Number Code
______________________________________
91 Enter
Declare a UrepBoolean pathFound = FALSE
Declare a UrepBoolean continueWalk = FALSE
Declare a UrepId myVariantName = variantName
of "this"
92-106 For the number of objects in nextVersions of
"this"
continueWalk = TRUE
Define a UrepVersionedObject workObject
= the current nextVersion
If path contains workObject or
workObject == endOfPath
pathFound = TRUE
else
If variantName of workObject |=
myVariantName
if variantName or workObject |=
variantName of endOfPath
If findNext with parameters
workObject, searchUp, same
variant indicator is valid
continueWalk = FALSE
If continueWalk == TRUE
Call buildBathRecurse on workObject
with parameters "this", endOfPath, and
path
If the function returns TRUE
If workObject |=endOfPath
Add workObject to path
pathFound = TRUE
107 Exit, returning pathFound
______________________________________
APPENDIX D Page 1 of 2
______________________________________
Reference Pseudo
Number Code
______________________________________
108 Enter
109-120 For the number of objects in path, working
backwards through the array
Define a UrepVersionedObject pathObject
= the current path member
For the number of nextVersions in
pathObject, working backwards through
the array
Define a UrepVersionedObject
workObject = the current
nextVersions member
If path does not contain
workObject and workObject |=later
Version and workObject has one
previousVersion
Call collapseVersionoRecurse
on workObject with
parameters myVariantName,
freeMode and
removeSubbranches
If the result is FALSE
Issue
cannotCollapseVersions
error
Abort the update
transaction
Exit
109-120 Capture the current number of
errors
Cont'd. Remove pathObject from path
Call destructNode on pathObject with
parameter freeMode
If there are additional errors
Issue cannotCollapseVersions
error
Abort the update transaction
Exit
121 Exit
______________________________________
APPENDIX E Page 1 of 2
______________________________________
Reference Pseudo
Number Code
______________________________________
125 Enter
Define a UrepReserveStatus = myReserveStatus
of "this"
126-128 If myReserveStatus == ghost
Issue cannotDeleteBranchWithGhost error
Exit, returning FALSE
129-133 If myReserveStatus == available
Capture the current number of errors
Call destructNode on "this" with parameter
freeMode
If the number of errors increased
Exit, returning FALSE
else
Exit, returning TRUE
134 If myReserveStatus == readOnly or
myReserveStatus = source
135-140 If removeSubbranches == FALSE
For the number of objects in
nextVersions of "this"
If variantName of "this" |=
variantName of the current
nextVersion
Issue
cannotDeleteBranchWith
Subbranches error
Exit, returning FALSE
141-146 For the number of objects in nextVersions of
"this"
Define a UrepVersioned Object
workObject = the current nextVersion
141-146 If the number of previousVersions of
workObject == 1 or
variantName of this ==
variantName of workObject
Call collapseVersionsRecurse on
workObject with parameters
variant, freeMode and
removeSubbranches
If the result is FALSE
Exit, returning FALSE
147-150 Capture the current number of errors
Call destructNode on "this" with parameter
freeMode
If the number of errors increased
Exit, returning FALSE
else
Exit, returning TRUE
cont'd.
______________________________________
|
Same subclass Same class Consider this |
||||||||||
