new ArchActionAskForSlot(coreAskForSlotAction)
Parameters:
Name | Type | Description |
---|---|---|
coreAskForSlotAction |
Object | ( Internal ) an Architect core Ask For Slot action. |
Extends
Members
-
static, readonly displayTypeName :string
-
Returns the display type name string 'ArchActionAskForSlot'.
-
readonly _actionTypeId :string
-
Returns the action type identifier string from actionTypes.js
-
readonly askResult :ArchBaseValue
-
The slot variable that will hold the input the user provides for the slot.
-
readonly chooser :ArchValueChooser
-
Specify menu choices to offer the participant and how to present them here. Before making calls with this chooser, make sure to set the slot with the
setSlot
function. A slot must also be configured as a List type. -
readonly confirmationMode :ArchValueString
-
This controls when the bot will confirm the slot value supplied by the participant is correct. If this setting evaluates to "always" at runtime and the participant supplied value is valid then the bot will use the
ArchActionAskForSlot#confirmationQuestion
communication to confirm the value with the participant. The default value for this setting when new instances of this action is the string literal "never". -
readonly confirmationQuestion :ArchValueCommunication
-
Wording the bot will use to confirm the value supplied by the participant is correct. To access the value supplied by the participant in an expression, use the Slot. variable associated with the slot configured on this action. Remember that the
ArchActionAskForSlot#confirmationMode
value determines if this communication will be used for confirmation purposes or not. Additionally remember that if theArchActionAskForSlot#confirmationMode
is set to the string literal 'never' or the expression text "never" that this property cannot be set as it is not writable at that time. -
customizeNoInput :ArchValueBoolean
-
If this property is set to true, the
ArchBaseActionNoInputNoMatch#noInputReprompts
communication collection will be used for No Input prompts. Otherwise, theArchBaseActionNoInputNoMatch#noInput
communication will be used. This property is only available withinArchFlowBot
flows. -
customizeNoMatch :ArchValueBoolean
-
If this property is set to true, the
ArchBaseActionNoInputNoMatch#noMatchReprompts
communication collection will be used for No Match prompts. Otherwise, theArchBaseActionNoInputNoMatch#noMatch
communication will be used. -
readonly customValidation :ArchValueBoolean
-
An optional expression that can be configured to specify custom slot data validation logic on this Ask for Slot action. What you'll do with this boolean setting is provide additional validation logic to apply when validating a value in the slot variable associated with the slot configured on this action. If the custom validation setting returns false or a NOT_SET boolean, this means the value is invalid from a validation perspective. If there is no custom validation logic set ( i.e. the ArchValueBoolean's
ArchBaseValue#isNoValue
property is true ), then there is nothing to process here and it will not fail the value validation at runtime. Remember that custom validation can return to the flow runtime if a value is invalid but there will be other restriction properties that will be involved with validation in addition to this in the future. -
readonly displayTypeNameArchitect :string
-
The Architect action type label
-
readonly grammar :ArchValueGrammar
-
Gets the grammar configured on this ask For slot action.
-
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#settingsMenu
will have a blank identifier along with the settings returned fromArchMenu#settingsSpeechRec
. Note that this is an extremely rare case.- Overrides:
- See:
-
readonly isArchActionAskForSlot :boolean
-
Returns true indicating that this is an ArchActionAskForSlot instance.
-
readonly isArchBaseCoreObject :boolean
-
Returns true indicating that this is an ArchBaseCoreObject instance.
-
readonly isMenuChoiceAction :boolean
-
Returns whether or not this action is the action property for a
menu choice
. For example, theArchMenuDisconnect#actionDisconnect
property on anArchMenuDisconnect
instance. -
readonly isReachable :boolean
-
Returns whether or not this action is reachable at runtime.
- Overrides:
-
readonly isSecure :boolean
-
Returns whether or not this action is secure which means either the action by its very nature is secure or it consumes secure data.
- Overrides:
-
readonly isUnreachable :boolean
-
Returns whether or not this action is unreachable at runtime.
- Overrides:
-
readonly logStr :string
-
A string suitable for logging that contains information about this action. This will contain the action tracking id, name and scripting type name.
- Overrides:
-
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.
- Overrides:
-
name :string
-
The name of the action
- Overrides:
-
noInput :ArchValueString
-
The NoInput text for the action.
- Overrides:
-
noInputReprompts :ArchValueCommunicationCollection
-
The No Input Reprompts collection of communications for the action. In order to use this property,
ArchBaseActionNoInputNoMatch#customizeNoInput
must be set to true. To have no, No Input re-prompting, set this to an empty collection. This property is only available withinArchFlowBot
flows. -
noMatch :ArchValueString
-
The NoMatch text for the action.
- Overrides:
-
noMatchReprompts :ArchValueCommunicationCollection
-
The No Match Reprompts collection of communications for the action. In order to use this property,
ArchBaseActionNoInputNoMatch#customizeNoMatch
must be set to true. To have no, No Match re-prompting, set this to an empty collection. -
readonly outputCount :number
-
Returns the number of outputs on this action. For actions that have a fake success output like what you see on the various transfer actions, that will be included in the count to be consistent with the Architect UI. Attempting to get the output count on a menu choice's action such as such as the
ArchMenuTransferToAcd#actionTransferToAcd
action on anArchMenuTransferToAcd
menu will return 0.- Overrides:
-
readonly outputMaxNoInputs :ArchActionOutput
-
The Max No Inputs output for this action which will be taken at runtime if the Max No Inputs value is exceeded.
-
readonly outputs :Array.<ArchActionOutput>
-
Returns an array of action outputs for this action. Remember that it is possible to have an undefined item in the returned ArchActionOutput array. This is true when the output is "fake". Accessing the outputs on a menu choice's action such as
ArchMenuTransferToAcd#actionTransferToAcd
will return an empty array.- Overrides:
-
readonly parentFlow :ArchBaseFlow
-
Returns the parent flow for this action.
- Overrides:
-
readonly parentMenuChoice :ArchBaseMenuChoice
-
Returns the parent menu choice if this action is the action for a
menu choice
. Otherwise, nothing is returned. -
readonly parentState :ArchState
-
Returns the parent state that contains this action if this action is in a
state
. Otherwise, nothing is returned.- Overrides:
-
readonly parentTask :ArchTask|ArchTaskLoop
-
Returns the parent task that contains this action if this action is in a
task
orlooping task
. Otherwise, nothing is returned.- Overrides:
-
question :ArchValueString
-
The question text for the action.
- Overrides:
-
readonly speechToTextEngineCompleteTimeout :ArchValueDuration
-
Sets the value for the duration of silence after a valid recognition has occurred that determines the caller has finished speaking. If this setting is set to 0, the timer will be disabled. If this setting is set to no value, that tells the bot to use the Genesys default settings.
-
readonly speechToTextEngineConfidenceLevel :ArchValueDecimal
-
When the score of the first n-best entry is less than the value of confidence level, the recognition will return a no-match. If this setting is set to 0, all utterances are accepted. If this setting is set to no value, that tells the bot to use the Genesys default settings.
-
readonly speechToTextEngineId :string
-
Gets the id of the selected grammar-based speech to text engine.
-
readonly speechToTextEngineName :string
-
Gets the name of the selected grammar-based speech to text engine.
-
readonly trackingId :number
-
The integer tracking identifier for this action. This is the numeric identifier is displayed in the Architect user interface.
- Overrides:
-
voiceEndOfInputTimeout :ArchValueDuration
-
The end of input timeout specific to voice input for this action.
Methods
-
getOutputById(output) → {ArchActionOutput}
-
Gets an output by its identifier. If it cannot be found, this method will throw. Normally you won't need to use this method and will use the helper methods available on inheriting classes when accessing pre-defined outputs like success, failure, timeout, etc. etc. Attempting to get an output by id on a menu choice's action such as the
ArchMenuTransferToAcd#actionTransferToAcd
action on anArchMenuTransferToAcd
menu will return nothing.Parameters:
Name Type Description output
string | ArchBranch identifies output you want to obtain. If output is an ArchBranch instance, the
ArchBranch#outputId
value will be used. Otherwise valid string identifier values can be found inArchEnums#OUTPUT_IDS
or can be a guid. Remember that requesting the 'success' output on an action with afake success output
will return nothing.Returns:
ArchActionOutput- Overrides:
-
getOutputByIndex(index) → {ArchActionOutput}
-
Returns the output at the given index. It's important to note that on actions that have a fake success output if you request the output at the index for the fake success, you will get nothing returned because the fake success output isn't something that you should do anything with. Attempting to access an output by index on a menu choice's action such as
ArchMenuTransferToAcd#actionTransferToAcd
will return nothing.Parameters:
Name Type Description index
number the index of the output to retrieve. This value should be a non-negative integer.
Returns:
ArchActionOutput -
getOutputByName(output, wantDynamicOutputopt) → {ArchActionOutput}
-
Gets an output by its identifier. If it cannot be found, this method will throw. Normally you won't need to use this method and will use the helper methods available on inheriting classes when accessing pre-defined outputs like success, failure, timeout, etc. etc. Attempting to get an output by id on a menu choice's action such as the
ArchMenuTransferToAcd#actionTransferToAcd
action on anArchMenuTransferToAcd
menu will return nothing.Parameters:
Name Type Attributes Default Description output
string | ArchBranch identifies output you want to obtain by name. If output is an ArchBranch instance, the
ArchBranch#name
value will be used. Remember that requesting the 'Success' output on an action with afake success output
will return nothing. For non-dynamic outputs, the name should be specified in English.wantDynamicOutput
boolean <optional>
false because it is possible for some actions to have both a non-dynamic output and a dynamic output with the same name, this boolean will let you specify which output you want. An example of this would be the built in Failure output on a call bot action but that bot also has an intent named Failure so the action has two outputs with the same name of 'Failure'. Only one of those would be a dynamic output and that's the output for the Failure intent, not the built-in Failure action output.
Returns:
ArchActionOutput- Overrides:
-
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- Overrides:
-
logError(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStr
property value whenArchLogging#logErrors
is true.Parameters:
Name Type Description errorStr
string the error string to log.
- Overrides:
-
logErrorAndThrow(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStr
property value whenArchLogging#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.
-
logNote(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStr
property value whenArchLogging#logNotes
is true.Parameters:
Name Type Description noteStr
string the note string to log. This should be a non-blank string.
- Overrides:
-
logNoteVerbose(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStr
property value whenArchLogging#logNotesVerbose
is true.Parameters:
Name Type Description noteStr
string the note string to log. This should be a non-blank string.
- Overrides:
-
logWarning(warningStr)
-
Logs a warning to the logging service with a log header from this object's
logStr
property value whenArchLogging#logWarnings
is true.Parameters:
Name Type Description warningStr
string the warning string to log. This should be a non-blank string.
- Overrides:
-
setLiteralConfirmationMode(newConfirmationMode)
-
Helper method to set the confirmation mode to a literal string value. This method will check that the string value passed in the newConfirmationMode parameter is a valid confirmation mode.
Parameters:
Name Type Description newConfirmationMode
string the confirmation mode to set. The string values in
ArchEnums#BOT_CONFIRMATION_MODES
lists valid confirmation mode values. -
setSlot(slotName, doNotCreateChoicesopt)
-
Sets the selected slot on the Ask for Slot action. This will also update the
ArchActionAskForSlot#askResult
property to reference the slot variable that matches the slot provided to this function.Parameters:
Name Type Attributes Default Description slotName
string the slot name to set. This will be handled in a case-sensitive manner.
doNotCreateChoices
boolean <optional>
false whether to create the choices for the
chooser
when setting the slot value. Setting this to true will not create the choices, false will create them, and if nothing is passed in the choices will also be created. A typical use case for not creating thechoices
is if these are going to be manually created to match the values found on the slot's slot type. -
setSpeechToTextEngineByIdAsync(engineId, callbackFunctionopt) → {Promise.<ArchActionAskForSlot>}
-
Sets the speech to text engine with the specified id for this ask for slot action.
Parameters:
Name Type Attributes Description engineId
string the identifier of the speech to text engine to set. Only grammar based speech to text engines are allowed.
callbackFunction
callbackArchActionAskForSlot <optional>
a function to call if the speech to text engine is successfully looked up and configured on this ask for slot action instance. The first parameter passed to the callback function will be this ask for slot action instance.
Returns:
Promise.<ArchActionAskForSlot> -
setSpeechToTextEngineByNameAsync(engineName, callbackFunctionopt) → {Promise.<ArchActionAskForSlot>}
-
Sets the speech to text engine with the specified name for this supported language setting.
Parameters:
Name Type Attributes Description engineName
string the name of the speech to text engine to set. Only grammar based speech to text engines are allowed. Speech to text engine name lookups are performed case insensitively.
callbackFunction
callbackArchActionAskForSlot <optional>
a function to call if the speech to text engine is successfully looked up and configured on this ask for slot action instance. The first parameter passed to the callback function will be this ask for slot action instance.
Returns:
Promise.<ArchActionAskForSlot> -
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 anArchTraverseInfo
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 callingArchFactoryFilters#createFilterObject
and 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#isFilterMatch
method returns true for the filter. Here's an example that creates a filter for callbacks onany type of transfer action
, anydecision 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
orlanguageSettings
. 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 anArchActionJumpToMenu
action that it would not start traversing in to the menu that it jumps to. Another example would be aArchActionChangeState
action where it would not traverse in to the target state of the action. This also means traversal does not traverse in to theArchBaseValue#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 callArchFactoryFilters#createFilterTraverseDefault
and use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.Returns:
number- Overrides: