Search…
SDK and Frameworks
Integration functions

List of Integration functions

  • SOLVE
  • HTTP_GET
  • HTTP_POST
  • HTTP_PUT
  • HTTP_PATCH
  • HTTP_DELETE

Solve function

Solve function has the ability to call all types of DecisionRules rules and retrieve solved output model depending on input of the function. Input is defined as called rule input model.

Syntax

The SOLVE function syntax has the following arguments:
  • RuleID - Required. RuleID of target rule (DecisionTable, ScriptingRule, RuleFlow, DecisionTree).
  • Data - Required. Input model of target rule as valid JSON.
  • Options - Optional. Object of optional parameters that can more specify solving process. Options can contain parameters as strategy (specifies solving strategy that can be used for rules solving, more can be found here Execution Strategy, version (specifies version of target rule)and path (can be used to parse output model that is on ouput of Solve function, value of path parameter is string that represents dot notation path to desired value [more in examples])

Examples

1) SOLVE function without options
SOLVE("rule-id", {"foo":"bar"})
Function with this implementation takes target RuleID and defined input model and returns output model.
2) SOLVE function with options
SOLVE("rule-id",
{"foo":"bar"},
{"version": "1", "strategy": "ARRAY", "path":"person.name"}
)
Function with this implementation takes target RuleID and defined input model and applies defined strategy, version on solver that modifies output model. Afterwards, path arguments takes care of processing returned output model by solver, take just desired values and then passes it to the user.
3) Path argument in more detail
Lets take example rule output model that looks like this (this can be from DecisionTable, ScriptingRule, RuleFlow or DecisionTree):
[
{
person: {
name: "Joe"
}
},
{
person: {
name: "Jane"
}
}
]
Imagine we use path argument with value: "person.name" then the function return value is "Joe".
Its "Joe" because path argument works only with FIRST occurrence in output array (like if you used FIRST_MATCH strategy). If you want more values from more response objects you can use ARRAY strategy and path argument will return an array containing all matched values. In our case it would be ["Joe", "Jane"]

HTTP functions

HTTP_GET

HTTP_GET function can perform classic GET request with given URL. HTTP_GET returns JSON object of called API.

Syntax

The HTTP_GET function syntax has the following arguments:
  • URL - Required. Target url.
  • OPTIONS - Optional. Object of optional arguments that can enhance HTTP request. Only available options at this moment is headers object that can contain custom request headers that are appended to request before sending.

Examples

1) HTTP_GET without options
HTTP_GET("my.api.com")
2) HTTP_GET with options
HTTP_GET("my.api.com", {"headers": {"X-DEMO": "1"}})

HTTP_POST

HTTP_POST function can perform classic POST request with given URL and request DATA. HTTP_POST returns JSON object of called API.

Syntax

The HTTP_POST function syntax has the following arguments:
  • URL - Required. Target url.
  • DATA - Required. Request body as valid JSON object.
  • OPTIONS - Optional. Object of optional arguments that can enhance HTTP request. Only available options at this moment is headers object that can contain custom request headers that are appended to request before sending.

Examples

1) HTTP_POST without options
HTTP_POST("my.api.com", {"foo":"bar"})
2) HTTP_POST with options
HTTP_POST("my.api.com", {"foo":"bar"}, {"headers": {"X-DEMO": "1"}})

HTTP_PATCH

HTTP_PATCH function can perform classic PATCH request with given URL and request DATA. HTTP_PATCH returns JSON object of called API.

Syntax

The HTTP_PATCH function syntax has the following arguments:
  • URL - Required. Target url.
  • DATA - Required. Request body as valid JSON object.
  • OPTIONS - Optional. Object of optional arguments that can enhance HTTP request. Only available options at this moment is headers object that can contain custom request headers that are appended to request before sending.

Examples

1) HTTP_PATCH without options
HTTP_PATCH("my.api.com", {"foo":"bar"})
2) HTTP_PATCH with options
HTTP_PATCH("my.api.com", {"foo":"bar"}, {"headers": {"X-DEMO": "1"}})

HTTP_PUT

HTTP_PUT function can perform classic PUT request with given URL and request DATA. HTTP_PUT returns JSON object of called API.

Syntax

The HTTP_PUT function syntax has the following arguments:
  • URL - Required. Target url.
  • DATA - Required. Request body as valid JSON object.
  • OPTIONS - Optional. Object of optional arguments that can enhance HTTP request. Only available options at this moment is headers object that can contain custom request headers that are appended to request before sending.

Examples

1) HTTP_PUT without options
HTTP_PUT("my.api.com", {"foo":"bar"})
2) HTTP_PUT with options
HTTP_PUTH("my.api.com", {"foo":"bar"}, {"headers": {"X-DEMO": "1"}})

HTTP_DELETE

HTTP_DELETE function can perform classic GET request with given URL. HTTP_DELETE returns JSON object of called API.

Syntax

The HTTP_DELETE function syntax has the following arguments:
  • URL - Required. Target url.
  • OPTIONS - Optional. Object of optional arguments that can enhance HTTP request. Only available options at this moment is headers object that can contain custom request headers that are appended to request before sending.

Examples

1) HTTP_DELETE without options
HTTP_DELETE("my.api.com")
2) HTTP_DELETE with options
HTTP_DELETE("my.api.com", {"headers": {"X-DEMO": "1"}})
Copy link
On this page
List of Integration functions
Solve function
Syntax
Examples
HTTP functions
HTTP_GET
HTTP_POST
HTTP_PATCH
HTTP_PUT
HTTP_DELETE