Question
Morgan Stanley
IN
Last activity: 5 Jun 2016 15:21 EDT
How to save as a rule using activity
I have a requirement to move several images to another ruleset.
I have tried to lock the Rule-File-Binary rule and tried to update the pyRuleset and pyRulesetVersion but failed as we cannot lock the Rule-File-Binary
I'm looking for some activity code which will save as the existing rule to ruleset desired and delete it from the source ruleset.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi Avinash, Good morning!
could we try the following steps?
- build Rule-File-Binary pxResults list using RD created either in class 'Rule-File-Binary' or 'Data-Rule-Summary'
- iterate through the pxResults
- Open the record using pzInskey on a temp page
- On the temp page call pxUpdateRecord by passing the appropriate parameters (Ruleset name, ruleset version, commit & byPassBestRuleset should be set to true)
Notes: since it is an one time activity, please ensure the following checks
Hi Avinash, Good morning!
could we try the following steps?
- build Rule-File-Binary pxResults list using RD created either in class 'Rule-File-Binary' or 'Data-Rule-Summary'
- iterate through the pxResults
- Open the record using pzInskey on a temp page
- On the temp page call pxUpdateRecord by passing the appropriate parameters (Ruleset name, ruleset version, commit & byPassBestRuleset should be set to true)
Notes: since it is an one time activity, please ensure the following checks
- no private edit rule exists
- if exists need to exit the activity
- the original record is not in checkedout state
- if need to auto checkout the rule on save as it will through error...
- exit the iteration if rule already exist in the target ruleset
- target ruleset and version are open
- no ruleset restriction is applied on class rule forms of advanced tab
- delete the original ones if not required [pxDeleteRecord]
- if they are in locked rulesets
- need to program it again...[.pyVersionSecure & .pyVersionPassword]
- if they are in locked rulesets
- otherwise we need to standardize calling ...
- pxChooseBestRuleSet (for ruleset)
- pzIsRuleSetVersionLocked (to check if version is locked)
- pxChooseBestRuleSetVersion (to get highest open version of the ruleset)
- pzGetNextRuleSetVersion (to get next ruleset version in open state)
Please share your comments/observations, Thank you!
psahukaru
-
Andrew Yeung
Morgan Stanley
IN
Thanks Phani
The pxUpdateRecord works as expected. It has saved as the rule to the expected ruleset..
However i'm unable to delete the record using pxDeleteRecord from the unlocked source ruleset version.
The step page is same as the page given for pxUpdateRecord
Morgan Stanley
IN
It works well if we use any one of the pxDeleteRecord or pxUpdateRecord.. The issue is when both are used in the same activity
Pegasystems Inc.
IN
please try Rule-.Delete or Obj-Delete/Obj-Delete-by-Handle and share your observations, Thank you!
Morgan Stanley
IN
Obj-Delete has worked.. thanks..
But i have one more issue..
--> Saving images from top ruleset in the stack to the bottom ruleset works. Obj-Open would return the image on the top of the stack and i delete it.. which is as expected.
--> However, the other way around does not work.. I mean saving as from the bottom ruleset to the top ruleset. Because Obj-Open returns the image in the top most ruleset
Any thoughts?
Pegasystems Inc.
IN
>>> I mean saving as from the bottom ruleset to the top ruleset.
- API pxUpdateRecord should be passed with record page. if the page is well constructed we should be able to save the rule.
>>> Obj-Open returns the image in the top most ruleset
- true, if we can build the pxResults (filter by ruleset, if required) we should be able to delete the specific version from specified ruleset. It only needs the right pzInskey.