Class OpenDIBase
Base for Open DI compliant class definitions
Inherited Members
Namespace: Quantellia.WMServer.OpenDI
Assembly: WMServer.dll
Syntax
public abstract class OpenDIBase
Remarks
Open DI classes are used for defining JSON schemas in the REST protocol. Database transactions, however, use the DataTransferObject (DTO)-derived classes, whcih are proprietary to World Modeler. Translation between DTO and OpenDI classes is performed as follows:
- For DTO to OpenDI: Call the constructor of the OpenDI class and pass the DTO object as the argument.
- For OpenDI to DTO: Each OpenDI class implements a
ToDTO()
method which creates and returns a DTO object populated with the data in the OpenDI object
Constructors
OpenDIBase()
Default constructor.
Declaration
public OpenDIBase()
OpenDIBase(IDecisionModelBase)
Constructor that initializes the Open DI object with properties that are common to all DecisionModelBase-derived objects.
Declaration
public OpenDIBase(IDecisionModelBase diBase)
Parameters
Type | Name | Description |
---|---|---|
IDecisionModelBase | diBase |
Fields
openDIVersion
The Open DI version supported by this implementation.
Declaration
public const string openDIVersion = "0.2"
Field Value
Type | Description |
---|---|
string |
Properties
documentation
Longer, formatted description of this object and other information provided as documentation.
Declaration
public string documentation { get; set; }
Property Value
Type | Description |
---|---|
string |
documentationMIMEType
MIME type of the Documentation.
Declaration
public string documentationMIMEType { get; set; }
Property Value
Type | Description |
---|---|
string |
id
The ID of the object. This should be generated by
Declaration
public string id { get; set; }
Property Value
Type | Description |
---|---|
string |
name
Name of the object in the Decision Model
Declaration
public string name { get; set; }
Property Value
Type | Description |
---|---|
string |
properties
Dictionary of properties associated with the object that are not specified by the Open DI standard. Open DI places no restrictions on what these are named, or their content.
Declaration
public Dictionary<string, object> properties { get; }
Property Value
Type | Description |
---|---|
Dictionary<string, object> |
summary
Short summary of this object.
Declaration
public string summary { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
GetOpenDIType(Type)
Convert a World Modeler Type to the matching Open DI type name
Declaration
public static string GetOpenDIType(Type wmType)
Parameters
Type | Name | Description |
---|---|---|
Type | wmType |
Returns
Type | Description |
---|---|
string |
GetWMType(string)
Get the World Modeler type that corresponds to the specified Open DI type name.
Declaration
public static Type GetWMType(string openDIType)
Parameters
Type | Name | Description |
---|---|---|
string | openDIType | The Open DI type name to be translated to a World Modeler Type. |
Returns
Type | Description |
---|---|
Type | The World Modeler Type corresponding to the specified Open DI type name. Throws an exception if no matching World Modeler Type can be found. |