Does anyone know how to obtain the name of a method filter when we do not have the object but only the GUID. Method filters are part of the server and users and user groups have access to them. The method GetFilters( ) on a UserGroup returns the list of filters as GUIS strings.
In my report, I want to show the name of the filters instead of the GUID but I see no method that has a GUID string as an input parameter. Since a method filter is not an item, the Find() methods on a database are no use.
Does anyone know the answer.
Many regards,
Fred Tirion
not sure as I couldnt find the method either(after looking very quickly), but here's a code snippet that works
function main(){ var sFilterName = Custom_GetFilterNameFromGUID("insert your filter guid here", ArisData.getSelectedFilters()); } main(); function Custom_GetFilterNameFromGUID(sGUID, oFilterList){ var oRequiredFilter; if (oFilterList.length > 0){ for (var i=0; i<oFilterList.length; i++){ if (oFilterList[i].GUID() == sGUID) oRequiredFilter = oFilterList[i]; } } return oRequiredFilter.Name(Context.getSelectedLanguage()); }
Hello Mayur,
Thank you for reply.
My script displays all the access rights in a database and therefore runs with a database context. This means that the list ArisData
.getSelectedFilters
()
is empty.
If I would select filters and run the script with a Method Filter context, I would not have a current database and therfore no usergroups and therfore no GUIDs.
So either way, it would not work for me.
Amongst other things, the script reports on all the method filters a particular usergroup has access to. Apparantly only the GUIDS of these filters are stored in the database. The rest of the info is stored at the server level.
Unfortunately only the current Method Filter can be interrogated.
I was hoping to acces the server level from with a script that runs with a database context. Something similar like the ArisData.getDatabases() method.
Maybe there is a low level (Java) solution to get to the server?
Fred
Always a pleasure.
Try the following:
function main(){ var sFilterName = Custom_GetFilterNameFromGUID("c20999c0-d7bf-11e1-7168-0050568a723f", ArisData.getConfigurationFilters(Context.getSelectedLanguage())); } main(); function Custom_GetFilterNameFromGUID(sGUID, oFilterList){ var oRequiredFilter; if (oFilterList.length > 0){ for (var i=0; i<oFilterList.length; i++){ if (oFilterList[i].getGUID() == sGUID) oRequiredFilter = oFilterList[i]; } } return oRequiredFilter.getName(); }
I changed the getSelectedFilter to getConfigurationFilters which only gets config filter info not the filter though. THis required me to change the GUID() function in line 11 to getGUID and the Name() function on line 15 to getName() but now you can get the info without selecting Filters up front.
Hi Mayur,
That looks very promising. I am developing the script, using Aris Business Architect 7.0.2.350381
In that version there is no method ArisData.getConfigurationFilters
However, the script (when finished) will run in our production environment, release 7.2.2.589499 (SR 2011_02)
For this version, I have no testserver and no help files at the moment (it's a long story ;-). Do you happen to know if the method is available at that release?
If it is, I can use your solution and my report will be even more pretty :-)
Thanks,
Fred
I'm not sure about the old release as I only have access to 7.2.
You could always load the script on the production server and ensure that the script is configured so that it cannot amend the database and is not available to users to test it. That way there is no risk involved to users and content but at least you get to test.
Hi all,
I'm working with a server with several databases, and I need a fast way to evaluate if a list of models of each database agree with the rules of a Filter (Method).
Does any body know about some existing report that allows me to get to the "events" out of the rules of a Filter? or How can I access to the Filter properties in a script to compare low level if a model and its objects and relationship agree with the terms of a specific filter (not the Selected necesary)?
I'll very thanksfull about any contribution.
Nico.