Question

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?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
April 14, 2016 - 9:13am
  • could we learn the behavior by adding the class 'History-Rule' under class instances to include in RAP rule? Thank you!

April 15, 2016 - 1:22pm
Response to sahup1

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.

Pega
April 16, 2016 - 6:27am
Response to PARDHASKURMA
  • 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.

April 26, 2016 - 3:03am
Response to sahup1

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.

Pega
May 10, 2016 - 3:39pm

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

May 10, 2016 - 10:27pm
Response to sahup1

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.

Pega
May 11, 2016 - 6:25am
Response to PARDHASKURMA

>>> 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

Pega
May 11, 2016 - 6:32am
Response to sahup1

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

Pega
May 11, 2016 - 2:26pm
Response to sahup1

>>> 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.

May 11, 2016 - 1:04pm

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