ArchVariableBooleanCollection(coreVariableViewModel)

ArchVariableBooleanCollection

new ArchVariableBooleanCollection(coreVariableViewModel)

Parameters:
Name Type Description
coreVariableViewModel Object

( Internal ) an Architect core variable view model.

Extends

Members

static, readonly displayTypeName :string

Returns the display type name string 'ArchVariableBooleanCollection'.

static isArchVariableBooleanCollection :boolean

readonly canAssignInitialValue :boolean

Returns whether or not this variable can have an initial value configured for it in the flow.

Inherited From:

readonly dataType :ArchDataType

Returns the Architect Scripting data type for this variable.

Inherited From:

description :string

The description of the variable. Calling the description setter with "", null or undefined are all treated as if you are setting the description string to undefined so if you were to call the description getter in that case, nothing is returned.

Inherited From:

readonly hasUsages :boolean

Returns whether or not the variable consumed by the flow.

Inherited From:

readonly id :string

The identifier string for this object.

Inherited From:

readonly idMayBeBlank :string

Returns whether or not the id property may be blank or undefined for this object. For example, the returned settings from ArchMenu#settingsMenu will have a blank identifier along with the settings returned from ArchMenu#settingsSpeechRec. Note that this is an extremely rare case.

Inherited From:
See:

initialValue :ArchValueBooleanCollection

The initial boolean collection value for the variable at runtime. If the ArchValueBooleanCollection is set to no value, this will be an empty boolean collection at runtime.

readonly isArchBaseCoreObject :boolean

Returns true indicating that this is an ArchBaseCoreObject instance.

Inherited From:

readonly isFlowManagedVariable :boolean

Returns whether or not this variable is managed by the flow, i.e., not directly user creatable. These are automatically created based on other flow configuration.

Inherited From:

readonly isFlowVariable :boolean

Returns whether or not this variable is a flow variable.

Inherited From:

isInput :boolean

Whether or not this variable is an input variable. Remember that the ability to be an input variable depends on whether the variable is a flow, state or task variable and what type of flow it is in. You can use the ArchBaseVariable#settings property to get at a settings object and access the ArchVariableSettings#canSetIsInput to know whether or not it is valid to configure this property. Remember that if a variable is secure that it cannot be used as a flow input.

Inherited From:

isOutput :boolean

Whether or not this variable is an output variable. Remember that the ability to be an output variable depends on whether the variable is a flow, state or task variable and what type of flow it is in. You can use the ArchBaseVariable#settings property to get at a settings object and access the ArchVariableSettings#canSetIsOutput to know whether or not it is valid to configure this property. Remember that if a variable is secure that it cannot be used as a flow output.

Inherited From:

readonly isReadOnly :boolean

Returns whether or not this variable is read only at flow runtime. Read only in this context means that thevariable cannot have a value assigned to it by the flow at runtime. Examples include assigning a value to it using an Update Data action or binding the variable to an output of a Call DataAction. Please note that some variables that return true for this property do allow for assignment of an initial value at flow startup which can be checked by accessing the canAssignInitialValue property.

Inherited From:
See:

isSecure :boolean

Whether or not this variable is secure.

Inherited From:

readonly isStateVariable :boolean

Returns whether or not this variable is a state variable.

Inherited From:

readonly isSystemVariable :boolean

Returns whether or not this variable is a system variable. System variables provide information about things the system tracks automatically, such as the caller’s phone number, or the contact list associated with an outbound flow. Examples of a system variable is "Flow.Version" or "System.MaxInt".

Inherited From:

readonly isTaskVariable :boolean

Returns whether or not this variable is a task variable.

Inherited From:

readonly isUnavailable :boolean

Returns whether or not the variable is available for use. Sometimes variables are feature toggled off and are not available for use in a flow.

Inherited From:

readonly logStr :string

A string suitable for logging that contains information about this variable.

Inherited From:

readonly logStrTypeOnly :string

This is a string suitable for logging information about this object where it's just the object's type. This is normally used when logging errors that occur in constructor parameter checking because the scripting object isn't set up and the normal logging str contents wouldn't be set up.

Inherited From:

name :string

The name of the variable

Inherited From:

readonly parentFlow :ArchBaseFlow

Returns the parent flow for this variable.

Inherited From:

readonly scope :string

Returns the scope of the variable. The string values in ArchEnums#VARIABLE_SCOPES lists valid values. The scope is the prefix you will see on variable names.

Inherited From:

readonly settings :ArchVariableSettings

Returns the settings associated with this variable which provides meta data about this variable like whether it can be configured as an input or output.

Inherited From:

readonly type :string

The core type for this variable

Inherited From:

Methods

isFilterMatch(archFilterObject) → {boolean}

Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.

Parameters:
Name Type Description
archFilterObject ArchFilterObject

the object filter to use to determine if it's a match.

Returns:
boolean
Inherited From:

