Using the SystemWeaver Script Language, you can configure a change log of all items that are subject to change control and include this in a report or document. This article describes how to add items to the change log as well as how to define how the information will be presented. Configuration examples are provided in a separate article


There are three types of changes handled by the change log - new, updated and deleted. A change is considered to have occurred between two consecutive versions. So, to obtain results, there must be a previous version to compare to.  The types of changes that you can specify are: 

new

Items that have been added since the previous version


updated

Items that have been updated since the previous version


deleted

Items that have been deleted since the previous version


Adding Items to the Change Log

The first key part is to configure which items to add to the change log. 

<AddToChangeLog/> is used to define which items will be considered as subject for showing in the log. 


 In this example, all parts of part type "REQS" in this path are candidates for being added to the change log. Other parts not added to the change log in this manner, will not be shown in the change log. 

...
<ForEach select="/5IRS/REQS">
    <AddToChangeLog/>
</ForEach> 
... 

Defining Which Information to Include

The second key part is to define what information to display for the items that are added to the change log. <ForEachItemInChangeLog> and <ChangeLog> can both be used for this purpose. 


ForEachItemInChangeLog 

<ForEachItemInChangeLog> is more flexible than ChangeLog as far as what you can write about the items. For example, <Filter> may be used in the <ForEachItemInChangeLog> tag. 

Valid type attribute values are "new", "updated", and "deleted".

... 
<Section title="Change Log">
    <Section title="New items">
      <ForEachItemInChangeLog type="new">
        <Text> item #{Name}</Text>
      </ForEachItemInChangeLog>
    </Section>
...

In the above example, the name will be displayed for all new items in the change log.


ChangeLog

<ChangeLog> has three attributes: type, name_format, and id_format

Valid type attribute values are "new", "updated", and "deleted".


Formats

If the name_format attribute is included, its value is used to define what information should be presented about the item. If the attribute is excluded the Name of the item is shown.


If the id_format attribute is included, its value is used to define what id information should be presented about the item. 

... 
<Section title="Deleted items">
  <ChangeLog type="deleted" name_format="#{Name} [#{Type.Name}]"/>
</Section>
...

In the above example, the name and item type will be included for all deleted items in the change log.


Note: If no type is indicated, all items that are subject to the change control will be listed.


What's Next?

Check out some change log configuration examples.