new ArchValueKnowledgeBaseDocumentCollection(coreExpressionViewModel)
This class holds a value in Architect Scripting. Data Type: Knowledge Base Document Collection An Architect knowledge base document instance maps a Knowledge Base document. Knowledge Base documents reside inside a knowledge base which is configured at the flow level. Note: Do not attempt to create instances of this class directly. They will be created automatically as needed by Architect Scripting.
Parameters:
| Name | Type | Description |
|---|---|---|
coreExpressionViewModel |
Object | ( Internal ) an Architect core expression view model. |
Extends
Members
-
static, readonly displayTypeName :string
-
Returns the display type name string 'ArchValueKnowledgeBaseDocumentCollection'.
-
static isArchValueKnowledgeBaseDocumentCollection :boolean
-
Returns true indicating that this is an ArchValueKnowledgeBaseDocumentCollection instance.
-
readonly consumesSecureData :boolean
-
Returns whether or not this value uses secure data. For this to be the case, the value must use a secure variable either in an expression or as the configured variable.
- Inherited From:
-
readonly dataType :ArchDataType
-
The Architect data type associated with this value.
- Inherited From:
-
readonly flowLevelDefault :ArchBaseValue
-
If this value has a flow-level default setting value available, this method will return the value for that setting. Otherwise, null will be returned. To see if a value has a flow level default, you can check the
ArchValueSettings#hasFlowLevelDefaultproperty.- Inherited From:
-
readonly hasError :boolean
-
Returns whether or not this value currently has an error. While this is certainly useful, please note the following:
- Any asynchronous methods that have been called on this value that are still pending will not update the error state until the asynchronous method completes.
- This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the errors or warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
- Inherited From:
-
readonly hasErrorOrWarning :boolean
-
Returns whether or not this value currently has an error or warning. While this is certainly useful, please note the following:
- Any asynchronous methods that have been called on this value that are still pending will not update the error or warning state until the asynchronous method completes.
- This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the errors or warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
- Inherited From:
-
readonly hasWarning :boolean
-
Returns whether or not this value currently has a warning. While this is certainly useful, please note the following:
- Any asynchronous methods that have been called on this value that are still pending will not update the warning state until the asynchronous method completes.
- This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
- Inherited From:
-
readonly isBuilder :boolean
-
Returns whether or not this value is set to a builder value. While builders end up generating expression text that specifies how the value should be calculated, they cannot be changed in Architect Scripting. You can call different methods on an
ArchBaseValueinstance such asArchBaseValue#setExpressionto set this to an expression or value type specific literal setter such asArchValueString#setLiteralStringon aArchValueStringinstance to set this to a literal.- Inherited From:
-
readonly isCollection :boolean
-
Returns true indicating that this is a collection.
- Inherited From:
-
readonly isExpression :boolean
-
Returns whether or not this value is set to a expression value.
- Inherited From:
-
readonly isLiteral :boolean
-
Returns whether or not this value is set to a literal value.
- Inherited From:
-
readonly isNoValue :boolean
-
Returns whether or not this value is set to
no value. Note that this does not mean the value is NOT_SET. It means there is no value specified for this value.- Inherited From:
-
readonly isNoValueNoFallback :boolean
-
Returns whether or not this value is set to
no value with no fallback. Note that this does not mean the value is NOT_SET. It means that there is no value specified for this value and the flow's runtime handling, such as picking up a default value for a setting somewhere else, should not be used.- Inherited From:
-
readonly isVariable :boolean
-
Returns whether or not this value is set to a variable value. Note that this is true when the value is set by calling
ArchBaseValue#setVariable. If you set the value with an expression, the return value will be false even if the expression is only a variable reference.- Inherited From:
-
readonly isVariableInitialValue :boolean
-
Returns whether or not this value is the initial value for a variable.
- Inherited From:
-
readonly length :number
-
Returns the number of Architect value items in this collection if this value
is a literal. Remember that asynchronous calls to add items to literal collection values will not add the item to the collection until the asynchronous processing successfully completes.- Inherited From:
-
readonly logStr :string
-
Returns a logging string that describes this Architect value.
- Inherited From:
-
readonly overridesDefaultValue :boolean
-
Returns whether or not this value is overriding another default value. For example, this is true when this a value overrides a flow level setting value.
- Inherited From:
-
readonly parent :ArchBaseObject
-
The parent Architect Scripting object associated with this value.
- Inherited From:
-
readonly parentFlow :ArchBaseFlow
-
Returns the parent flow for this value.
- Inherited From:
-
readonly settings :ArchValueSettings
-
Returns the settings associated with this value which provides meta data about this value like whether it is an output, can be set to a literal, can be set to an expression, etc. etc.
- Inherited From:
-
readonly valueText :string|Array.<string>
-
Returns a JavaScript string or string array for this collection value. If this value is an expression, it returns the expression text. If this value is a variable, it returns the variable text. If this value is a literal, the return value will be a JavaScript string array where each item's value in the array will be generated by accessing the
valueTextproperty for it. Please be sure to seeArchBaseNetworkValue#valueTextfor more information on the string formatting. Overall this property is meant to be a quick and easy way to look at a "value" string for a collection value but it is not meant to be some kind of fully inclusive description of this ArchBaseValueBasicCollection instance overall.- Inherited From:
Methods
-
addItemToCollection() → {ArchBaseValue}
-
This changes the value to a literal, creates a new
ArchBaseValueinstance, adds it to the end of the collection and returns it. The returned value will be the appropriate type for items contained in the collection. As such, if you added an item to anArchValueQueueCollection, the returned item would be anArchValueQueuevalue.- Inherited From:
-
addLiteralByKnowledgeBaseDocumentIdAsync(knowledgeBaseDocumentId, callbackFunctionopt) → {Promise.<ArchValueKnowledgeBaseDocumentCollection>}
-
Adds an
ArchValueKnowledgeBaseDocumentinstance to this collection for the knowledge base document if it can be looked up by its guid identifier. If the knowledge base document cannot be found, nothing is added to the collection.Parameters:
Name Type Attributes Description knowledgeBaseDocumentIdstring the identifier of the knowledge base document.
callbackFunctioncallbackArchValueKnowledgeBaseDocumentCollection <optional>
a callback function to call if the knowledgeBaseDocument is successfully looked up and added to this knowledgeBaseDocument collection value. The first parameter passed to the callback function will be this knowledgeBaseDocument collection value instance.
Returns:
Promise.<ArchValueKnowledgeBaseDocumentCollection> -
addLiteralByKnowledgeBaseDocumentNameAsync(knowledgeBaseDocumentName, callbackFunctionopt) → {Promise.<ArchValueKnowledgeBaseDocumentCollection>}
-
Adds an
ArchValueKnowledgeBaseDocumentinstance to this collection for the knowledge base document if it can be looked up by its name. If the knowledge base document cannot be found, nothing is added to the collection.Parameters:
Name Type Attributes Description knowledgeBaseDocumentNamestring the name of the knowledge base document.
callbackFunctioncallbackArchValueKnowledgeBaseDocumentCollection <optional>
a callback function to call if the knowledgeBaseDocument is successfully looked up and added to this knowledgeBaseDocument collection value. The first parameter passed to the callback function will be this knowledgeBaseDocument collection value instance.
Returns:
Promise.<ArchValueKnowledgeBaseDocumentCollection> -
clearCollection()
-
Clears all values from this collection.
- Inherited From:
-
getExpressionText() → {string}
-
If this value is an expression, this method will return the expression text.
Returns:
string- Inherited From:
-
getItemByIndex(index) → {T}
-
Returns the Architect value associated with the collection at the specified index if this value
is a literal.Parameters:
Name Type Description indexnumber the index of the collection item to retrieve. This value should be a non-negative integer.
Returns:
T- Inherited From:
-
getVariable() → {ArchBaseVariable}
-
If this value is a variable reference, this method will return the variable that is being referenced.
Returns:
ArchBaseVariable- Inherited From:
-
setExpression(expressionText)
-
This sets the expression text on this value. If the expression cannot be set because the expression text is invalid, you're trying to set an expression on an output, etc. etc. the call will fail. If you wish to have the ability to set syntactically invalid expression text on an
ArchBaseValueobject and not have this method throw, you can set theArchValueSettings.allowInvalidExpressionTextproperty to true prior to calling the setExpression function and Scripting will not throw an error if the expression text is invalid. Remember, output values are required to be variables so you should use setVariable on those calls instead of passing in expression text that references a variable.Parameters:
Name Type Description expressionTextstring the expression to set on this value.
Throws:
- This method will throw if it is unable to set the supplied expression text with an error describing why.
- Inherited From:
-
setExpressionFromVariable(variableToAssign)
-
This method sets the value to an expression and assigns the variable's name as the expression text.
Parameters:
Name Type Description variableToAssignstring | ArchBaseVariable the variable to assign passed in either by a string like 'Flow.myInteger' or an Architect variable. If the value is a string, this function will attempt to look up the variable and if it doesn't exist then create it. Next it will assign the variable name as the expression text. If you pass in an
ArchBaseVariablereference, it needs to be in scope for this value.- Inherited From:
-
setFromValue(sourceValue)
-
Sets this value to match the given source value, copying its mode and configuration exactly. This is useful when you want to duplicate the full state of one value onto another, including expression mode, literal values, variable references, builder configuration, and no-value states. The source and destination values must have the same data type.
Parameters:
Name Type Description sourceValueArchBaseValue the source value to copy from.
- Inherited From:
-
setLiteralEmptyCollection() → {void}
-
Sets the collection literal mode with no items configured.
Returns:
void- Inherited From:
-
setNoValue()
-
This method sets the value to no value. Note that this is different from setting NOT_SET or something like a blank string. Setting a value to contain no value is something which is rather internal to Architect but we're exposing it in scripting. In a nutshell, setting no value means to take advantage of default runtime handling. The default runtime handling can change based on where this is used. For example, setting no value for a variable initial value means that the runtime will set a non-collection variable to NOT_SET or a collection variable to an empty collection. On a value that has a flow level default, setting it to no value means that the runtime should pick up the value to use from the flow level default. And if a flow level default allows no value, that means that the runtime will pick up the value from somewhere else normally defined in Admin. An example of this is that the connect timeout specified for a Transfer to Number action that it would use the Edge trunk connect timeout.
- Inherited From:
-
setNoValueNoFallback()
-
This method sets the value to no value but with no fallback. This is different that setNoValue in that you are explicitly setting the expression to no value and you do not want to use the flows default value for this setting.
- Inherited From:
-
setVariable(variableToAssign)
-
This method sets the value to a variable and assigns the supplied variable to it. One thing to be aware of is when a value reports that it is an
input, the value may not allow you to call this method to configure a variable if the value'scan be variablesetting reports false. Assuming that the value reports itcan be an expression, please look at using theArchBaseValue#setExpressionFromVariablemethod instead.Parameters:
Name Type Description variableToAssignstring | ArchBaseVariable the variable to assign passed in either by a string like 'Flow.myInteger' or an Architect variable. If the value is a string, this function will attempt to look up the variable and if it doesn't exist then create it. Next it will assign the variable name as the expression text. If you pass in an
ArchBaseVariablereference, it needs to be in scope for this value.- Inherited From: