Question

Class Association Rules for Reporting

Has anyone had success using class association rules? Nothing that I do gets the association to actually show up as available in the report, at dev time. I've looked up the article at https://community.pega.com/sites/default/files/help_v83/procomhelpmain.htm#/express/rule-/rule-obj-/rule-obj-association/main.htm and it does not offer much help. From what I can tell, the "When and how to create an association rule to support reporting" does not exist.

Correct Answer
November 22, 2019 - 10:25pm

Hey Ron, so this is really interesting.  The magic to all of this, the thing that isn't defined anywhere, and that I was really struggling with, is that you have to add the association name in to Pages and classes tab.  Associations don't automatically get added to the report definition data access tabs, and they aren't automatically available to be referenced by the report definition.  You have to specifically add the association name and the corresponding join's class to the report definition's pages and classes tab 

So, to make this all work...

  1. Create an association rule.  The name of the association rule must match the prefix of one of the class joins.  This is necessary to get the association rule to save.
  2. Add to pages and classes of the report definition, a page that is named the same as your association rule...the one that is also defined as a join condition
  3. As soon as you do this, you can then reference that association name in your displayable columns, at which point, the association is finally added to the report definition's data access tab.

No documentation seemed to truly point me in the right direction as to how this is intended to be configured.  My assumption, and it was wrong, was that as soon as an association rule is created, if you create a new report definition, that association rule would automatically, and immediately be defined in the data access tab.  I feel like an SR is a little heavy handed, but I think that it would be very beneficial to get this documented a little more.  All documentation that I was able to find, seemed to be from back in the 5.4 days, and maybe things have changed.

I intend to make use of association rules, as a way to make common framework level report definitions not have to be specialized at our implementation level. For example, if I define a report definition at the Assign-WorkBasket class, and it joins to SomeFramework-Work class, there is no way to make that report definition work on my SomeImplementation-Work work class, unless I specialize that report definition to join specifically on the implementation class.  Reporting on descendants only applies to the class that the report definition is defined in, not the class of any joins.  In theory, I can instead, create an association at the framework level, make the framework level report definition use the association, and then simply override the association in my implementation.  If I've got 50 reports that join to the same framework class, this would allow me to specialize a single association rule, whereas without this, I would have to update all 50 reports.  Maybe when I do this, I will take some screenshots, and send over an SR for updating documentation on this rule type.  

Comments

Keep up to date on this post and subscribe to comments

Pega
November 18, 2019 - 4:11pm

November 18, 2019 - 4:26pm
Response to mahab_GCS

Do you know if there is any documentation as to how you get the associations to populate in the report definition rule?  I've tried creating several variations of association rules and they never show up in the necessary report definitions.  Maybe I need to create an SR?  

Pega
November 22, 2019 - 5:14pm

November 22, 2019 - 10:25pm
Response to RonLee_GCS

Hey Ron, so this is really interesting.  The magic to all of this, the thing that isn't defined anywhere, and that I was really struggling with, is that you have to add the association name in to Pages and classes tab.  Associations don't automatically get added to the report definition data access tabs, and they aren't automatically available to be referenced by the report definition.  You have to specifically add the association name and the corresponding join's class to the report definition's pages and classes tab 

So, to make this all work...

  1. Create an association rule.  The name of the association rule must match the prefix of one of the class joins.  This is necessary to get the association rule to save.
  2. Add to pages and classes of the report definition, a page that is named the same as your association rule...the one that is also defined as a join condition
  3. As soon as you do this, you can then reference that association name in your displayable columns, at which point, the association is finally added to the report definition's data access tab.

No documentation seemed to truly point me in the right direction as to how this is intended to be configured.  My assumption, and it was wrong, was that as soon as an association rule is created, if you create a new report definition, that association rule would automatically, and immediately be defined in the data access tab.  I feel like an SR is a little heavy handed, but I think that it would be very beneficial to get this documented a little more.  All documentation that I was able to find, seemed to be from back in the 5.4 days, and maybe things have changed.

I intend to make use of association rules, as a way to make common framework level report definitions not have to be specialized at our implementation level. For example, if I define a report definition at the Assign-WorkBasket class, and it joins to SomeFramework-Work class, there is no way to make that report definition work on my SomeImplementation-Work work class, unless I specialize that report definition to join specifically on the implementation class.  Reporting on descendants only applies to the class that the report definition is defined in, not the class of any joins.  In theory, I can instead, create an association at the framework level, make the framework level report definition use the association, and then simply override the association in my implementation.  If I've got 50 reports that join to the same framework class, this would allow me to specialize a single association rule, whereas without this, I would have to update all 50 reports.  Maybe when I do this, I will take some screenshots, and send over an SR for updating documentation on this rule type.  

Pega
November 26, 2019 - 3:43pm

Hi Jerome,

I don't think Design Studio automatically adds entries to Pages & Classes for Sub-reports either. I'm not sure why not, but it certainly wouldn't hurt to mention the requirement in the help page.