new module:ct-trading /derivation /Simple Derivation(sOutput Field Name)
Adds a value into a single output field. Input may be either a constant value OR a field.
Extends:
Parameters:
Name | Type | Description |
---|---|---|
sOutputFieldName |
String | the name of the field to use when adding the derived data. |
Extends
Methods
add Precondition(sField Name, sExpected Value)
Adds a precondition that must verified before the derived field can be calculated.
Parameters:
Name | Type | Description |
---|---|---|
sFieldName |
String | the field name to check |
sExpectedValue |
String | the expected field value |
get Derived Fields() → {Array}
Returns the list of fields that this derivation will provide.
These fields may be required as input fields to another derivation, and will be appended to the
data-holder when module:ct-trading/derivation/Derivation#recalculateDerivedFields
is
called.
Returns:
A list of derived field names as strings.
- Type
- Array
get Input Fields() → {Array}
Returns the list of fields that are required to perform the derivation.
The input fields of one derivation may be the derived fields of another derivation, and so will determine the order in which the derivations will be performed.
Returns:
A list of input field names as strings.
- Type
- Array
recalculate Derived Fields(oData)
Copies the value in the named input field to that in the named output field.
Parameters:
Name | Type | Description |
---|---|---|
oData |
module:ct-trading |
Data that is augmented by this derivation. Mandatory. |
set Input Field Name(sField Name)
Sets a required input field for this derivation
Parameters:
Name | Type | Description |
---|---|---|
sFieldName |
String | the input field for this derivation. |
set Output Value(sOutput Value)
Sets the output value (constant), to be used if no input field is defined.
Parameters:
Name | Type | Description |
---|---|---|
sOutputValue |
String | output value, to be used if no input field is defined. |