Components:
Prune Versions

Prune Versions

The Prune Versions component can be used to remove all versioning information from a xADL document. The end result of running a xADL document through this component is a document which has all version graphs removed as well as any links from types to their respective version nodes removed. The component achieves this by simply iterating over all types and clearing the links to their version nodes; additionally, all version graphs are removed from the document. For more information on xADL documents, visit the xADL 2.0 website.

This component could be used, for example, along with the Selector and Pruner components. Please refer to the Selector Driver component for instructions on how to use the Selector, Pruner, and Prune Versions components through a convenient GUI.


Using the Prune Versions component

In order to use the Prune Versions component, it is necessary to create and fire off a PerformPruneVersionsMessage within the component that wishes to make use of the Prune Versions service. The PerformPruneVersionsMessage constructor is defined as follows:

PerformPruneVersionsMessage

public PerformPruneVersionsMessage(String archURL,
               String targetArchURL, String componentID)
Parameters:
archURL - This is the URL of the xADL document that needs to be pruned
targetArchURL - This is the URL of the new xADL document that will be created and store the pruned architecture
componentID - ID of the component creating the message. This allows the requesting component to selectively listen in on the progress messages sent out by the Pruner component. This field can be null.

The PerformPruneVersionsMessage should be sent up the ArchStudio architecture. The following code demonstrates this:

/*
 * Create a PerformPruneVersionsMessage message.
 * Assumes that arguments used exist and were
 * already assigned appropriately.
 */

PerformPruneVersionsMessage pruneMessage =
  new PerformPruneVersionsMessage(archURL, targetArchURL,
  componentID);

// Send request up to the Prune Versions' bottom Iface
sendToAll(pruneMessage, topIface);

The Prune Versions component fires off PruneVersionsStatusMessage messages to indicate the progress of the "pruning." These messages can be intercepted and used to keep track of the progress of the Prune Versions operations. The PruneVersionsStatusMessage message holds the following values that can be used for determining the state of a "prune" operation:

PruneVersionsStatusMessage

public PruneVersionsStatusMessage(String prunedArchURL,
   String componentID, int currentValue, int upperBound ,boolean isDone,
   boolean errorOccurred, Exception error)
Parameters:
prunedArchURL - The URL of the pruned/pruning document
componentID - ID of the component that sent off the PerformPruneVersionsMessage to initiate the pruning. This field may be null
currentValue - Current value of progress
upperBound - Upper bound on progress value
isDone - Indicates whether or not the pruning process is done
errorOccurred - Indicates whether or not an error occurred
error - The error, if there was one, or null, if no error occurred. Refer to the list below for possible exceptions.
Exceptions:
InvalidURLException - This exception is thrown if the provided URL to open an xArch document is invalid or the name for a target URL is empty.

All of these values can be obtained through a simple get operation. For example, getPrunedArchURL() would get the prunedArchURL value, getComponentID() would get the componentID value, and so forth.


Questions about the Prune Versions component should be sent to Christopher Van der Westhuizen.