Book a Demo

Author Topic: Weird template selector issue  (Read 3573 times)

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Weird template selector issue
« on: October 14, 2015, 05:05:59 am »
This is actually related to the SQL issue I posted about earlier (of course, once the SQL issue was fixed, another one arose).

Basically, I have a template selector that's supposed grab an element with a specific stereotype and then call another fragment that will run the following SQL query:

select p.Name as Property, p.Note as Description, v.Name as DataType, u.Value as Unit
from t_object as s, t_object as p, t_object as v, t_objectproperties as u
where p.ParentID = s.Object_ID and v.ea_guid = p.PDATA1 and u.Object_ID = p.Object_ID and u.Property = 'unit'

Now, for the template selector I'm using the type signal and a special stereotype for each element (to generate a table for each element at different parts of the auto-generated document). So let's say the selector statement looks like this:

Signal:S1:TableFragment

Then I have a template that calls the template selector.

Now, when I run the template, the selector grabs the proper element and generates the proper table... and then keeps going with a bunch of other elements (basically, it seems to be grabbing random parts from other signals in the project and placing them in the table). I've added SQL statements to display the package names and parent names of the additional elements, and they aren't child packages or child elements of what I'm originally running the reports on. In fact, even if I run the generator on the one package that (only) contains the element I'm trying to run the report on, for some reason the table keeps adding stuff from other packages and elements. I've even tried moving all of the parts out of the signal, deleting the signal, and then recreating it from scratch, and I still get the same issue. Then I tried moving all of the parts of the signal and running the report again: this time none of the parts that I wanted in the table were there (as they shouldn't have been as I moved them out of the signal), but all of the extraneous stuff was still there.

I also tried adding the SQL statement s.Name = "NameoftheElement" and abandoning the selector, but then the table generated itself repeatedly for 364 pages.

Any idea on what might be happening here?

« Last Edit: October 14, 2015, 05:09:15 am by jplusip »

jplusip

  • EA User
  • **
  • Posts: 69
  • Karma: +0/-0
    • View Profile
Re: Weird template selector issue
« Reply #1 on: October 15, 2015, 01:41:23 am »
Solution found:

First Different Approach:
I tried to abandon the template selector since it clearly wasn't working. So instead, I added an s.Stereotype = 'S1' to my where SQL statement and just inserted the SQL fragment directly into the template. The result was a bit strange, as now the document generator did only pull the desired material, but it did it over and over and over for 360+ pages. So this was a no-go.

Second Different Approach:
I used both the SQL change (s.Stereotype) and the template selector. For whatever reason, this worked. So I will now have double the amount of fragments (was hoping to have one SQL and multiple fragments; looks like I have to have multiples of both), but, hey, it's working.

Also found a weird glitch in EA. For the value (from t_objectproperties) of the SysML 1.3 Unit, I'm getting it's EAID. My work around is making another tag (called unit1), but, just a heads up, that seems to be an issue.
« Last Edit: October 15, 2015, 04:38:47 am by jplusip »