In this article we discover the possibilities of Document Script fragments when dealing with complex requirements for document geneneration templates in Sparx Enterprise Architect.
The request
The other day I got a difficult request for a document generation template. At this client they are documenting Use Case scenarios using the structured scenario editor in EA. Each scenario step can be linked to a requirement element.

Each Requirement could have one or more constraints

Based on these scenarios the customer wanted to generate a test scenario document that contained a table like this
| Step | Step description | Requirement | Requirement constraints |
|---|---|---|---|
| 1 | User chooses to make a new reservation | ||
| 2 | System show the reservation screen where the user can enter Begin, Endate and Roomtype | ||
| 3 | User enters begindate and enddate or the numbers of nights | REQ_RV_ 403 Reservation period | Invariant: StartDate < Enddate Post-condition: A reservation must have a reservation period in the future |
The first three columns are available in the standard point and click templates, but the problematic part is the Requirement constraints.… Read more





The mappings can be made between Classes, Attributes and Associations, and allows for many-to-many mappings. For each mapping you can add a description of the mapping logic to be applied.…