cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve Credentials in the Initialise page

JeromeRajan
Level 3
Hi all, Need your advice on whether my approach and thinking are right. I am storing database credentials in the credential manager and using the initialize page to call the Credentials Get action and store the values in variables, all defined in the Initialise page. I then build the connection string which is a global variable that can be used by other actions in the BO. My understanding was that every time my process calls the BO, the initialize page would run, invoke the Credentials action and make the values available globally but for some reason that's not happening. The Initialise page doesn't seem to be executing at all. The connection string remains blank.   Help appreciated. Thank you
7 REPLIES 7

John__Carter
Staff
Staff
The Initialise page will only run once when you first call the object from a process. If you have already called the object then you'll need to restart/reset the process to force the Initialise again. If you are working directly in the object without a process, then Initialise will not be run automatically.

JeromeRajan
Level 3
Thank you, John. Is there a way I can test this? None of the code I put in the initialize page seems to execute. I tried to reset and restart the process but the initialize page doesn't run.  

John__Carter
Staff
Staff
Try enabling logging on the Initialise page, and maybe put in a 'Hello' Note stage too so that it shows up in the logs. There must be some simple explanation, the Initialise page has been in since BP v2 and definitely works.

JeromeRajan
Level 3
Sure John. Thanks for the tip. Will try. Do you think it's a good idea to put logic in the 'Initialize' page to access the credential manager and store the values in global variables?

John__Carter
Staff
Staff
Yes the idea is fine. The slight downside is that when you want to work directly in the object diagram you'll need to run Initialise while stepping through your page.

MelissaSuarez_G
Level 6
If you want to maximize the reusability of the Business Object, you wouldn't want to handle the credentials in the object. Ideally you would use the Get Credentials action in the process and pass those values as inputs to the Business Object that you created. This way if you have different credentials for the same application (i.e. supervisor and processor accounts) you can still use the same business object to access the application.

ThomasTong
Level 4
I have a similar problem... When I try to Credentials->Get from within the BO, it says that the BO does not have permission to access the credentials needed. In System->Credentials, when I open the credential and go to Access Rights->Processes tab, only processes are listed and not the BO. Did the accessing of credentials change in the latest BP release? If I step into the BO from the calling process, passing the credential values, I can stop it where I need it and try to model more UI elements, but that doesn't get saved when I exit the BO (ad hoc) and process. So the question is:  How do I get credentials from within the BO so that I can log into the site and continue with the Application Modeller?