Book a Demo

Author Topic: RTF - Child Elements appearing twice  (Read 4126 times)

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
RTF - Child Elements appearing twice
« on: October 19, 2010, 08:08:36 am »
I have a very basic template that renders an element's name. No matter what I do, I can't get it managed to let the child element appear only once (ignoring childs isn't an option).

I have a test package with two use cases in it (same happens for other element types like packages too):

- UseCaseElement
   |_ UseCaseChildElement


Template code:
Code: [Select]
package >
element >
Element: {Element.Name}
child elements >
< child elements
< element
< package

Output:

Element: UseCaseElement
Element: UseCaseChildElement  
Element: UseCaseChildElement
(<- go away!)[/b]

I use the following query to fetch the elements:

Code: [Select]
SELECT
ea_guid AS CLASSGUID,
Object_Type AS CLASSTYPE,
Name,
Object_Type,
ea_guid,
TPos
FROM
t_object
WHERE
t_object.Package_ID =
(
    SELECT
    TOP 1 PDATA1
    FROM
    t_object
    JOIN
    t_objectproperties on t_object.Object_ID = t_objectproperties.Object_ID
    JOIN
    t_package on t_object.PDATA1 = t_package.Package_ID
    WHERE
    t_objectproperties.Property = 'ProjectCode' AND
    Value = 'EGSP' AND
    (
        t_package.PackageFlags NOT LIKE '%RTF=F;%' OR
        t_package.PackageFlags IS NULL
    ) AND
    t_object.Name = '<Search Term>'
)

INTERSECT

SELECT
ea_guid AS CLASSGUID,
Object_Type AS CLASSTYPE,
Name,
Object_Type,
ea_guid,
TPos
FROM
t[u][/u]_object
WHERE t_object.Object_Type != 'Package'

ORDER BY t_object.TPos

So, thought I'm clever, simply excluding the childs from the query should solve the issue:

Code: [Select]
AND
t_object.ParentID = 0

which works fine in the search facility, I only get the parent element as the result, just as desired.

But for the RTF template? Not a bit of it! Now, the output does NOT show ANY childs anymore...

Output:

Element: UseCaseElement


I wonder how it is possible to seperate parents and childs effectively as this has a major impact on the structuredness of the generated report. Searching the forum brings out that other architects struggle with similiar issues too...


Cheers,
Thomas

PS: using the latest official release (build 863)
« Last Edit: October 19, 2010, 08:16:10 am by pocketom »

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: RTF - Child Elements appearing twice
« Reply #1 on: October 19, 2010, 10:33:31 am »
If I manually add a package (drag and drop a specific package onto the model document below the master document) it works correctly, child element is appearing only once below the parent element. Unfortunately I cannot pass a package by query (model search will result always in threatment by element list, package placeholders in RTF template have no efect).

I cannot find a way to overcome this. I need reusability of my SRS template.

BACKGROUND:
I have several webservice specification packages with (equal) package sub-structure for each('Use Cases', 'Actors', 'Entities', 'Scenarios',...........................) . I want to keep the document setup seperately, copying document setup and adding target packages to each model document will result in loss of maintainability (and cause days of work to drad'n'drop individual packages on those nodel documents). Unfortunately I cannot run RTF generation by right-click on the target webservice (root)package (running the master template then doesn't include any model document template). Organizing the structure/order of sections without master documents seems also not working.

Feeling 1000% stuck. Don't know what I'm doing wrong all the time.
« Last Edit: October 19, 2010, 11:20:20 am by pocketom »

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: RTF - Child Elements appearing twice
« Reply #2 on: October 19, 2010, 11:03:42 am »
Diagrams are also not rendered when using a model search for the model document SearchName.

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: RTF - Child Elements appearing twice
« Reply #3 on: October 19, 2010, 09:40:43 pm »
To explain a bit further what I'm trying to realize, I uploaded some screenshots and a documentation diagram.

Documentation Setup (Diagram)

Fig. 1

For each model document, an indivial RTF template has been created and assigned using the tagged value field RTFTemplate.



Documentation Setup (Project Browser)


Fig. 2

As you can see, I used child model documents to specify the desired hierarchy in my (single document!) output. So far this also doesn't seem to work (is only one level below the master document possible?)

Service Project Package Structure

Fig. 3

Fig. 3 shows what should happen at the end. On top you can see a package structure template that has been copied several times and renamed into the respective webservice projects (S0001, S0002,...). The documentation master template (Fig. 2) is NOT part the package structure template, it is kept seperately.

I simply want to launch my SRS report individually on the service folders S0001, S0002, S0003, which are all assembled from the same package template. Nothing special or?
But as said, right click on an individual package and execute the master template (think I need that masterdoc to specify order and misc formating setup?) does not work because then no model documents below the master doc are generated (stays completely blank, even static text won't display from included modeldocs...?).

This shows clearly why I can't use fixed package->modeldocument assignments as described in the manuals. Therefore, fetching the respective subpackages by query (search by their fixed name) is the first logical consequence.
After making it work at least for the first target package, it should be possible to extend the queries with a '<Search Term>' so that I can specify on which service root folder (S0001, S0002, ...) to launch it.

Hope anybody can tell me if this has a chance to work, how I can improve this setup to reach my goal, or if I better should forget it entirely.   :o