DecisionRules 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DecisionRules --version 3.0.0                
NuGet\Install-Package DecisionRules -Version 3.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DecisionRules" Version="3.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DecisionRules --version 3.0.0                
#r "nuget: DecisionRules, 3.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DecisionRules as a Cake Addin
#addin nuget:?package=DecisionRules&version=3.0.0

// Install DecisionRules as a Cake Tool
#tool nuget:?package=DecisionRules&version=3.0.0                

Summary

Decisionrules.io library that allows you to integrate DecisionRules Solver and Management API to you application as easily as possible. SDK allow you to solve all rule types that are available, CRUD operations on all rule types, rules status management and rule tags management.

VERSION 3 IS NEW MAJOR VERSION OF THIS SDK AND IT IS STRONGLY RECOMMENDED, DUE TO DEPRECATION OF OLDER VERSIONS.

SDK v3 is supported for .NET 6.0 and .NET STANDARD 2.0 and it is highly recommended to target .net 6.0.

Installation

You can simply integrate SDK to your project via NuGet package manager.

Please note that SDK uses Newtonsoft.Json library for serialization and deserialization of request / response data.

Defining Custom domain

Custom domain is special class that is designed for those who uses DecisionRules in private cloud or as on-premise. Class takes up to 3 arguments (where domain name and protocol is mandatory): |Argument|Data type| |--|--| |domain|string| |protocol|Enums.Protocol| |port|int|

Domain argument is name of desired domain, protocol is HTTP or HTTPS and port is TCP/IP port. If port is not defined in the class constructor it is set to default value by protocol value, 80 for HTTP and 443 for HTTPS.

var customDomain = new CustomDomain("api.mydomain.com", Enums.Protocol);
var customDomain2 = new CustomDomain("api.mydomain.com", Enums.Protocol, 8080); 

Using Solver API

Solver class takes up to 3 arguments that are api key(can be generated on dashboard), custom domain object and Newtonsoft naming strategy for JSON serialization. Last two arguments are not mandatory and are set to default values on init. Class exposes two async methods: SolveRule and SolveRuleFlow.

public async Task<List<OutputModel>> amazingRuleSolver() 
{
	var solver = new Solver("myApiKey");
	
	var itemId = "id of a rule that is being solved";
	var itemId2 = "id of a ruleflow that is being solved";
	InputModel data = new();
	
	var resultForRule = await solver.SolveRule<InputModel,OutputModel>(itemId, data);
	var resultForRuleFlow = await solver.SolverRuleFlow<InputModel,OutputModel>(itemId2, data);
	
	return resultForRule;
}

Using Management API

Management class takes on argument, management api key. Class exposes number of methods listed below.

  • GetRule - get rule by itemId and version*
  • CreateRule - create rule by spaceId and ruleData
  • UpdateRule - updates rule by itemId, newRuleData and version*
  • DeleteRule - deletes rule by itemId and version
  • GetSpaceItems - get space items that belongs to management api key or get items by tags
  • GetRuleFlow - get rule by itemId and version*
  • CreateRuleFlow - create ruleflow in space that belongs to management api key
  • UpdateRuleFlow - updates ruleflowby itemId, newRuleflowData and version*
  • DeleteRuleFlow - deletes ruleflow by itemId and version
  • ExportRuleFlow - exports ruleflow by itemId and version*
  • ImportRuleFlow - import ruleflow as a new ruleflow or new version of existing ruleflow or override existing ruleflow.
  • ChangeRuleStatus - changes rule status
  • ChangeRuleFlowStatus - changes ruleflow status
  • UpdateTags - update tags on rule or ruleflow
  • DeleteTags - delete tags on rule or ruleflow

* = optional argument

Example usage

public async Task<Object> manageRules()
{
	var manager = new Management("management_key");
	
	var itemId = "some rule or ruleflow id"

	return await manager.GetRule(itemId);
} 
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.6 18,702 7/22/2022
3.0.5 426 7/22/2022
3.0.4 477 6/27/2022
3.0.3 426 6/15/2022
3.0.2 430 6/6/2022
3.0.0 426 5/6/2022
2.0.1 471 1/24/2022
2.0.0 318 10/8/2021
1.6.5 289 9/23/2021
1.6.3 461 1/24/2022
1.5.3 329 8/3/2021
1.5.1 330 7/26/2021
1.4.2 336 6/28/2021