cancel
Showing results for 
Search instead for 
Did you mean: 
Andrew_Grusenme
Champ on-the-rise
Champ on-the-rise

The Unity API is a powerful direct line to the OnBase database. It gives you programmatic access to most key features of OnBase. But, what about cases where it would be convenient to use UI from the Unity Client? Like, for example, to display a document or view a Work Flow queue? For those cases, there is the Unity Client Automation API.

What can you do with it?

The Unity Client Automation API is a way to call into the Unity Client from the Unity API. It gives you the ability to display documents, folders, Document Composition templates, and Work Flow queues using the Unity Client. You have great flexibility in deciding what to display. For Documents, as an example, you could choose to show a single document, a Document Type, or the results of a Custom Query by sending a Unity Client Automation command to an already open instance of the Unity Client.

Connecting with an existing session

You can use the Unity Client Automation API after connecting to the Unity API like normal, or you can connect using an existing Unity Client session. This will allow you to use the full Unity API functionality (including Unity Client Automation functionality) using a currently existing Unity Client session.

Hyland.Unity.Application app = Hyland.Unity.Automation.UnityClientAutomation.ConnectToExistingUnityClientSession();

Configuration

  • The Unity Client must be configured to run in Service Mode and must be set as the registered client (see the Unity Client MRG). Service Mode can be set through the obunity.exe.config file:
<ServiceMode enabled="true" allowExit="true" autoLaunch="true">
  • Unity Client Automation API must also be enabled in the obunity.exe.config file:
<Feature name="Unity Client Automation API" enabled="true"/>

Example

Let's say we want to display all the documents of type "AP - Checks" in the Unity Client. To do so, first, we'll connect to OnBase through the Unity API:

Hyland.Unity.Application app =      Hyland.Unity.Application.Connect(authenticationProperties);

Next, we get the UnityClientAutomation object:

Hyland.Unity.Automation.UnityClientAutomation unityClientAutomation = app.GetAutomation<UnityClientAutomation>();

We want to display all the documents of the type "AP - Checks" so let's get that type:

DocumentType docType = app.Core.DocumentTypes.Find("AP - Checks");

Then we create the DocumentListProperties by passing in this Document Type:

DisplayDocumentListProperties displayDocumentListProperties =      UnityClientAutomation.CreateDisplayDocumentListProperties(docType);

Finally, we display the documents:

unityClientAutomation.DisplayDocumentList(displayDocumentListProperties);

A Unity Client window will appear with a document list of all AP - Checks documents. You can also add Keyword or Date restrictions to DisplayDocumentListProperties to reduce the results set. Folders and Work Flow work very similarly.

Notes

  • You'll need to contact your first line of support to request the necessary files to program for the Unity Client Automation API.
  • You'll need to be licensed for the Unity Integration Toolkit.
  • The user accessing the Unity Client Automation API will need the Unity Administrator and Unity Developer User Group privileges. These can be found in the OnBase Configuration Module under Users -> User Groups / Rights. Select the desired User Group and click the Product Rights button.

For more information about the Unity Client Automation API, including details on how to implement asynchronous requests, see the OnBase SDK.

Conclusion

The Unity Client Automation API is a tool that allows developers to create custom code to manipulate an instance of the Unity Client. Redirecting the client, opening particular documents, modifying keywords, and more is possible using the Unity Client Automation API. Hopefully this gives developers the flexibility to customize their usage of the Unity Client to their needs.

Join us next week when when we discussion caching in Unity Scripts!

1 Comment