Question
JP Morgan Chase
IN
Last activity: 31 Oct 2015 7:21 EDT
Creating Sections dynamically using Activity
All,
As part of our requirement ,we need to create the sections dynamically and for this we will be having all the properties which needs to be part of that section.Can i create the section dynamically in the activity by just building the page of Rule-HTML-Section and set all the property references in the activity.Also would like to know if there will be any compilation issues .
Thanks
Dinesh
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
JP
About a year ago, I had a chance to work on a project where the customer wanted to implement apply-approve flow to control all master data maintenance operation.
Considering that each data class needs its own validation logic and sections to display data in a user friendly way, it was designed like below.
The apply-approve flow is generic and identical for all data classes, so it was defined under Org-Admin-Work class.
The CRUD activities are mostly implemented in Data- class, with a few extension points (template is provided in Data- class) required to be implemented in each sub data class.
Extension points for each action are:
Search:
1. report definition to fetch data.
2. section rule to display search result.
3. section rule to display change history of a record
Update:
1. section rule to display a list of records to be updated (this section could be reused by Create and Delete action)
2. section rule to compare record before and after modification.
3. validation rule
Create:
1. Activity to generate primary key.
2. validation rule
Delete:
1. validation rule
Pegasystems Inc.
US
I have used this approach with other rule types like report definitions, data sets, and flows in the past and it works fairly well. Most of the problems that I have encountered with it are at upgrade time when the definition of the rule, which I have been creating instances of dynamically, changes. Sometimes this has resulted in existing dynamically created instances no longer working, other times it has resulted in unexpected new behavior. One way that I have found to mitigate many of the unexpected changes is to have a template instance of the rule type and after an upgrade resave the template instance. This helps to prevent new instances from being based on an outdated design. I also have used the resaved template and diff'ed the before and after of the resave to see if I might need to do a resave of the instances that were dynamically created before the upgrade.
JP Morgan Chase
IN
Hi Matthew,
Thanks for the reply,as you mentioned i used the same approach for RD's,RFB,DT's and its working without issues , but was skeptical about using the same approach for sections as i thought that each section has a unique id associated to it.
Thanks
Dinesh
Pegasystems
US
Could you please explain a bit more about why it is not sufficient to have a static section that includes various property-referencing-conditionals and other property references such that you can achieve the customized appearance by changing the values of your properties and hence avoid needing to change the actual definition of the section ? /Eric
Pegasystems Inc.
US
Hello Dinesh,
I would think carefully before taking this approach. While it might be possible to achieve the desired results, you are also venturing outside the guardrails. I don't see how this could be accomplished without making assumptions about the current underlying implementation of the Rule-HTML-Section structure. We don't guarantee this will stay constant, and your implementation might break when (not if) it changes.
Due to the other various flexability mechanisms in pega (Circumstancing, Rule resolution, etc,) without knowing more about your reasons for considering this approach it is hard to know exactly what would be better.
Pegasystems Inc.
IN
Hi Dinesh, Good Morning!
would referring RULE-OBJ-ACTIVITY RULE-HTML-SECTION PZCOPYDCOTEMPLATESECTION makes a start?
Please share your thoughts/comments, Thank you!
psahukaru
JP Morgan Chase
IN
Hi Phani ,
Thanks for the reply ,Peter Gousios raised a point and i assume that it would be applicable even for the rules you mentioned.Does pega consider upgrading tthe data transforms when something changes.
Thanks
Dinesh
Pegasystems Inc.
IN
1. RULE-OBJ-ACTIVITY WORK- PZFIELDSMODALPREPROCESSING
2. RULE-OBJ-ACTIVITY EMBED-FIELDS PZHANDLEPROPERTYCHANGE
3. RULE-OBJ-ACTIVITY @BASECLASS PZFIELDSMODALPOSTPROCESSING
Pegasystems Inc.
IN
Thank you Dinesh for pointing to RULE-OBJ-ACTIVITY RULE-HTML-SECTION PZCREATEPROTOTYPESECTION
JP Morgan Chase
IN
All,
Below is our requirement.
We are 7.1.6 and we have a lot of data tables which are delegated to the business,the look and feel is same for them as for the developers.Since we have a lot of headless applications and our business rules depend a lot on the data in these tables the business wants to have an an approval process in place so that some one approves it before the instances are saved and this should apply for all the data tables .Overall there are more than 100 data tables across 6 different applications and we want to design a one click process like the application profile to enable the approval process which would provide a jump start for the teams.We provided extension points where each team can make further changes like adding validations(sever side ) /duplicate checks for certain classes .For this we have designed a flow and as part of 1st screen we want to have 2 grids one to show the instances and the second grid to hold the instances which needs to be modified.For the first grid we used section with report definition and dynamic source generation so there was no problem in cloning to other data tables from a model section(present at data- layer) as all we are changing is the class value in the section for the repeating grid.For the second grid though we have to provide the option to edit the instance and this is where the challenge is .We had the below 2 approaches in mind
All,
Below is our requirement.
We are 7.1.6 and we have a lot of data tables which are delegated to the business,the look and feel is same for them as for the developers.Since we have a lot of headless applications and our business rules depend a lot on the data in these tables the business wants to have an an approval process in place so that some one approves it before the instances are saved and this should apply for all the data tables .Overall there are more than 100 data tables across 6 different applications and we want to design a one click process like the application profile to enable the approval process which would provide a jump start for the teams.We provided extension points where each team can make further changes like adding validations(sever side ) /duplicate checks for certain classes .For this we have designed a flow and as part of 1st screen we want to have 2 grids one to show the instances and the second grid to hold the instances which needs to be modified.For the first grid we used section with report definition and dynamic source generation so there was no problem in cloning to other data tables from a model section(present at data- layer) as all we are changing is the class value in the section for the repeating grid.For the second grid though we have to provide the option to edit the instance and this is where the challenge is .We had the below 2 approaches in mind
1)We wanted to follow the same approach of that for grid 1 but the only difference is that we add the elements to the layout of the section using the activity .
-->Advantage of this approach the section is developer friendly in terms of adding their own client validation/formats etc.
-->Problem with this approach is that when upgrade are done there is no guarantee that these will work and it would be a maintenance night mare .
2) We wanted to have a name value pair of all the properties in the class as a pagelist and we will have a template section for each data type and then a section with a repeating grid to display the fields.
-->With this maintenance is minimal.
-->But this approach needs a transformation logic to map these name vale pairs to the original instances before saving it to the data base.Problem with this approach is that if the team has to implement specific validations for certain class it would be a challenge .
Thanks
Dinesh
Accepted Solution
Pegasystems Inc.
JP
About a year ago, I had a chance to work on a project where the customer wanted to implement apply-approve flow to control all master data maintenance operation.
Considering that each data class needs its own validation logic and sections to display data in a user friendly way, it was designed like below.
The apply-approve flow is generic and identical for all data classes, so it was defined under Org-Admin-Work class.
The CRUD activities are mostly implemented in Data- class, with a few extension points (template is provided in Data- class) required to be implemented in each sub data class.
Extension points for each action are:
Search:
1. report definition to fetch data.
2. section rule to display search result.
3. section rule to display change history of a record
Update:
1. section rule to display a list of records to be updated (this section could be reused by Create and Delete action)
2. section rule to compare record before and after modification.
3. validation rule
Create:
1. Activity to generate primary key.
2. validation rule
Delete:
1. validation rule
JP Morgan Chase
IN
Thanks Chunzhi Hong we implemented exactly what you mentioned,probably this should be a OOTB feature .In our approach though we create the Search things mentioned by you dynamically and for create and deletion we used the OOTB rules and apart from that we have dynamically generated the excel template for the business to import the data into the grid .As i mentioned we want to make sure the time to production is minimum by generating the most of the rules.
Question :- Did you create the sections rules manually every time a new data class needed a rule approval.
Thanks
Dinesh
Pegasystems Inc.
JP
Yes, those extension point rules are developed manually. I agree that it is a dull work, lucky I don't have to do it by myself. Most of the works are out-sourced.
Pegasystems
US
Hi Dinesh,
Thanks for all those details. However, the details didn't convince me you need to generate section rules dynamically.
Note that section rules can use a "repeating row layout" or a "grid" to show a page list or other extensible lists, so if you have some sort of list of db tables and validation requirements, they could be shown in a repeating row layout without having to generate a section rule "on the fly".
/Eric
JP Morgan Chase
IN
Eric,
What you have mentioned is same as the approach 2 i mentioned and it does have some challenges in terms of custom validations and data transformations.
Thanks
Dinesh
Process 360
IN
Hi Shankar Dinesh Bhaniga,
Can you please explain what do you mean by creating sections dynamically and also it would be helpful for me if you can also explain the procedure in detail for achieving the same.