logError(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true.

Parameters:
Name Type Description
errorStr string

the error string to log.

Inherited From:

logErrorAndThrow(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true and then throws the string in the errorStr parameter.

Parameters:
Name Type Description
errorStr string

the error string to log. This should be a non-blank string.

Throws:
  • Throws the submitted error string.
Inherited From:

logNote(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotes is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logNoteVerbose(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotesVerbose is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logWarning(warningStr)

Logs a warning to the logging service with a log header from this object's logStr property value when ArchLogging#logWarnings is true.

Parameters:
Name Type Description
warningStr string

the warning string to log. This should be a non-blank string.

Inherited From:

rename(newName)

Renames the variable to a new name.

Parameters:
Name Type Description
newName string

the new name to assign to the variable. This should be just the new variable name with no scope prefix like Flow., Task. or State. Variable names need to be at least one character long and start with a letter. Subsequent characters must either be a letter, underscore or digit.

Inherited From:

setInitialValueEmptyCollection()

Sets the initial value of the singleton variable to an empty collection. Note: This is a wrapper around calling accessing the initialValue property and calling setNoValue() on it.

Inherited From:

traverse(callbackFunction, traverseFilteropt) → {number}

This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the ArchBaseObject#isFilterMatch method with a filter and call the supplied callback function if isMatch returns true. The callback will be passed an ArchTraverseInfo with details about the match such as the match object itself along with current contextual information such as the object hierarchy for the match object relative to the object on which this traverse call is being made.

The traverse filter is one which you can create by calling ArchFactoryFilters#createFilterObject and then add desired clauses or clause containers to it. If not specified, this function will use a default filter.

Here is an example that does a simple flow traversal using the default filter and logs information about objects in the callback from the traverse object that's passed back:

archInboundCallFlow.traverse(function(traverseInfo) {
   archLogging.logNote('  Object     : ' + traverseInfo.matchObject.logStr);
   archLogging.logNote('    Hierarchy: ' + traverseInfo.context.hierarchyStr);
});

This might be enough for most uses and you can check various aspects about the object in the callback such as "is this an Architect action?" by seeing if traverseInfo.matchObject.isArchBaseAction is true. You can specify a filter for the traversal code to use as well and only have it call your callback when the object's ArchBaseCoreObject#isFilterMatch method returns true for the filter. Here's an example that creates a filter for callbacks on any type of transfer action, any decision action or objects whose name property case insensitively matches the word 'foo'. While this could all be done with one property callback clause the example will use multiple clauses for the sake of simplicity:

const myTraverseFilter = filterFactory.createFilterObject(archEnums.FILTER_CONTAINER_OPERATORS.or);
myTraverseFilter.addClausePropertyValueEquals('isArchBaseActionTransfer', true);
myTraverseFilter.addClausePropertyValueEquals('isArchActionDecision',     true);
myTraverseFilter.addClausePropertyCallback('name', function(propValue, archContainingObject, propName) {
      // We fully spelled out the function signature above but archContainingObject and propName are
      // not needed in this case.  The archContainingObject is the object that contains the
      // property and propName is the property name itself.  We pass in propName because the same
      // function could be used for multiple property callback clauses.
      // Remember to return a boolean true, false or undefined from ths callback.  :)
      return propValue && propValue.toLowerCase() === 'foo';
});
archTask.traverse(function(traverseContext) {
   // You will only be called back here for ArchBaseCoreObject instances that
   // have the isArchBaseActionTransfer or isArchActionDecision property values equal to true.
}, myTraverseFilter);

If you supply a filter with no clauses, this tells the traverse method to call the supplied callback function for every ArchBaseCoreObject it traverses.

If you want traversal itself to stop after a callback, simply return boolean false from the callback function you supply to the traverse call.

The traverse method does not process deprecated property names such as orgId, orgName or languageSettings. Additionally it does not traverse in to properties that would "jump out" of the current traversal. An example of this would be if the code was traversing an ArchActionJumpToMenu action that it would not start traversing in to the menu that it jumps to. Another example would be a ArchActionChangeState action where it would not traverse in to the target state of the action. This also means traversal does not traverse in to the ArchBaseValue#flowLevelDefault property.

And lastly, as Scripting evolves over time with new versions, you can expect to get callbacks for new object types such as new actions or new properties on objects. As such, it's important not to assume any particular order in callbacks to keep code most compatible with traversal callbacks. Or if you use inequality checks in filter clauses remember that new "stuff" may satisfy an inequality check which may or may not be anticipated in your logic.

Note: This traverse method is a helper method and is very handy for iterating over Architect Scripting objects and their properties in a generic fashion with filtering capabilities. Obviously you can write your own custom traversal code if this implementation doesn't cut it for some reason. :)

This function returns the number of times it called the callback function.

Parameters:
Name Type Attributes Default Description
callbackFunction callbackTraverseInfo

the callback function to call for objects that match the traverse filter.

traverseFilter ArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefault

the filter to use when performing the traversal to determine which ArchBaseCoreObject instances you wish to be called back for. If no filter is specified, this function will call ArchFactoryFilters#createFilterTraverseDefault and use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.

Returns:
number
Inherited From: