Hi Graham,
Yes it is. In the help file Field Substitution Macros table, the requirement* macros are described as "Properties dialog: Properties tab: ..." This is incorrect, it should read "Properties dialog: Require tab: ...." and it's exactly what you're after.
Here's a way to access the data. I've done this in the Java code templates but the structure would be the same in any language, it's just that you might have to change the comment characters.
Modify your Class template, adding a line for the template we're about to create:
%ClassNotes%
%Class__Requirements%
%PI=" "%
%ClassDeclaration%
%ClassBody%Create a new custom Class template named "Requirements". The actual name will be Class__Requirements (note the double underscore). Contents for this template:
%list="Requirement__Full" @separator="\n"%with no new-line at the end of the single line in the template.
Finally, create a custom Requirement template named "Full" with the contents:
// %requirementType% requirement: %qt%%requirementName%%qt%
// Status %requirementStatus%; Difficulty %requirementDifficulty%; Priority %requirementPriority%
// Last updated %requirementLastUpdated%
%WRAP_COMMENT(requirementNotes, "60", "", "// ")%Again, no new-line at the end of the last line of the template.
This will output all available requirement information as a //-style comment. Note that there is no macro to extract the requirement Stability, and note also that if you only change a requirement and then regenerate the code, EA won't pick up on the class being changed and will not actually regenerate the code. You'll need to delete the file in between.
Sample output from the above:
package Pack;
/**
* @author sysadmin
* @version 1.0
* @created 06-mar-2009 12:32:40
*/
// Functional requirement: "Blarg"
// Status Mandatory; Difficulty High; Priority Medium
// Last updated 06-mar-2009 11:48:06
// Dearie me oh dearie me. We'll never get this done. Oh my
// paws and whiskers, etc etc.
//
//
// Despair.
// Report requirement: "Honk"
// Status Proposed; Difficulty Low; Priority High
// Last updated 06-mar-2009 12:13:27
// Important but trivial. I can take the afternoon off.
// Wo-hoo!
public class Class1 {
public Class1(){
}
public void finalize() throws Throwable {
}
}//end Class1
Cheers,
/Uffe