Book a Demo

Author Topic: Filter to exclude Packages from an RTF template  (Read 5086 times)

Michel Gibelli

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Filter to exclude Packages from an RTF template
« on: September 30, 2014, 10:57:29 pm »
Hello,

I am trying to buid a Document generation template and I would like to exclude child Packages from the generation (for example packages which do not have a certain stereotype, eg <<myStereo>>).

In the document options, the tab "Element filters" applies only to Element (and not packages).

In the "Document options" tab, there is a textfield 'Except where Query excludes a Package', so I tried to write the custom SQL :
SELECT * FROM t_object where Object_Type = 'Package' and Stereotype <> 'myStereo'
But it did not work. I do not clearly understand the behavior of this field.

Do you have any advice to obtain the result ?
Is it possible or should I change my strategy ?

Thanks in advance
Michel

Adam@Schneider

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Filter to exclude Packages from an RTF templat
« Reply #1 on: December 10, 2014, 04:51:37 pm »
I came across this when I was looking for something else. You need to select the package ID from the t_package table, eg:

SELECT Package_ID AS ExcludePackage
FROM t_package
WHERE t_package.Package_ID = #PACKAGEID#
AND t_package.Name in ('Overview', 'Detailed View')

You may need to subselect on the t_object table because a packages also have elements, and the t_object table stores the stereotype.

Have a play in Edit->Find In Project, you can change to the SQL tab and use that to test your query (ctrl+space auto completes table names like intellisense)

Michel Gibelli

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Filter to exclude Packages from an RTF templat
« Reply #2 on: January 13, 2015, 04:13:08 am »
One month later  :-[
I would like to thank you.
It helped me.
The reference is in the help (search for "Exclude Package Query and Script")

Michel
« Last Edit: January 13, 2015, 04:13:31 am by mgfr13 »