6.7 Setting up Project Templates
6.7.2 Defining Document Object Types
Attributes
Allow to generate other document objects from this object
Allow to execute e.g. Test Cases.
Validation rules to show any inconsistencies
Note: For a full xml schema of all possible configurations, please contact [email protected].
Here are some examples for different types of attributes:
String attribute:
<StringAttribute Name="Description" /> Rich Text attribute:
<RichTextAttribute Name="Description" ValueIfEmpty="Intentionally Left Blank"/>
Integer Range attribute:
<IntRangeAttribute Name="Priority" MinValue="1"MaxValue="10"/> Enumeration attribute:
<EnumAttribute Name="Priority" >
<Items DefaultItem="Low"> <Item>High</Item>
<Item>Middle</Item> <Item>Low</Item> </Items>
</EnumAttribute>
User Enumeration attribute:
<EnumUserAttribute Name="AssignedToUser" /> Multiselect attribute:
<MultiSelectAttribute Name="Multi">
<Items>
<Item value="One" selected="true"/> <Item value="Two" selected="false"/>
<Item value="Two and a half" selected="false"/> </Items>
Array Attribute:
<ArrayAttribute Name="ObjectsInFile" />
File attribute:
<FileAttribute Name="File" /> Date Time attribute:
<DateTimeAttribute Name="DueDate" ShowTime="false" />
Table attribute:
<TableAttribute Name="Column Variants" ContainsRichText="true" ValueIfEmpty ="-">
<Columns>
<Column Template="Arial10.rtf"ReadOnly="true">My Text</Column> <CheckBoxColumn Name="CheckBoxColumn"ColumnFixedWidth="50"/> <DateTimeColumn Name="DateTimeColumn"/>
<UserEnumColumn Name="UserEnumColumn"/> <EnumColumn Name="Number">
<EnumItem Value="One"IsDefault="false"/> <EnumItem Value="Two"IsDefault="true"/> <EnumItem Value="Three"IsDefault="false"/> </EnumColumn>
<MultiSelectColumn Name="Colors"> <MultiSelectItem Value="Blue"/> <MultiSelectItem Value="Red"/> <MultiSelectItem Value="Green"/> </MultiSelectColumn>
<IncomingTracesColumn Name="References"IncludeTitle="true"> <AllowedTraceType TypeName="Requirement"/>
</IncomingTracesColumn>
<MixedTracesColumn Name="Incoming and Outgoing Traces"/> <OutgoingTracesColumn Name="Issues">
<AllowedTraceType TypeName="Issue"/> </OutgoingTracesColumn>
</Columns> </TableAttribute>
Attributes are displayed in the Document Object Form (see 2.6) in the order they appear in the template file. The Document Object Form has a fixed number of columns (8) and a flexible number of rows. When all columns are full for a row, the attribute will be placed on the next row. The row has the height of the highest control within the row. You may use the following settings for any type of attribute to control the layout:
ColumnSpan - a value between 1 – 8, where 8 is the full with of the document object form
CanGrow - can be true or false and if true, the control will adapt to display the full content. If false, a scroll bar will appear to allow the user to see the full content.
TopPadding - space above the control in pixels
BottomPadding -space below the control in pixels
LeftPadding -space left of the control in pixels RightPadding -space right of the control in pixels An example for 3 string attributes could be:
<StringAttribute Name="Description"ColumnSpan="3" CanGrow="true" Height="90"/>
<StringAttribute Name="Name"ColumnSpan="2" CanGrow="false"Height="45" TopPadding="4" BottomPadding="4"LeftPadding="10"RightPadding="10"/>
<StringAttribute Name="Comment"ColumnSpan="6" CanGrow="false"Height="90"/>
This would result in 2 rows where Description and Name are placed on one row with the nominal height 90 (the row height could grow). Name has some padding to be positioned more in the middle. On the second row Comment would be placed in the first 6 columns:
Description Comment
You can optionally define a default value that is automatically added to empty fields
(ValueIfEmpty) at Document Object creation. This is useful if you want to ensure that empty fields also in a word document, clearly states that they are empty.
For Rich Text Attributes, you can also optionally add a template:
<Template>MyRtfTemplate.rtf</Template>
And equivalent for Table columns:
<Column Template="MyRtfTemplate.rtf">Stimuli</Column>
The template is a file which you can create in word and save in the rich text format (rtf) in the same directory as your project templates. It allows you to e.g. set the default font for newly created attributes of this sort or to provide some default text in the field.
For Enum Attributes you may also define workflows by configuring the valid transitions between the values e.g.:
<EnumAttribute Name="Status"> <Items DefaultItem="Open"> <Item value="Open"/> <Item value ="Duplicate"/> <Item value ="Misunderstood"/> <Item value ="Closed"/>
</Items> <Workflow>
<Transition Value="Open"NextValue ="Duplicate"> <Conditions>
<TracedToRule ToTraceTypeName="Requirement"/>
</Conditions> </Transition>
<Transition Value="Open"NextValue ="Misunderstood"/> <Transition Value="Open"NextValue ="Closed">
<Action Action="Sign"/>
<Action Action="Email"ActionDataId="mail123"/> </Transition>
<Transition Value="Duplicate"NextValue ="Open"/> <Transition Value="Misunderstood"NextValue ="Open"/> <Transition Value="Closed"NextValue ="Open"/>
<ActionDatas>
<EmailData Id="mail123"NotifyUsersInAttribute="AssignedTo"> <UserGroupToNotify>Administrator</UserGroupToNotify> <UserGroupToNotify>Tester</UserGroupToNotify>
</EmailData> </ActionDatas> </Workflow>
</EnumAttribute>
There are a number of workflow options available:
Consistency validation- Use this conditions to validate inconsistencies as part of the transition. If the inconsistencies are found, then the user is not allowed to make the transition change.
Invalidation/Reset – Resets a state (defined as an attribute) if an attribute is changed.
Signatures - Generates an electronic signature round when a transition takes place to formally sign-off on the transition (see section 3.13).
Send Emails - Send an automatic email when a transition takes place to designated stake holders (User Groups) to keep them informed on the change that just happened. The email will contain a hyper link to the current Document Object.
Set Attribute - Allows to set an attribute to a value as a result of the workflow transition. If the attribute type is a date-time attribute, the value will default to the time now.
Copy file objects to an external location - Copies the contained file of a file attribute (if existing) to an external location on the network e.g. for DMS processing.
Here the most common options for the copy file action are explained:
Target Directory, where to place the file outside of Aligned Elements
Convert To PDF, most file types can be converted to PDF.
Log-File, a log file common to all users can be enabled, typically in the target directory
Copy File Strategy, how the file copy will be named:
o No => No Strategy, copy keeps the same name as the original file, but do not overwrite any existing file with the same name
o No Overwrite => Same as No, but overwrites any existing files if found in the target directory with the same name as the original file
IDDir => Create a subdirectory in the target directory named after the file object ID and revision and copy the file there. File name is the same the original file name.
Index => append a numeric index to the file name to make it unique
Create Unique Folder on Error, if something goes wrong after all retries, one last attempt
is to copy the file using the IDDir strategy.
Meta-Data Template File, additional information about the file can also be exported. This
will be included into a metadata file on the form of the configured template. The file must exist in the template directory
Re-Create Folder Structure, if true, the chapter structure in the file explorer will be re-
created in the target Directory and the files copied into their respective location. This way the File explorer can be mirrored in the target directory
In a similar way, a transition may be triggered by other modifications to the document object. This behaviour can be achieved through e.g. Dependent Transitions. The transition is controlled by a condition. Here an example from the File template:
<Attributes>
<StringAttribute Name="Description" /> <FileAttribute Name="File"/>
<ArrayAttribute Name="ObjectsInFile"Alias="Objects In File"/>
<ArrayAttribute Name="FrozenObjectsInFile"Alias="Frozen Objects In File"/> <EnumAttribute Name="Validity" >
<Items DefaultItem="Draft"> <Item>Draft</Item>
<Item>Released</Item> </Items>
<Workflow>
<DependentTransition Value="Released"SetValue="Draft">
<Condition AttributeName="File"Operator="AttributeChangedAnd" /> </DependentTransition>
<Transition Value="Draft"NextValue ="Released" Action="Sign"/> <Transition Value="Released"NextValue ="Draft"/>
</Workflow> </EnumAttribute> </Attributes>
The attribute Validity will automatically be set to Draft if the File Attribute ‘File’ is modified (but not if e.g. the Title is changed).
Below is an additional example for a test case result which sets the overall test result based on entries in the table ‘TestInstructions’ which has a column with checkboxes called ‘Passed’:
<EnumAttribute Name="Result"ReadOnly="true" ColumnSpan="1"> <Items DefaultItem="NotExecuted">
<Item>NotExecuted</Item> <Item>Failed</Item>
<Item>Passed</Item> </Items>
<Workflow>
<DependentTransition Value=""SetValue="Passed">
<Condition AttributeName="TestInstructions"Column="Passed" Operator="All" MatchValue
="True"/>
</DependentTransition>
<DependentTransition Value=""SetValue="Failed">
<Condition AttributeName="TestInstructions"Column="Passed" Operator="AtLeastOne"Ma tchValue="False"/>
</DependentTransition> </Workflow>
</EnumAttribute>