Question
Capgemini
DE
Last activity: 8 Mar 2016 1:22 EST
In an Activity: Remove parameter from parameter page
Dear all,
in an activity, is it possible to remove a given parameter from parameter page or even the whole parameter page?
What I tried until now:
1. Property-remove
a) Put the whole name of the Param like Param.name1 (step page is application-specific)
b) Put the whole name (Param.name1) and the abbreviated name .name1 using Param as step page
2. Page-Remove (step page = Param)
Neither worked. I also couldn't find a function that might help me with that. Do You have any idea?
Best regards
Wojtek
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Try the following in Java code
tools.getParameterPage().remove("PropertyName"); //Removing the property
tools.getParameterPage().clear(); //Clearing all the property.
I have not tried them, but the API has explanation about them.
Pegasystems Inc.
IN
What is the use-case, why you want to remove the whole parameter page?
I think just assigning a parameter value to its default would be fine. For string type parameter assign it back to "" (empty)
Capgemini
DE
Hi Pankaj,
I don't want to remove the parameter page, I was just trying that to see if that would remove all parameters.
Yes, the params in question are Strings and I use them in a call to a list-view (Pega 6). As I'm having multiple calls to the list view and I'm preparing the parameter page ahead of the calls, I need to dump individual params from the page. See, there's a difference when calling a list-view with an empty, but existent parameter or without the parameter's existence. Seemingly, in the latter case, Pega leaves out the corresponding part of the WHERE-clause. At least according to my analysis.
Thanks + regards
Wojtek
Updated: 1 Mar 2016 8:02 EST
Pegasystems Inc.
GB
I just tested this on PRPC72 ; and can confirm that Property-Remove apparently does nothing for a PARAM here.
If you do a Property-Set to the "" (empty string literal) on the Parameter though: this has the right effect I think.
That is: it appears to make the Parameter behave in the same way as a totally indefined PARAMs - at least when logging it to the logfile:
So this (the property-set at the end only) works:
So you get this in the logfile:
I just tested this on PRPC72 ; and can confirm that Property-Remove apparently does nothing for a PARAM here.
If you do a Property-Set to the "" (empty string literal) on the Parameter though: this has the right effect I think.
That is: it appears to make the Parameter behave in the same way as a totally indefined PARAMs - at least when logging it to the logfile:
So this (the property-set at the end only) works:
So you get this in the logfile:
2016-03-01 12:54:48,027 [http-bio-7200-exec-8] [ STANDARD] [ ] [ myrules:01.01.01] (veParam.GCS_myrules_Work.Action) INFO prpchost|xx.xx.xx.xx Admin@GCS - "HELLO" 2016-03-01 12:54:48,027 [http-bio-7200-exec-8] [ STANDARD] [ ] [ myrules:01.01.01] (veParam.GCS_myrules_Work.Action) INFO prpchost|xx.xx.xx.xx Admin@GCS - "HELLO" 2016-03-01 12:54:48,027 [http-bio-7200-exec-8] [ STANDARD] [ ] [ myrules:01.01.01] (veParam.GCS_myrules_Work.Action) INFO prpchost|xx.xx.xx.xx Admin@GCS -
If I then alter my last step like this:
It has the same result in the logfile.
That is : the PARAM which has been (re)set to "", appears to behave in the same way as a non-set (non-defined even) PARAM.... (at least by this limited test; maybe there is a subtle difference...)
I haven't tried this approach for Property-Types other than text: but I suspect that it might not work in the case of numerics and dates......
Capgemini
DE
Thanks, John.
Unfortunately, it doesn't do so for me (Pega 6.3?). I have been tracing through an activity and if I set the params in questions to an empty String, they still exist in the Parameter-page in tracer. Thus the call to the list view (see my reply to Pankaj) sets the WHERE-clause and therefore yields other results.
I have the feeling I could achieve this on a Java / function basis, but wonder if You have seen a possible implementation already?
Thanks again + regards
Wojtek
Accepted Solution
Pegasystems Inc.
IN
Try the following in Java code
tools.getParameterPage().remove("PropertyName"); //Removing the property
tools.getParameterPage().clear(); //Clearing all the property.
I have not tried them, but the API has explanation about them.
Euroclear
BE