Author Topic: Document generation: missing linked use cases of requirements in report[solved]  (Read 196 times)

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Hi there,

I have a question about documenation generation:

I have a package and there a diagram that contains some requirements. These requirements are linked to several use cases.

I want to generate a document that lists me the package with the diagram and afterwards each requirement with description and a table with use case to which this requirement is linked (source-target relationship is shown in relationships window).

circumstances: the requirements and the use cases are located inside project browser somewhere else, they are not stored inside the package of the diagram.

from section package I chose:
- package
-- package element
--- external requirements
--- tagged value
-- child packages
-- diagram
--- element
--- connector
-- element
--- extension points
--- tagged value
--- connector
---- source
----- element
----- linked feature
--- attribute
--- child elements
-- connector
--- source
---- element
---- linked feature
--- target
---- element
---- linked feature

so the template looks like:
Code: [Select]
{ReportName}


 

package >

{Pkg.Name}
{Pkg.Notes}
package element >
external requirements >
< external requirements
tagged value >
Member Company- department
{ElementTagVal.Value} {ElementTagVal.Notes}

< tagged value

< package element

child packages >
< child packages

diagram >
{Diagram.DiagramImg}

image {Diagram.Figure}: {Diagram.Name}
{Diagram.Notes}
element >
{Element.Name}
state: {Element.Status}    release: {Element.Phase}  version: {Element.Version}  modified: {Element.DateModified}
author: {Element.Author}

description:
{Element.Notes}

Type Name Version Release
{Element.IsSpec} {Element.IsLeaf} {Element.Owner} {Element.Phase}
< element
connector >
SourceColumns
{Connector.SourceColumns}
TargetColumns
{Connector.TargetColumns}
Notes
{Connector.Notes}
IsRoot
{Connector.IsRoot}
< connector
< diagram

element >
extension points >
{ElemExtPoints.ExtensionPoint}
< extension points
tagged value >

< tagged value
connector >
source >
element >
[Package/Element/Connector/Source/Element]
Element-Name
{Element.Name}
< element
linked feature >
[Package/Element/Connector/Source/Linked Feature]
Linked Feature
{LinkedSourceFeature.Type}
< linked feature
< source
< connector
attribute >
[right-click-to-insert-Attribute-field(s)]
< attribute


child elements >
< child elements
< element

connector >
[right-click-to-insert-Connector-field(s)]
source >
element >
Connector/Source/Element - Type:
{Element.Type}

Connector/Source/Element - Name:
{Element.Name}

Connector/Source/Element - Notes:
{Element.Notes}
< element
linked feature >
Connector/Source/LinkedFeature - Stereotype:
{LinkedSourceFeature.StereotypeEx}
< linked feature
< source

target >
[right-click-to-insert-Target-field(s)]
element >
Connector / Target / Element - Type:
{Element.Type}

Connector / Target / Element - Name (full):
{Element.FullName}

Connector / Target / Element - Notes:
{Element.Notes}
< element
linked feature >
Connector / Target / Linked Feature - Type:
{LinkedTargetFeature.Name}

Connector / Target / Linked Feature - Type:
{LinkedTargetFeature.Type}
< linked feature
< target
< connector
< package


property setting for this diagram: "add each contained element in documenation"

After prompt for document generation comes up, I choose "include all diagram elements in report" and set all exclude filters to "none".

What do I miss - in explanation here and in generation there?
Bug, feature, wrong concept of documentation?

Thanks

PS: If the requirement is stored in the same package as the diagram then it works. But that is not useful as I need seperate packages for documents and for the model itself.
« Last Edit: December 09, 2017, 02:48:08 am by Shegit Brahm »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7732
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation: missing linked use cases of requirements in report
« Reply #1 on: November 28, 2017, 07:34:04 pm »
You only have the section for external requirement, but that section is empty.
You have to tell EA which fields to show in that section as well, just like you did with with the package section -> {package.Name}

Geert

EAUser3200

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #2 on: November 28, 2017, 08:20:43 pm »
Hi Shegit Brahm

You can achieve these information by writing a simple document script inside the package tag.

Please refer the links

http://www.sparxsystems.com/enterprise_architect_user_guide/10/reporting/custom_script_fragments.html

 

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #3 on: November 29, 2017, 01:10:17 am »
@Geert:
thanks for your help, I just can't force my EA 13.5 to do it:
what I understood you suggested:
from PACKAGE | PACKAGE ELEMENT | EXTERNAL REQUIREMENTS | LINKED DOCUMENT
Code: [Select]
package element >

