Question


IBM
CN
Last activity: 25 Mar 2024 8:42 EDT
Open / update a rule (e.g. email correspondence) from a self defined section or programmatically
Open / update a rule (e.g. email correspondence) from a self defined section or programmatically
Scenario:
We want to allow business user to edit some types of rules e.g. email correspondence, so we hope the users can open / update the rule from a customized section or programmatically, so that the users need not enter dev studio.
Any solution for this? Thanks.
***Edited by Moderator Rupashree S. to add Capability tags***
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 23 Mar 2024 14:58 EDT


Maantic Technologies Pvt Ltd.
IN
The below solution is restricted for static wordings only, since it might not be advisable for end users to update/edit dynamic property references.
Create a custom section containing rich text editor control and map.pySourceStream property. This will render the paragraph content which the user can alter/update as required.
Allowing the business users to update the correspondence rules and section rules not at all recommended and also it might not be technically possible with the above design approach, hence rule delegation will be the option for these rules.


Maantic Inc
IN
Correspondence rules can be delegated to business users to update/alter the same.
Below are the links which will help you to configure a delegated rule.
https://docs-previous.pega.com/application-development/86/delegating-rule-or-data-type
https://mypegapoc.com/2022/05/how-to-delegate-a-rule-in-pega/


IBM
CN
thanks.
Actually what we want is to allow user able to update ANY email correspondence or paragraph for some wording adjustment, instead of some specified ones.
Any idea for this?


Maantic Technologies Pvt Ltd.
IN
You can check suggested reply option in email channel and try to implement the same in Pega sections if you need to have provision of editing templates on the go.


IBM
CN
thanks.
Actually what we want is to allow user able to update ANY email correspondence or paragraph for some wording adjustment, instead of some specified ones.
And we will not refactor any existing correspondences as mentioned.
Any idea for this?


Maantic Technologies Pvt Ltd.
IN
In that case please consider delegating all the relevant paragraph rules with the "wordings" that business team wants to change / adjust on the go and include / embed those paragraph rules inside the correspondences.
Design your correspondences in such a way that the paragraph rules can be re-used across.
Delegating correspondence rules which may have some complex coding may not be a good idea considering the user experience of the business users


IBM
CN
We would not update / delegate any existing paragraph / email corr. Also we hope the user can edit any future paragraph / email corr without any special setting.
We want to grant the user "ability" to edit such two TYPEs of rules, instead of for some specified rules. We focus the two TYPES of rules.
The "ability" is to edit the rules just like what our developer do in dev studio.
Image such a scenario what we expected:
When user click a "Update paragraph" menu entry or button from a portal, a section appears to ask user to select a paragraph to be updated, by selecting a class from 1st dropdown list then a paragraph in 2nd dropdown. Then, user click "Submit", the selected paragraph is open in a new window so that user can edit and save it, just like what we can do in "live ui": we can open a rule in a new window after we locate it.
I hope I can do so programmatically


Maantic Technologies Pvt Ltd.
IN
You can always achieve the requirement programmatically as per following steps.
1. Create a custom section to show the list of Rule-HTML-Paragraph in a dropdown list.
2. On selection pass the pzInsKey of the rule and render the rule screen on another custom section.
3. Edit and update the content.
4. On click of submit use WBSaveAs activity to automate the rule save process.
5. Make sure the ruleset version passed to WBSaveAs as parameter should be unlocked.
Updated: 23 Mar 2024 8:38 EDT


IBM
CN
Many thanks!!! Yes, it's exactly match our expectation!
Here could you kindly share more details for point 2:
2. On selection pass the pzInsKey of the rule and render the rule screen on another custom section.
We are curious how can we "render the rule screen on another custom section."?
Also, does this solution work for email corr (Rule-Obj-Corr) or even more rule types e.g. section (Rule-HTML-Section) etc.
Thanks.
Accepted Solution
Updated: 23 Mar 2024 14:58 EDT


Maantic Technologies Pvt Ltd.
IN
The below solution is restricted for static wordings only, since it might not be advisable for end users to update/edit dynamic property references.
Create a custom section containing rich text editor control and map.pySourceStream property. This will render the paragraph content which the user can alter/update as required.
Allowing the business users to update the correspondence rules and section rules not at all recommended and also it might not be technically possible with the above design approach, hence rule delegation will be the option for these rules.
Updated: 25 Mar 2024 8:42 EDT


IBM
CN
just for info, for WBSaveAs:
we need use class Rule- version, also the target ruleset is not passed from parameter, but set in the page of the rule. The OldRule* and OldIns* in parameters are for the original version of rule and seems used only for adding history info like below:
"Copied from " + Param.OldInsName + " in " + Param.OldRuleSet + " " + Param.OldRuleSetVersion
So the typical steps is:
1. Obj-Open-By-Handle a rule (e.g. a paragraph) by inskey to a page
2. in the page, update what need updated, e.g. .pySourceStream, and update .pyRuleSet and .pyRuleSetVersion to the targe ruleset and its version. If target is in a branch, the ruleset format is like "ruleset_Branch_branchname" and ruleset version is "01-01-01"
3. Call WBSaveAs using the page as context
1st 4 params: OldInsName / OldRuleSet / OldRuleSetVersion / OldInsHandle:
set to the original rule's ID, ruleset, ruleset version and pzinskey
last para: skipAutoCheckout set to true is no auto checkout needed after save as.
other params can be empty.
thanks.