Show / Hide Table of Contents

Class WMClass

Jurassic class for exposing WM Asset functionality to javascript called in a decision model.

Inheritance
object
ObjectInstance
WMClass
Inherited Members
ObjectInstance.HasProperty(object)
ObjectInstance.GetPropertyValue(uint)
ObjectInstance.GetPropertyValue(uint, object)
ObjectInstance.GetPropertyValue(object)
ObjectInstance.GetPropertyValue(object, object)
ObjectInstance.TryGetPropertyValue(object, out object)
ObjectInstance.GetPropertyValue(PropertyReference)
ObjectInstance.GetOwnPropertyDescriptor(uint)
ObjectInstance.GetOwnPropertyDescriptor(object)
ObjectInstance.GetMethod(object)
ObjectInstance.SetPropertyValue(uint, object, bool)
ObjectInstance.SetPropertyValue(uint, object, object, bool)
ObjectInstance.SetPropertyValue(object, object, bool)
ObjectInstance.SetPropertyValue(object, object, object, bool)
ObjectInstance.SetPropertyValue(PropertyReference, object, bool)
ObjectInstance.SetPropertyValue(PropertyReference, object, object, bool)
ObjectInstance.Delete(uint, bool)
ObjectInstance.Delete(object, bool)
ObjectInstance.DefineProperty(object, PropertyDescriptor, bool)
ObjectInstance.InitializeProperties(IEnumerable<PropertyNameAndValue>)
ObjectInstance.InitializeMissingProperty(object, PropertyAttributes)
ObjectInstance.CallMemberFunction(object, params object[])
ObjectInstance.TryCallMemberFunction(out object, object, params object[])
ObjectInstance.ToString()
ObjectInstance.HasOwnProperty(ScriptEngine, object, object)
ObjectInstance.IsPrototypeOf(ScriptEngine, object, object)
ObjectInstance.PropertyIsEnumerable(ScriptEngine, object, object)
ObjectInstance.ToLocaleString()
ObjectInstance.ValueOf()
ObjectInstance.ToStringJS(ScriptEngine, object)
ObjectInstance.PopulateFunctions()
ObjectInstance.PopulateFunctions(Type)
ObjectInstance.PopulateFunctions(Type, BindingFlags)
ObjectInstance.PopulateFields()
ObjectInstance.PopulateFields(Type)
ObjectInstance.Engine
ObjectInstance.Prototype
ObjectInstance.this[object]
ObjectInstance.this[uint]
ObjectInstance.this[int]
ObjectInstance.Properties
ObjectInstance.OwnKeys
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Quantellia.WMServer.Execution.Model.JS
Assembly: WMServer.dll
Syntax
public class WMClass : ObjectInstance

Constructors

WMClass(ObjectInstance)

Jurassic constructor.

Declaration
public WMClass(ObjectInstance prototype)
Parameters
Type Name Description
ObjectInstance prototype

Properties

MaxSimulations

Maximum number of simulation runs to execute.

Declaration
public static int MaxSimulations { get; }
Property Value
Type Description
int

UserID

The UserID of the principal calling WMClass methods.

Declaration
public string UserID { get; set; }
Property Value
Type Description
string

UserType

The UserType of the principal calling WMClass methods.

Declaration
public string UserType { get; set; }
Property Value
Type Description
string

arguments

A javascript object of name-value pair arguments, each representing a constant override for the value of a DecisionModelElement in the DecisionModel's execution.

Declaration
[JSProperty(Name = "arguments")]
public ObjectInstance arguments { get; }
Property Value
Type Description
ObjectInstance
Remarks

Set arguments via javascript "WM.setArguments("...")", where the input is a serialized string,object dictionary. Note that this is a provisional method, and is expected to be called from .NET

maxSimulations

Manages the maximum number of evaluations a simulation may run.

Declaration
[JSProperty(Name = "maxSimulations", IsConfigurable = false)]
public int maxSimulations { get; }
Property Value
Type Description
int

Methods

ExecuteDataReader(string)

Exposes the ability to execute a data reader in javascript from a decision model. When calling this function in javascript, "WM.executeDataReader(...)".

Declaration
[JSFunction(Name = "executeDataReader")]
public object ExecuteDataReader(string DataReaderDir)
Parameters
Type Name Description
string DataReaderDir

The FullPathName of a dataReader owned by this user.

Returns
Type Description
object

A javascript array of bag of values objects representing the returned table, a native javascript value, such as a string or number, or null.

ExecuteDataReader(string, ObjectInstance)

Exposes the ability to execute a data reader in javascript from a decision model. When calling this function in javascript, "WM.executeDataReader(...)".

Declaration
[JSFunction(Name = "executeDataReader")]
public object ExecuteDataReader(string DataReaderDir, ObjectInstance parameters)
Parameters
Type Name Description
string DataReaderDir

The FullPathName of a dataReader owned by this user.

ObjectInstance parameters

The parameters to be passed into the reader represented as a javascript bag of values. Do not pass null into this parameter. If there are no parameters to be passed then utilize the parameterless version of this method.

Returns
Type Description
object

A javascript array of bag of values objects representing the returned table, a native javascript value, such as a string or number, or null.

ExecuteDataSource(string, string, string)

Exposes the ability to execute a data source in javascript from a decision model. When calling this function in javascript, "WM.executeDataSource(...)".

