new abstract ArchBaseMenuChoice(coreMenuChoiceViewModel)
Parameters:
| Name | Type | Description |
|---|---|---|
coreMenuChoiceViewModel |
Object | ( Internal ) an Architect core menu choice view model. |
Extends
Members
-
readonly displayTypeName :string
-
Implements override support for the display type name string for this Architect Scripting object.
- Overrides:
-
dtmf :string
-
The dual tone multi frequency (dtmf) property on the menu choice. When setting, valid values are integers 0 through 9, strings '0' through '9', '*' or '#'. The getter will return the string value.
-
dtmfIsGlobal :boolean
-
Whether or not the specified dtmf on this menu choice is global to the flow.
-
readonly id :string
-
The identifier string for this object.
- Overrides:
-
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#settingsMenuwill have a blank identifier along with the settings returned fromArchMenu#settingsSpeechRec. Note that this is an extremely rare case.- Overrides:
- See:
-
readonly isArchBaseCoreObject :boolean
-
Returns true indicating that this is an ArchBaseCoreObject instance.
- Overrides:
-
isArchBaseMenu :boolean
-
Returns true indicating that this is an ArchBaseMenu which means it is either a top level menu, reusable menu or menu choice.
- Overrides:
-
readonly isArchBaseMenuChoice :boolean
-
Returns true indicating that this is an ArchBaseMenuChoice which means it is a menu choice and not a top level menu.
-
readonly logStr :string
-
Returns a string suitable for logging that describes the menu choice
-
name :string
-
The name of the menu choice
-
readonly parentFlow :ArchBaseFlow
-
Returns the parent flow for this ArchBaseMenu instance.
- Overrides:
-
readonly speechRecTermContainers :ArchSpeechRecTermContainers
-
The speech rec term containers object that contains individual speech rec term container instances on a per language basis.
-
speechRecTermsAreGlobal :boolean
-
Whether or not the speech rec terms in the speech rec containers for this menu choice are global to the flow.
-
readonly trackingId :number
-
The integer tracking identifier for this menu choice. This is the numeric identifier is displayed in the Architect user interface.
- Overrides:
- ArchBaseMenu#trackingId
Methods
-
addSpeechRecTerm(archLanguage, newTerm) → {boolean}
-
Adds a new speech rec term to a container for a specified language. This is a helper method that calls
getSpeechRecTermContainerand then on the returned container it then callsaddTermand returns the boolean result from that add call.Parameters:
Name Type Description archLanguageArchLanguage the language of the speech rec term container you wish to get. This must be a supported language on the flow.
newTermstring the new speech rec term to add to the language specific speech rec term container.
Returns:
boolean -- returns true if the term was added, otherwise false.
-
getSpeechRecTermContainer(archLanguage) → {ArchSpeechRecTermContainer}
-
Gets the speech rec term container for the specified language. This is a helper method that calls this.speechRecTermContainers.getContainer with the specified language.
Parameters:
Name Type Description archLanguageArchLanguage the language of the speech rec term container you wish to get. This must be a supported language on the flow.
Returns:
ArchSpeechRecTermContainer -
traverse(callbackFunction, traverseFilteropt) → {number}
-
This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the
ArchBaseObject#isFilterMatchmethod with a filter and call the supplied callback function if isMatch returns true. The callback will be passed anArchTraverseInfowith 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
filteris one which you can create by callingArchFactoryFilters#createFilterObjectand then add desired clauses or clause containers to it. If not specified, this function will use adefault 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#isFilterMatchmethod returns true for the filter. Here's an example that creates a filter for callbacks onany type of transfer action, anydecision actionor 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
ArchBaseCoreObjectit 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,orgNameorlanguageSettings. 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 anArchActionJumpToMenuaction that it would not start traversing in to the menu that it jumps to. Another example would be aArchActionChangeStateaction where it would not traverse in to the target state of the action. This also means traversal does not traverse in to theArchBaseValue#flowLevelDefaultproperty.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 callbackFunctioncallbackTraverseInfo the callback function to call for objects that match the traverse filter.
traverseFilterArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefaultthe filter to use when performing the traversal to determine which
ArchBaseCoreObjectinstances you wish to be called back for. If no filter is specified, this function will callArchFactoryFilters#createFilterTraverseDefaultand use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.Returns:
number- Overrides: