Class DecisionModelController
Controller class for the REST interface to the Decision Modeler functions.
Inheritance
DecisionModelController
Assembly: WMServer.dll
Syntax
[Route("decisionModel")]
[Authorize]
[ApiController]
public class DecisionModelController : ControllerBase
Constructors
DecisionModelController(WMAppDbContext)
Declaration
public DecisionModelController(WMAppDbContext context)
Parameters
Methods
AddDecisionModelElements(string, ICollection<JObject>?)
Add the decision model elements specified in the body of the request to the decision model with the specified ID.
Declaration
[HttpPost("{id}/elements")]
public Task<IActionResult> AddDecisionModelElements(string id, ICollection<JObject>? elements)
Parameters
Returns
Exceptions
Clone(string, VersionCreateArgs?)
Creates a new version of the specified asset.
Declaration
[HttpPost("{id}/createVersion")]
public Task<ActionResult<IEnumerable<OpenDIDecisionModel>>> Clone(string id, VersionCreateArgs? args = null)
Parameters
| Type |
Name |
Description |
| string |
id |
The identifier of the asset
|
| VersionCreateArgs |
args |
Arguments for creating a version.
|
Returns
Exceptions
Commit(string)
Commits the specified asset to Head.
Declaration
[HttpPost("{id}/commitVersion")]
public Task<IActionResult> Commit(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
The identifier of the asset
|
Returns
Exceptions
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
Exceptions
GetDcesionModels()
Evaluate a list of the Decision Models to which the user has been granted view access.
Declaration
[HttpGet]
public Task<ActionResult<IEnumerable<DecisionModelDTO>>> GetDcesionModels()
Returns
GetDecisionModel(string)
Evaluate the Decision Model with the specified ID.
Declaration
[HttpGet("{id}")]
public Task<ActionResult<OpenDIDecisionModel>> GetDecisionModel(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
|
Returns
GetDependencies(ICollection<JObject>?)
Get the dependencies between each element provided.
Declaration
[HttpPost("dependencies")]
public Task<ActionResult<List<ElementDependencyResults>>> GetDependencies(ICollection<JObject>? elements)
Parameters
| Type |
Name |
Description |
| ICollection<JObject> |
elements |
The elements in the model.
|
Returns
GetDependencies(string)
Get the dependencies between each element in a decision model.
Declaration
[HttpGet("{id}/dependencies")]
public Task<ActionResult<List<ElementDependencyResults>>> GetDependencies(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
The ID of the model.
|
Returns
GetSimulations(string)
Get all of the simulations associated with this decision model.
Declaration
[HttpGet("{id}/simulations")]
public Task<ActionResult<IEnumerable<OpenDISimulation>>> GetSimulations(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
The ID of the decision model
|
Returns
Exceptions
PatchDecisionModel(string, OpenDIDecisionModel)
Patch the properties of an existing decision model. If an element array is passed, it will replace all existing elements.
Declaration
[HttpPatch("{id}")]
public Task<IActionResult> PatchDecisionModel(string id, OpenDIDecisionModel openDI_dm)
Parameters
Returns
Exceptions
PatchDecisionModelElements(string, DecisionModelElementPatchDocument)
Patch the elements of an existing decision model. Supports any number of sets and deletions. A set will add a new element or replace an existing one with the same ID. A deletion will delete any element, depending on ID.
Declaration
[HttpPatch("{id}/elements")]
public Task<IActionResult> PatchDecisionModelElements(string id, DecisionModelElementPatchDocument dmPatchDocument)
Parameters
Returns
Exceptions
PostDecisionModel(OpenDIDecisionModel)
Add a new DecisionModel to the database with all included elements.
Declaration
[HttpPost]
public Task<ActionResult<OpenDIDecisionModel>> PostDecisionModel(OpenDIDecisionModel openDI_dm)
Parameters
Returns
PutDecisionModelDTO(string, OpenDIDecisionModel)
Update the Decision Model with the specified ID with values specified in the body of the request. This will replace all decision model elements with what is provided in the request.
Declaration
[HttpPut("{id}")]
public Task<IActionResult> PutDecisionModelDTO(string id, OpenDIDecisionModel openDI_dm)
Parameters
Returns
Exceptions
PutDecisionModelwithElements(string, OpenDIDecisionModel)
Update the decision model with the specified ID with values spoecified in the body of the request.
Declaration
[HttpPut("{id}/withElements")]
public Task<IActionResult> PutDecisionModelwithElements(string id, OpenDIDecisionModel openDI_dm)
Parameters
Returns
Exceptions
Versions(string)
Commits the specified asset to Head.
Declaration
[HttpPost("{id}/versions")]
public Task<ActionResult<IEnumerable<VersionArgs>>> Versions(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
The identifier of the asset
|
Returns
Exceptions