Calling Decisions Services from .NET
  • 09 Aug 2022
  • 1 Minute to read
  • Dark
    Light

Calling Decisions Services from .NET

  • Dark
    Light

Article Summary

Overview

Decisions has an Integration Details Page that contains information on implementing a desirable operation.

Viewing Integration Details Page

  1. Navigate to System > Administration > Features > All Services.
  2. Right-click the desirable service and select View Integration Details.
  3. Select an operation to implement.
  4. Click SHOW to view the Integration Details Page for the chosen operation.

Using the .NET API

Decisions has a .NET API that can be used instead of creating web references to common services such as Folder, Account, Comment, and Assignment. Web references might be fine for one or two services, but each web reference will have types like PasswordCredentialsUserContext, which won't be shared. Instead, use the .NET API.

Add .NET assembly references DecisionsFramework.NET and CoreServicesClients.NET to the project from the installed Decisions SDK. (If the SDK is not installed, re-run the Decisions installer and add the SDK).

These two assemblies will give all core Decisions services an easy-to-use precompiled interface.

Once these are added, tell the API helper where to find the Decisions portal so it can configure all service endpoints. Do this by initializing the ServiceFetcher and letting the application store a list of dynamically created types like in the code below:

 ServiceClientFactory.Setup("http://localhost/decisions/Primary/API/ServiceFetcher", BindingType.BasicHTTP);
ServiceClientFactory.Mode = FactoryMode.Net;
DynamicKnownTypes.GetInstance().Initialize(".");

From there, it's easy to run services:

 FolderServiceClient fsc = new FolderServiceClient();
            Folder[] f = fsc.GetRootFolders(myContext);
            foreach (Folder ff in f) {
                MessageBox.Show("Folder = " + ff.EntityName);
            }
            CommentServiceClient csc = new CommentServiceClient();
            csc.AddComment(myContext, f[0].FolderId, new Comment() {
                EntityName = "Test Comment",
                EntityDescription = "Test Description"
            });

Was this article helpful?