/decnet

⚗️ RESTful execution server for decision models powered by jDEC

Primary LanguageJavaApache License 2.0Apache-2.0

decnet

decnet is an RESTful execution server for decision models powered by jDEC.

Download

Artifacts of decnet are published in regular intervals to the releases section of GitHub. They can be seen at https://github.com/materna-se/decnet/releases.

Documentation

GET /{namespace}

Returns the decision model.

Request

Request Parameters
Name In Type Required Description
namespace path string true none

Responses

Status Meaning Description
200 OK The model is returned.
404 Not Found The model was not found.

POST /{namespace}

Executes the decision model.

Request

Request Parameters
Name In Type Required Description
body body object false none
namespace path string true none
Example Request
{
  "Employment Status": "UNEMPLOYED"
}

Responses

Status Meaning Description
200 OK The result of the model execution.
404 Not Found The model was not found.
Response Schema

Status Code 200

Name Type Required Restrictions Description
outputs object false none none
context object false none none
messages [string] false none none
Example Response

The result of the model execution.

{
  "outputs": {
    "Employment Status Statement": "You are UNEMPLOYED"
  },
  "context": {
    "Employment Status Statement": {}
  },
  "messages": []
}

PUT /{namespace}

Imports the decision model.

Request

Request Parameters
Name In Type Required Description
namespace path string true none

Responses

Status Meaning Description
204 No Content The model was imported successfully.
Response Schema

Status Code 204

Name Type Required Restrictions Description
messages [string] false none Warnings that occurred during compilation.
Example Response
{
  "messages": [
    "DMN: Missing expression for Decision Node 'Employment Status Statement'."
  ]
}

DELETE /{namespace}

Deletes the decision model.

Request

Request Parameters
Name In Type Required Description
namespace path string true none

Responses

Status Meaning Description
204 No Content The model was deleted successfully.

GET /{namespace}/structure

Request

Request Parameters
Name In Type Required Description
namespace path string true none

Responses

Status Meaning Description
200 OK Returns the input structure that is required for executing the decision model.
404 Not Found The model was not found.
Example Response

Returns the input structure that is required for executing the decision model.

{
  "Employment Status": {
    "type": "string",
    "options": [
      "UNEMPLOYED",
      "EMPLOYED",
      "SELF-EMPLOYED",
      "STUDENT"
    ]
  }
}