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.
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.
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.
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.
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
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.
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.
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:
Obj-Open-By-Handle a rule (e.g. a paragraph) by inskey to a page
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”