cancel
Showing results for 
Search instead for 
Did you mean: 

Unity API does not recognize users added since last app cache reset (15.0.2.207)

Jeffrey_Seaman
Star Contributor
Star Contributor

I've found what I consider to be a bit of an inconsistency with how core-based products and the API recognize user accounts.

The scenario in question as to how I found the issue is that we have users submitting documents to the system. Based on certain criteria, we may need to redirect these documents to a different recipient based on a lookup to an external database. This lookup is done using a Unity script executed as part of a task list in workflow. I figured that since I'm already in the middle of a script, why not check to see if there is a corresponding user account in OnBase. If I get a null back, then I can skip a chunk of workflow logic as I know I can't deliver a document to a user that does not exist.

The initial tests all worked great. However, yesterday afternoon, the logic seemed to have stopped working. It turns out the issue was that we had just created the user account we wanted to redirect the document to during testing. Whether trying to access the user through the Unity automation API in workflow or through an executable, OnBase would return that the user did not exist. We restarted the Workflow Timer Service, submitted the document again, and tada, it recognized the user existed and the document was redirected as expected.

So, where the inconsistency comes in is related to the workflow rule "Is User in User Group or Role". While the API will not recognize a user created since the last app cache reset, this rule will recognize the user. So, in a single task list, you could run a script and get the result that a user account does not exist in OnBase with one action, yet the next rule could tell you that the same account belongs to a user group. That's a bit odd to me.

I have changed my script to skip validating the user account and now rely solely on the rule to check user group membership. This allows newly created users to be recognized and documents to be delivered to them.

These tests were all performed on an OnBase 15.0.2.207 system. Maybe this functionality has changed since then. We are looking to integrate with Active Directory in the not too distant future, so the ability to recognize user accounts that are being created on the fly may become an issue. While we can work around it in the given scenario, there could be other scenarios where scripts are running outside of the context of workflow where we need to be able to access a user object for a user created since the last app cache reset.

1 ACCEPTED ANSWER

Ramya_Kondeti
Star Contributor
Star Contributor

Hi Jeffrey,

  Sorry it took us time to respond.

How are you getting users? Are you getting them using Application.Core.GetUser() or using Application.Core.UserAdministration.GetUsers()?

I was testing using the LATEST version and noticed that getting Users off of Core needs a cache reset for the user to be recognized as existing while getting Users off of UserAdministrations does not. So may be you could get users via UserAdministration for your needs. The only caveat to using UserAdministration.GetUsers() is that it returns only those users that the current user has rights to administer.

This behavior might have changed from the version that you are using. I suggest getting the latest version of Hyland.Unity and see if that helps.

Let us know if you have any more questions!

View answer in original post

2 REPLIES 2

Ramya_Kondeti
Star Contributor
Star Contributor

Hi Jeffrey,

  Sorry it took us time to respond.

How are you getting users? Are you getting them using Application.Core.GetUser() or using Application.Core.UserAdministration.GetUsers()?

I was testing using the LATEST version and noticed that getting Users off of Core needs a cache reset for the user to be recognized as existing while getting Users off of UserAdministrations does not. So may be you could get users via UserAdministration for your needs. The only caveat to using UserAdministration.GetUsers() is that it returns only those users that the current user has rights to administer.

This behavior might have changed from the version that you are using. I suggest getting the latest version of Hyland.Unity and see if that helps.

Let us know if you have any more questions!

Thanks! I was indeed using Application.Core.GetUser(). I swapped it to Application.Core.UserAdministration.GetUsers().Find(user) and no more app cache reset needed.