Declaration
[JSFunction(Name = "executeDataSource")]
public object ExecuteDataSource(string DataSourceDir, string Query, string Action)
Parameters
Type Name Description
string DataSourceDir

The FullPathName of a dataSource owned by this user.

string Query

The query to be called on the dataSource. For an SQLServer dataSource, this would be an SQL query.

string Action

The action to perform on the recieved data. Must be "Readtable", "ReadScalar", "ReadNone".

Returns
Type Description
object

A javascript array of bag of values objects representing the returned table, a native javascript value, such as a string or number, or null.

ExecuteDataSource(string, string, string, ObjectInstance)

Exposes the ability to execute a data source in javascript from a decision model. When calling this function in javascript, "WM.executeDataSource(...)".

Declaration
[JSFunction(Name = "executeDataSource")]
public object ExecuteDataSource(string DataSourceDir, string Query, string Action, ObjectInstance parameters)
Parameters
Type Name Description
string DataSourceDir

The FullPathName of a dataSource owned by this user.

string Query

The query to be called on the dataSource. For an SQLServer dataSource, this would be an SQL query.

string Action

The action to perform on the recieved data. Must be "Readtable", "ReadScalar", "ReadNone".

ObjectInstance parameters

The parameters to be passed into the query represented as a javascript bag of values. Do not pass null into this parameter. If there are no parameters to be passed then utilize the parameterless version of this method.

Returns
Type Description
object

A javascript array of bag of values objects representing the returned table, a native javascript value, such as a string or number, or null.

ExecuteDataSource(string, string, string, ObjectInstance, bool)

Exposes the ability to execute a data source in javascript from a decision model. When calling this function in javascript, "WM.executeDataSource(...)".

Declaration
[JSFunction(Name = "executeDataSource")]
public object ExecuteDataSource(string DataSourceDir, string Query, string Action, ObjectInstance parameters, bool cacheResult)
Parameters
Type Name Description
string DataSourceDir

The FullPathName of a dataSource owned by this user.

string Query

The query to be called on the dataSource. For an SQLServer dataSource, this would be an SQL query.

string Action

The action to perform on the recieved data. Must be "Readtable", "ReadScalar", "ReadNone".

ObjectInstance parameters

The parameters to be passed into the query represented as a javascript bag of values. Do not pass null into this parameter. If there are no parameters to be passed then utilize the parameterless version of this method.

bool cacheResult

If true, the resulting object returned from this execution will be cached, and when an identical query is called in the future, the object will be retrieved from the cache instead of performing the execution,

Returns
Type Description
object

A javascript array of bag of values objects representing the returned table, a native javascript value, such as a string or number, or null.

GetDataReader(string)

Exposes the ability to return data readers in javascript from a decision model. When calling this function in javascript, "WM.getDataReader(...)".

Declaration
[JSFunction(Name = "getDataReader")]
public JSDataReader GetDataReader(string DataReaderDir)
Parameters
Type Name Description
string DataReaderDir

The FullPathName of a dataReader owned by this user.

Returns
Type Description
JSDataReader

A JSDataReader object for use in javascript.

GetDataSource(string)

Exposes the ability to return data sources in javascript from a decision model. When calling this function in javascript, "WM.getDataSource(...)".

Declaration
[JSFunction(Name = "getDataSource")]
public JSDataSource GetDataSource(string DataSourceDir)
Parameters
Type Name Description
string DataSourceDir

The FullPathName of a dataSource owned by this user.

Returns
Type Description
JSDataSource

A JSDataSource object for use in javascript.

SetArguments(ObjectInstance)

Sets the arguments override object arguments via javascript "WM.setArguments(object obj)", where the input is a javascript object, or Jurassic.Library.ObjectInstance

Declaration
[JSFunction(Name = "setArguments")]
public void SetArguments(ObjectInstance obj)
Parameters
Type Name Description
ObjectInstance obj

A javascript object, or Jurassic.Library.ObjectInstance

StreamLLM(string, string, string, string)

Exposes the ability to stream an LLM conversation in javascript from a decision model. When calling this function in javascript, "WM.streamLLM(...)".

Declaration
[JSFunction(Name = "streamLLM")]
public object StreamLLM(string LLMDir, string message, string format, string schema)
Parameters
Type Name Description
string LLMDir

The FullPathName of an LLM owned by this user.

string message

The message to send.

string format

A string to specify return format

string schema

A string to specify return schema. Only valid with format="json", and some recent OpenAI models.

Returns
Type Description
object

A javascript array of bag of values objects representing the returned message and conversationID

StreamLLM(string, string, string, string, string?)

Exposes the ability to stream an LLM conversation in javascript from a decision model. When calling this function in javascript, "WM.streamLLM(...)".

Declaration
[JSFunction(Name = "streamLLM")]
public object StreamLLM(string LLMDir, string message, string format, string schema, string? conversationID)
Parameters
Type Name Description
string LLMDir

The FullPathName of an LLM owned by this user.

string message

The message to send.

string format

A string to specify return format

string schema

A string to specify return schema. Only valid with format="json", and some recent OpenAI models.

string conversationID

The conversationID of this conversation. Do not pass null into this parameter. If there is no conversationID to be passed then utilize the conversationID-less version of this method.

Returns
Type Description
object

A javascript array of bag of values objects representing the returned message and conversationID

In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 11/16/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE