Question
Virtusa Consulting Pvt. Ltd.
AU
Last activity: 14 Aug 2017 9:31 EDT
How can I switch the Access Group of the Service Package at runtime
Hi Guys,
I had a requirement to switch the Access Group of the Service Package on the fly once the Service is being hit. How can I do that, could anyone please share their thoughts.
Thanks,
Aditya Kulkarni
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi
After the service being hit, I dont think we have any provision to change the access group.
May I know what is your business requirement behind this ?
Virtusa Consulting Pvt. Ltd.
AU
I need to get the Compliance score of an application as a service in my destination location, I have written the service and getting the proper result, but the service is running in the application context of the Access Group mentioned in the Service Package, hence not able to calculate the compliance for all the applications with a single Service package.
PEG
PL
You can use different different URL like http://<host name>:<portnumber>/prweb/<custome servlet 1> for one access group and similarly other url for other access group.
Virtusa Consulting Pvt. Ltd.
AU
Thanks for the solution, but this would not be a scalable/extendible solution as we need to create multiple service packages for each of the Applications.
Instead, if we can maintain a decision table for Access Groups depending on the Application at service side would be more maintainable.
But the problem I am facing is, how can I switch to a particular Access Group at runtime.
Virtusa Consulting Pvt. Ltd.
AU
Happy to get the solution for this,
we need to create a GenericOpertor ID and add all the Access Groups to it on the service side.
Then we can open the operator record and switch the application on the pxThread to achieve this.
Detailed steps can be found in OOTB activity : Rule-Obj-CaseType pxDiscoverCaseTypes Pega-ProcessEngine:07-10-17
-
Siva Naga Krishna Palagani
Pegasystems Inc.
IN
pxDiscoverCaseTypes is used to fetch information for FCM, so in this case operator will already have all the relevant access groups mentioned. Even though your approach of having one operator with all access groups work, could you also try out the below method since it would be more flexible
You can actually use the same method used in pxDiscoverCaseTypes i.e. setActiveAccessGroup but pass an additional third param as true. This param is for allowing access to switch AGs even if it is not mentioned in operator's list.
Let us know if this helps :)
Lanit
RU
Method setActiveAccessGroup is not presented in public API, so there is a risk that of we use this method we can get troubles in future, when it will be changed.