Class DecisionModelController
Controller class for the REST interface to the Decision Modeler functions.
Inherited Members
Namespace: Quantellia.WMServer.DecisionModeler
Assembly: WMServer.dll
Syntax
[Route("decisionModel")]
[Authorize]
[ApiController]
public class DecisionModelController : ControllerBase
Constructors
DecisionModelController(WMAppDbContext, IMemoryCache)
Declaration
public DecisionModelController(WMAppDbContext context, IMemoryCache cache)
Parameters
Type | Name | Description |
---|---|---|
WMAppDbContext | context | |
IMemoryCache | cache |
Methods
DeleteDecisionModel(string)
Delete the Decision Model with the specified ID from the database.
Declaration
[HttpDelete("{id}")]
public Task<IActionResult> DeleteDecisionModel(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Exceptions
Type | Condition |
---|---|
Exception |
GetDcesionModels()
Get a list of the Decision Models to which the user has been granted view access.
Declaration
[HttpGet]
public Task<ActionResult<IEnumerable<DecisionModelDTO>>> GetDcesionModels()
Returns
Type | Description |
---|---|
Task<ActionResult<IEnumerable<DecisionModelDTO>>> | An array of Decision Model objects. |
Remarks
The list of Decision Models is provided in a "lazy loading" format, where sub-objects (such as elements, references to the Decision Model owner, etc.) are not provided as JSON objects, or only the IDs of these objects are returned. The returned format is shown below:
[
{
"ownerID": "fb17b649-ba0f-4af0-b32e-92cc1bb18392",
"ownerType": "Quantellia.WMServer.Auth.WMUser",
"name": "Decision Model 1",
"summary": "A Decision Model",
"documentation": "",
"DocumentationMIMEType": "",
"id": "ff2668d6-d6ac-4d2b-a503-569ea4a13666"
},
{
"ownerID": "e230c098-1e7b-4acc-9f9e-3c12fe14a632",
"ownerType": "Quantellia.WMServer.Auth.WMUser",
"name": "Decision Model 2",
"summary": "Another Decision Model",
"documentation": "",
"DocumentationMIMEType": "",
"id": "4636233e-7e4b-4697-8cc1-3b65c4bb0e2a"
}
]
If full details of a sub-object are requried, the Get operation for the class can
GetDecisionModel(string)
Get the Decision Model with the specified ID.
Declaration
[HttpGet("{id}")]
public Task<ActionResult<DecisionModel>> GetDecisionModel(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Returns
Type | Description |
---|---|
Task<ActionResult<DecisionModel>> | The Decision Model with the specified ID in the Open DI format. |
Remarks
If the ID property is not specified, a new ID will be created. IDs are GUIDs.
PostDecisionModel(OpenDIDecisionModel)
Add a new DecisionModel to the database.
Declaration
[HttpPost]
public Task<ActionResult<DecisionModelDTO>> PostDecisionModel(OpenDIDecisionModel openDIDM)
Parameters
Type | Name | Description |
---|---|---|
OpenDIDecisionModel | openDIDM |
Returns
Type | Description |
---|---|
Task<ActionResult<DecisionModelDTO>> |
PostDecisionModelElements(string, ICollection<OpenDIDecisionModelElement>)
Add the Decision Model Elements specified in the body of the request to the Decision Model with the specified ID.
Declaration
[HttpPost]
[Route("{id}/Elements")]
public Task<ActionResult<DecisionModel>> PostDecisionModelElements(string id, ICollection<OpenDIDecisionModelElement> elements)
Parameters
Type | Name | Description |
---|---|---|
string | id | ID of the Decision Model to which the Decision Model Elements specified in the body will be added. |
ICollection<OpenDIDecisionModelElement> | elements | A JSON array of Decision Model Elements to be added to the specified Decision Model. |
Returns
Type | Description |
---|---|
Task<ActionResult<DecisionModel>> | On success, the complete Decision Model is returned as a JSON object. The newly added elements will be
included in the |
PutDecisionModelDTO(string, DecisionModelDTO)
Update the Decision Model with the specified ID with values specified in the body of the request.
Declaration
[HttpPut("{id}")]
public Task<IActionResult> PutDecisionModelDTO(string id, DecisionModelDTO decisionModelDTO)
Parameters
Type | Name | Description |
---|---|---|
string | id | |
DecisionModelDTO | decisionModelDTO |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Exceptions
Type | Condition |
---|---|
Exception |