external requirements >
NAME
{ElemExtRequirement.Name}

NOTES
{ElemExtRequirement.Notes}

TYPE
{ElemExtRequirement.Type}

STEREOTYPE
{ElemExtRequirement.Stereotype}
linked document >

< linked document
< external requirements

but none of these referenced field were generated at all. What am I missing?

This is what I now tried:
PACKAGE | ELEMENT | CONNECTOR | SOURCE | ELEMENT
Code: [Select]
connector >
source >
element >
[from Package/Element/Connector/Source/Element]
Element-Name
{Element.Name}
{Element.Notes}
{Element.Type}
{Element.Version}
< element
linked feature >
[from Package/Element/Connector/Source/Linked Feature]
Linked Feature
{LinkedSourceFeature.Type}
< linked feature
< source
< connector

this brings up linked use case and again only if the requirement is inside the package of the diagram.

@EAUser3200: thanks for your suggestion, I will check it, no experience with these scripts right now.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7732
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation: missing linked use cases of requirements in report
« Reply #4 on: November 29, 2017, 04:53:04 am »
Ah, I see. Are you trying to get the use case info in the external requirements section?

That won't work. External requirements are the elements of type Requirements that are linked to the element you are reporting on with a Realization. (from element to requirement)
This is actually meant to be used the other way around. Report on the requirements and add the info from the linked requirements.

The linked feature section is meant to report on the attributes/operations,.. that are linked to your element using "link to element feature".

I'm not saying that it can't be done, but the easiest way is to turn things around and start from the use cases  and then go to the requirements.

Geert

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #5 on: December 07, 2017, 01:32:30 am »
I tried an approach similiar to EAUser3200's suggestion because I need both ways: from requirement to use case and vice versa.

Using template with fragment and fill the fragment with custom sql queries.

This query as a custom search delivers what I am looking for:
Code: [Select]
select

ob.Alias as Call_ID,
ob.Phase as Release,
ob.Status as Status,
ob.name as Name,
ob.Object_Type as Type,
from
t_object ob, q_connections cons
where
cons.DestID like #OBJECTID#
and
ob.Object_ID=cons.SourceID
order by ob.Alias asc

the call inside the fragment ist more plain:
Code: [Select]
custom >
Custom SQL-Fragment
just plot a lot:
{Call_ID}
{Release}
{Status}
{Name}
{Type}
< custom


I tried a very simple template to focuse on "getting a fragment included that returns something from the fragment":
Code: [Select]
select

ob.Object_ID as Obejct_ID
from
t_object ob
where
ob.Object_ID like #OBJECTID#
order by ob.Object_ID
put into this fragment definition
Code: [Select]
custom >
the object id from database
{Obejct_ID}
< custom

and surrounded by this template:
Code: [Select]
package >
Package {Pkg.Name} begins
1. Option for a fragment:
{Template - IncludeFragment_SQLFragment}

obejct id:
{Template - IncludeFragment_ObjectID}

diagram >
need diagram for sub element from root diagram
diagram {Diagram.Name} begins here
fragment is technically possible: (2nd option)
object id {Template - IncludeFragment_ObjectID}

element >
element {Element.Name} begins here
no fragment in rightclick

< element
diagram {Diagram.Name} ends here
< diagram
element >
new root element {Element.Name} begins
3rd option for fragment
object id: {Template - IncludeFragment_ObjectID}
attribute >
next official fragment option
attribute {Att.Name} begins here
object id: {Template - IncludeFragment_ObjectID}
attribute {Att.Name} ends
< attribute
method >
finally the method {Meth.Name} is reached
object id via fragment: {Template - IncludeFragment_ObjectID}
and method {Meth.Name} ends
< method
child elements >
some childish element {Element.Name}
< child elements
< element
child packages >
< child packages

package {Pkg.Name} ends
< package

just what I get is half the aim:

- the object id is returned every now and then.
- the only once at the beginning referenced fragment  {Template - IncludeFragment_SQLFragment} does not get computed at all.

My question is so far slightly  shifted:
- Are fragments only processed if they could be processed at all? That would explain why even the manual text does not appear
- I start the query building  as a custom search, there I need to write
Code: [Select]
cons.DestID like '#<SearchTerm>#', I cannot use =
- any suggestions, if = would help inside fragment?

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7732
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation: missing linked use cases of requirements in report
« Reply #6 on: December 07, 2017, 02:19:26 am »
You can use "=" in these queries.
It's not like you are going to add wildcard in there (like you could when using <Search Term> in SQL searches.

