- 25 Jun 2024
- 1 Minute to read
- Print
- DarkLight
Calling Decisions Services from .NET
- Updated on 25 Jun 2024
- 1 Minute to read
- Print
- DarkLight
Overview
Decisions has an Integration Details Page that contains information on implementing a desirable operation.
Viewing Integration Details Page
- Navigate to System > Administration > Features > All Services.
- Right-click the desirable service and select View Integration Details.
- Select an operation to implement.
- 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:
Consider using HttpClient to invoke Decisions Services as Restful Services using HTTP GET or POST.
AbstractUserContext userContext = UserContextHolder.GetCurrent();
Folder[] folders = FolderService.Instance.GetRootFolders(userContext);
foreach (Folder folder in folders)
{
Console.WriteLine($"Folder = {folder.EntityName}");
}
CommentService.Instance.AddComment(
userContext,
folders[0].FolderID,
new Comment()
{
EntityName = "Test Comment",
EntityDescription = "Test Description"
});