Class WMModelBase
The asset class
Implements
Inherited Members
Namespace: Quantellia.WMServer.Asset.MLModel
Assembly: WMServer.dll
Syntax
public class WMModelBase : WMAssetBase, IWMExecutableAsset, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IHasEncryptedValues
Constructors
WMModelBase()
Parameterless Constructor. Will populate a random GUID as ID
Declaration
public WMModelBase()
WMModelBase(string)
Constructor that specifies ID
Declaration
public WMModelBase(string ID)
Parameters
Type | Name | Description |
---|---|---|
string | ID |
Properties
EncryptionPlaceholder
Standard string to replace encrypted values with when not returning plain-text values.
Declaration
[NotMapped]
public string EncryptionPlaceholder { get; set; }
Property Value
Type | Description |
---|---|
string |
RegisteredType
Determines the type of model that should be implemented
Declaration
public string RegisteredType { get; set; }
Property Value
Type | Description |
---|---|
string |
SourceFormat
Indicates what format the source string is in.
Declaration
public string SourceFormat { get; set; }
Property Value
Type | Description |
---|---|
string |
SourceMode
Indicates how to interpret the source string.
Declaration
public string SourceMode { get; set; }
Property Value
Type | Description |
---|---|
string |
SourceString
The source string containing a decision tree.
Declaration
public string SourceString { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
CacheModel(string, object)
Attempts to cache the given model to the memory cache.
Declaration
protected static void CacheModel(string ID, object model)
Parameters
Type | Name | Description |
---|---|---|
string | ID | The ID to cache under |
object | model | The model to be cached |
Execute(ElementValue)
Performs an execution on the model implemented in this WMModelBase
Declaration
public virtual ElementValue Execute(ElementValue parameters)
Parameters
Type | Name | Description |
---|---|---|
ElementValue | parameters | A model specific parameter set. |
Returns
Type | Description |
---|---|
ElementValue |
OnModelChanged(string)
Called whenever a WMModelBase is changed. This will cause the cached model to be deleted, if it exists.
Declaration
public static void OnModelChanged(string ID)
Parameters
Type | Name | Description |
---|---|---|
string | ID | The key to search under |
TryGetCachedModel<T>(string, out T)
Attempts to find the cached model with the given ID. If found, attempts to convert to the generic type and return.
Declaration
public static bool TryGetCachedModel<T>(string ID, out T model) where T : class
Parameters
Type | Name | Description |
---|---|---|
string | ID | The ID the model is cached against |
T | model | The model to be returned. |
Returns
Type | Description |
---|---|
bool | True if the model is found, false if not. |
Type Parameters
Name | Description |
---|---|
T | The type of the model. |