Author Topic: Exclude filter seems all or nothing.  (Read 4509 times)

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Exclude filter seems all or nothing.
« on: July 02, 2014, 06:14:53 pm »
Hi!

I'm really struggling with the exclude filter in a template fragment.

If I exclude nothing, it works, but includes everything.

I want to show only ActivityPartition types in this fragment.

If I filter everything else out, then I get nothing.

So, the items I don't want to show in this fragment are mainly Activities and BusnessProcesses. So I try to filter out only Activity - and get nothing.

Are there hierarchies in these filters that if you filter the parent you filter out all the child types as well?

What do I need to do to make the filter exclude the things I want to exclude without excluding everything?
Screwtape

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8063
  • Karma: +118/-20
    • View Profile
Re: Exclude filter seems all or nothing.
« Reply #1 on: July 03, 2014, 08:52:33 am »
Unless I'm mistaken, filtering a parent out automatically filters children. So what is the top level element type that you need to ensure isn't filtered out?

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Exclude filter seems all or nothing.
« Reply #2 on: July 03, 2014, 05:05:34 pm »
Hi Simon,

When I talked about parents it was in an inheritance kind of way, rather than element heirarchy.
However, reading your reply - it has dawned on my why it isn't working.

I'm trying to filter out Activity and BusinessProcess elements, but not ActivityPartition elements. If I filter Activity I don't get anything.

This is because the fragment is being called from an activity and therefore is being filtered out before it get's chance to find the child elemenets.

I have the "Include child elements even if the parent element is filtered out" ticked, but that doesn't seem to do anything.

So, the fragment is called in an activity, but I want to process the children that are ActivityPartitions. However, I can't call a template from within Child Elements, just within Element.

This is connected with my query about skipping heading levels previously - I'm trying to generate a document which refers to the pools and lanes, but doesn't make them part of the heirarchy - there would just be too many levels.

So if my tree looks like this...
Activity A
|--Pool X
|   |--Lane Y
|   |   |--Activity B
|   |--Lane Z
|   |   |--Business Process C
|   |   |   |--Pool Q...

What I'm trying to get is

1. Activity A

Pool - X (ActivityPartition only fragment)
    Lane - Y (ActivityPartition only fragment)
        Activity B (Fragment called from ActivityPartition Fragment)
    Lane - Z (ActivityPartition only fragment)
        Business Process C

1.1 Activity B
...
1.2 Business Process C

Pool - Q...

I therefore want to produce a second summary heirarchy using the pools and lanes, and then ignore the pools and lanes in the main hierarchy.

If I filter ActivityPartition in the main document, I don't get any of the child activities, even with the "Include child elements..." checkbox ticked.

I'm sure theres a logic to how the "Include child elements..." checkbox works, but I don't understand it.

I realise that I'm trying to subvert the heirarchy, but I thought I'd be able to do that using fragments.

Thanks!
Screwtape

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8063
  • Karma: +118/-20
    • View Profile
Re: Exclude filter seems all or nothing.
« Reply #3 on: July 04, 2014, 08:55:29 am »
I think you would have a better chance of getting the report you want by using the automation functions for the generator. That way you can find all the elements you want and document them at the level you want.

It would probably be easier than trying to subvert things.

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Exclude filter seems all or nothing.
« Reply #4 on: July 04, 2014, 05:53:36 pm »
Thanks for the suggestion.

I've just looked at the automation interface documentation, and it seems like ancient history - VB6 and Word 2000?

Is it the documentation that is out of date, or does the document automation system really rely on such out of date technology?

Am I missing something? Can you give me a link to the releveant documentation, so I'm in the right place?
Screwtape

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Exclude filter seems all or nothing.
« Reply #5 on: July 07, 2014, 12:59:22 pm »
Most of the examples included in the help are written in VB6 syntax, but the automation interface is also available via other languages (E.g. VB.NET, C#, C++, Java).  You can also access these features via VBScript and JScript using the Scripting window in EA Corporate edition or higher.

I believe the "automation functions" referred to by Simon earlier is the DocumentGenerator Class.  For more information about this class, see:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/document_generator_interface_class.html

You can find an example of how to use the DocumentGenerator via JScript in EA's scripting window (requires EA Corporate or higher).  See:
Tools | Scripting > Local Scripts > JScript - Documentation Example.

For general examples of writing automation code in other languages such as C# or Java, see the "Code Samples" subdirectory below your EA installation folder.

You can also find examples of how to write EA add-ins in C# on the EA Community website.
http://community.sparxsystems.com/tutorials/572-44create-your-first-c-enterprise-architect-add-in-in-10-minutes