Question


Unitedhealth Group
IN
Last activity: 11 May 2016 14:26 EDT
Is there a way to make PRPC create a history record for each rule / data instance in the Product ( Rule-Admin-Product) as part of importing the code in higher environments?
Is there a way to make PRPC create a history record for each rule / data instance in the Product ( Rule-Admin-Product) as part of importing the code in higher environments?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
IN
- could we learn the behavior by adding the class 'History-Rule' under class instances to include in RAP rule? Thank you!


Unitedhealth Group
IN
I'm doing some R&D on release back out.
I'm interested in the latest history instance rather than all the history records of the rule / data instance. Also I don't know what rules / data instances that developers add in the RAP and that is why I'm looking for an OOTB hook / extension activity to create a history record for each rule or data instance that is being imported in higher environments. I'm more interested in data instances and rules without a rule set version.


Pegasystems Inc.
IN
-
leveraging the WHEN filter at class instances to include would be helpful to filter unwanted data.
- Preview of RAP rule confirms the data we would want to export for confirmation.


Unitedhealth Group
IN
As per my understanding,
- its not easy to have a when filter to include the latest history record
- also there is a risk of these instances (data instance / rule without rule set version) updated by developers after the product rule is saved and checked in. In this case we don't have the latest history instance migrated to higher environments.
- any option to execute some code (to create the history instance on target system) as part of importing the RAP would be helpful.


Pegasystems Inc.
IN
Hi Pardha, Good morning!
would following the below high level steps make sense?
- In a wrapper activity
- call a report definition to build the list of non-resolved rules [Data-Rule-Summary]
- for each result execute a clone of RULE-OBJ-ACTIVITY @BASECLASS HISTORYOFHARNESSRECORD to build the record history list [pyRecordHistoryList].
- build a temp page list to hold the latest pzInskey based on pxTimeCreated [HistoryData]
- create a RAP rule
- Page-New [NewRAP, Rule-Admin-Product]
- set required properties .pyProductName, .pyProductVersion, .pyRuleSetVersion, .pyRuleSet, .pxUpdateDateTime etc [please read from rule from XML on required properties]
- loop through HistoryData page list to set pzInsKey and update
- NewRAP.pyDataInstancesIncluded(<APPEND>).pyDataInstanceLabel
- NewRAP.pyDataInstancesIncluded(<LAST>).pyDataInstanceObjClass
- NewRAP.pyDataInstancesIncluded(<LAST>).pyDataInstanceInsKey
- Obj-Save + Write now [NewRAP]
- Perform validation using RULE-OBJ-ACTIVITY RULE-ADMIN-PRODUCT CHECKZIPFILE [on Page NewRAP]
- Call ExportRAP [on Page NewRAP]
- Using Migrate wizard we could deploy the RAP file where we could push the latest history record of the file.
- but we need to ensure pxTimeCreated doesn't have conflicts.
Please share your thoughts/observations, Thank you!
psahukaru


Unitedhealth Group
IN
Thanks Phani for providing your thoughts in detail.
At what point we need to call this wrapper activity ?
I tried customizing the checkin flow action of Rule-Admin-Product to do the same thing ( add latest history record of all non rule resolved rules and data instances in the same product rule in under .DataInstancesIncluded embedded page. I was able to make it work in terms of updating the product rule to contain latest history records. The problem with this approach is when the data instances / no rule resolved rules are changed after the product rule is checked in ( product rule will not contain the latest history record in this case). This is a likely scenario as most of the times Product rules are created a head of time and not just before the deployment.
This is the reason, I'm actually looking for a hookup activity where in I can loop through the data instances and non rule resolved instances of the product being migrated and create a history as part of migration. Pega is using private api as part of the migration and I'm not getting a handle to the instances being deployed and a hook activity that I can customize to add history record on the fly.


Pegasystems Inc.
IN
>>> At what point we need to call this wrapper activity ?
- was thinking of calling the activity standalone.
>>> The problem with this approach is when the data instances / no rule resolved rules are changed after the product rule is checked in ( product rule will not contain the latest history record in this case). This is a likely scenario as most of the times Product rules are created a head of time and not just before the deployment.
- as you said, this problem would come up any time even for rule resolved ones.
>>> create a history as part of migration
- as said, we could either leverage WHEN/List View rule applies to class History-Rule in the RAP rule form.
Please share your thoughts/comments, Thank you!
psahukaru


Pegasystems Inc.
IN
not sure by when or will the list view rule be converted to report definition...


Pegasystems Inc.
IN
>>> The problem with this approach is when the data instances / no rule resolved rules are changed after the product rule is checked in ( product rule will not contain the latest history record in this case). This is a likely scenario as most of the times Product rules are created a head of time and not just before the deployment.
- as you said, this problem would come up any time even for rule resolved ones.
- scenario - the jar file is extracted with history note: Test and post extraction the history of the rule is updated to testing. for such scenario - we need to extract the jar to include the latest history records.


Pegasystems
US
Two possible ideas:
1) Are all the rules used by the import mechanism "final"? If not, customize the part that does the import so you can insert an add-history for each rule that is import.
2) Check the log file to see whether each rule that is import is announced in the log file. If it is not, is there a class you can set to DEBUG with "log settings" to cause each rule to be announced? Once that is in place, you can programmatically read the log file and find all the import announcements so you can generate the add-history invokations for each.
/Eric