If your query doesn't return any result then your template also won't print anything at all, so that might explain why you are sometimes seeing things and sometimes not.

I also suspect that you can only use template fragments that use #OBJECTID# in Element sections. So I suspect that they don't work in other sections such as Diagram, Attribute, Connector, etc...
But I've never had the need to put them there.

Maybe you should consider trying out real-world examples instead if just putting the fragment everywhere and wondering why some of them don't seem to work.

Geert

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #7 on: December 07, 2017, 06:51:17 pm »
Thanks for your suggestions, I will try to figure out how to build "more complex queries" with fragments that work.
At least I can assume that opposite to a programming language where I would get at least the text of a function entered, fragments need to be working fully to return a result.
("Custom SQL-Fragment just plot a lot:" did not appear)

The query that does not do anything inside a fragment worked like a charm as custom search. That's why I was a bit confident :)

I tried to put them everywhere where Sparx states it should work: http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/report_generation/adding_fragments_to_a_template.html

Shegit

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7732
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document generation: missing linked use cases of requirements in report
« Reply #8 on: December 07, 2017, 07:34:44 pm »
I see. The help apparently does not specify which type of fragment is supported in which section. This seems to be different for SQL fragments and normal fragments.

Geert

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #9 on: December 08, 2017, 11:48:48 pm »
I'm coming closer to my aim - now I can list element details of elements shown inside a diagram which constraint that the elements are located in a different package than the diagram and document generation is done over diagram package.

Code: [Select]
select
ob.Alias as Call_ID,
ob.Phase as Release,
ob.Status as Status,
ob.name as Name,
ob.Object_Type as Type,
dia.Diagram_ID as diade,
dia.Package_id as diapack,
dia.Diagram_Type as typus,
dia.Name as dianamus,
pac.package_id as pacpac
from
t_diagram dia, t_diagramobjects diaob, t_package pac, t_object ob
where
dia.package_id =  #PACKAGEID#
and pac.package_Id = dia.package_id
and diaob.diagram_id = dia.diagram_id
and ob.object_id = diaob.object_id
order by ob.alias asc
fills the fragment
custom >
Call_ID   Release   Status   Name   Ob-Type   diade   diapack   dia-typus   dianamus   pacpac
{Call_ID}   {Release}   {Status}   {Name}   {Type}   {diade}   {diapack}   {typus}   {dianamus}   {pacpac}
< custom

inside the template at
diagram >
{Template - MyFragment}
< diagram

My next steps will be:
- list the diagram element with its needed description one by one
- list the connections of each element in a table (see fragment querying t_object and q_connections)

Any suggestions appreciated ;-), I will post my solution when I'm done,
Shegit

PS: Having a unused table in the "from" part gives me the rows multiple times. Was quite a relief after getting it back to previous look.
« Last Edit: December 08, 2017, 11:52:35 pm by Shegit Brahm »

Shegit Brahm

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
    • View Profile
Re: Document generation: missing linked use cases of requirements in report
« Reply #10 on: December 09, 2017, 02:47:53 am »
I was already ready :)

create a fragment "MyFragment" containing a table with needed values (insert custom field ->{}):
custom >
Call-IDreleasestatusname
{Call_ID}{release}{status}{name}
<custom

click on document options for this fragment and change Custom Query to Custom SQL and insert:
Code: [Select]
select
ob.Alias as Call_ID,
ob.Phase as Release,
ob.Status as Status,
ob.name as Name,

from
t_object ob, t_connector con
where
con.Start_Object_ID = #OBJECTID#
and ob.Object_ID=con.End_Object_ID
and (ob.Object_Type = 'UseCase' or ob.Object_Type = 'Requirement')
order by ob.Alias asc
(for the connection the other way round exchange Start with End in the where-part and if need both: build two fragments, the combination via "or" is extremely slow)

Then create the containing template.  In my case I need this:
diagram >
{Diagram.DiagramImg}
element >
{Template - MyFragment}
< element
< diagram

The tricky part was: I had to Insert Template between "diagram >" and "element >" via rightclick, then cut this part and insert it between "element >" and "< element". Because in EA (12.1) it is impossible to use rightclick for Insert Template.

Thanks for your help,
now I dig deeper into fragments and reading eap by SQL :)

Shegit