Book a Demo

Author Topic: Fragment output empty when element filter applied  (Read 4718 times)

Henrik Ring

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Fragment output empty when element filter applied
« on: November 06, 2014, 09:00:10 pm »
In EA 11.1.1112 I have problems using Element Filters on fragments.
Same template/fragment works in EA10.

The content of the fragment is rendered empty.
If I change the fragment to a template and run it "stand alone" the content comes out correctly.

A simple example, one template including one fragment:

Template "Datavarehus - Test EA11":
package >
{Pkg.Name}
Template Before Include Fragment
{Template - Datavarehus - Test fragment EA11}
Template After Include Fragment
< package


Fragment "Datavarehus - Test fragment EA11":
Inside Fragment Start
package >
{Pkg.Name}
element >
Name: {Element.Name}
Stereotype: {Element.Stereotype}
< element
< package
Inside Fragment End



Test model:
One package: Name="TestPackage"
In the package two classes :
  Name="TestClassWithStereotypeFact", Stereotype="Fact"
  Name="TestClassWithStereotypeOther", Stereotype="Other"

Output of template as expected with both classes:
TestPackage
Template Before Include Fragment
Inside Fragment Start
TestPackage
Name: TestClassWithStereotypeFact
Stereotype: «Fact»
Name: TestClassWithStereotypeOther
Stereotype: «Other»
Inside Fragment End
Template After Include Fragment



I then add an "Element filter" on the fragment to restrict that I only output elements with stereotype "Fact":
Stereotype Equals to "Fact", required="Yes"
 Element feature "Optional"


Output of templete now is:
TestPackage
Template Before Include Fragment
Inside Fragment Start
TestPackage
Inside Fragment End
Template After Include Fragment


The class is missing - nothing comes out of the "element" part of the fragment?

If I change the fragment (through the Resource browser "Mark as template") to be a template and run it "stand alone", the output is:
Inside Fragment Start
TestPackage
Name: TestClassWithStereotypeFact
Stereotype: «Fact»
Inside Fragment End


Which I believe to be correct - it outputs the one class class the matches the element filter.

Why does the fragment change behavior when used as a fragment vs. an ordinary template ?

Adam@Schneider

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Fragment output empty when element filter appl
« Reply #1 on: December 11, 2014, 12:07:37 pm »
For anyone else who finds this thread.

This is a bug (ref: 14027153) and it is fixed in EA 12.

Henrik Ring

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Fragment output empty when element filter appl
« Reply #2 on: December 11, 2014, 06:21:37 pm »
Thank you.
I'm on EA11. I reported the bug on EA11. Will it be fixed there?

Bart Orbie

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Fragment output empty when element filter appl
« Reply #3 on: December 30, 2014, 05:48:40 am »
Hi Henrik, Adam,

Thrilled to hear that it's a bug and it will be fixed in EA 12  (I've lost quite some time in EA 11.1.1112 and 1113 trying to get it working).

Unfortunetaly, I just tested this on EA 12 RC1 and the bug is not (yet) fixed in there.  
So, same question here : can you give us an idea when this bug would be fixed ?
(cf. Feature is quite crucial for flexible document generation).

Thanks a lot,
Bart.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fragment output empty when element filter appl
« Reply #4 on: December 30, 2014, 05:40:27 pm »
Henrik, Bart,

1) Bugs in EA are only ever fixed in the latest version, and although EA 11  is still the latest released version, v12 RC1 has already been released, and I doubt Sparx will release another v11 before releasing v12. So don't expect a fix in v11.

2) This is a user forum, and Adam@Schneider is just another user like you and me. And since Sparx only ever tells you a bug is fixed after they have fixed it, Adam won't be able to tell you when this bug will be fixed.

The best thing you can do is report the bug yourself (since Adam's bug seems to be solved in v12 already)

Geert



« Last Edit: December 30, 2014, 06:23:04 pm by Geert.Bellekens »

Bart Orbie

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Fragment output empty when element filter appl
« Reply #5 on: December 30, 2014, 06:41:07 pm »
Thanks for your heads up, Geert.

@Adam : you mention a ref nr. for the bug (14027153).  Could you please point us to the location were we could read more about this particular bug report ?
Cf.  I've searched the whole forum for anything with this number (including the bugs and issues), but have found nothing.

Thanks in advance,
Bart.

PS Happy Holidays !