SO

Hi,

I'm trying to update the attribute for an object in the selected model.  Using the script, first I want to open a database using a dummy user who has read access on this database as the user who will execute the report don't have direct access to some groups in the database. 

Based on the objects selected the script will then update the attribute of an object in the selected model with the name or names of the objects selected with ";" as a separator. I'm using Dialogs.BrowsArisItems(String sTitle,String sDesc,String servername,String databasename,Constants.CID_OBJDEF,null,"")

The ArisData.openDatabase("dbname","username","password",filter,locale,true) gives null.

Can anyone suggest if there is any other way to do this and if can share a code for this?

 

Please find the attached code I've written and suggest corrections if any required.

 

File attachments
by Francois Du Toit
Posted on Wed, 02/14/2018 - 05:42

Hi Sunil,

I believe you have to "recreate" the selected model list using the oreadDb instance. When you use selModels, the items still refer to the user's login context.

Hope that helps :)

Rgs,

Francois

0
by Sunil Oza Author
Posted on Thu, 02/15/2018 - 02:10

In reply to by cfdutoit

Hi Francois,

Thanks for the reply. 

I've tried this way but in Dialogs.BrowseArisItems() it doesn't show the object definitions. Please see the attached code and suggest if this requires any change. 

In code, scriptUser has read access to group and subgroups under 10.xxx whereas user executing script doesn't have access  to 10.xxx group and subgroups.

Thanks in advance.

Sunil

File attachments
0
by Kay Fischbach
Posted on Wed, 02/14/2018 - 07:43

Hello Sunil,

considering your login problem arises relatively early at the beginning of your code, let's fix that first.

Please make sure that all parameters you pass to the openDatabase method are correct.

As can be read in the ARIS Script method help the method openDatabase has the return value

"Database - Object of the opened database or null</null> if the database does not exist or in case of an incorrect database login."

With your method of acquiring the database name and the localeID I think it's highly unlikely that the method returns null because of an incorrect database name or localeID. The readOnly boolean value is also a simple true, so that can't be incorrect either.

Left options are

  • the filter GUID is incorrect. Double check that in the ARIS Architect in the administration tab > Configuration > Conventions > Filter > right click on the filter you want to use > Edit > displayed GUID matches the GUID used in the report.
  • The "scriptuser" user has insufficient privileges to log into the database. Use the username and password used in the script to open the ARIS Designer/Architect software and then try to manually log into the database.
    • If the database you want to log into is not displayed in the Explorer tab your scriptuser has no read privileges anywhere on the database you want to log into. In that case contact someone who can give the "scriptuser" user read rights on the target database.
    • If you see the database but when trying to "Log in with options..." you can't find the needed filter, contact someone who can allow the "scriptuser" user to log into the database with the needed filter
0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock