new ArchDefinitionFlow(coreFlowDefinition)
The Architect Scripting class that supplies flow object definition meta data. For example, you can ask instances of this class if a flow type is available for the organization for the currently connected Architect Scripting session. 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 |
---|---|---|
coreFlowDefinition |
FlowDefinition | ( Internal ) an Architect core flow definition. |
Extends
Members
-
static, readonly canSuppressRecording :boolean
-
Returns whether the flow can suppress voice recording or not
-
readonly availableActions :Array.<ArchBaseAction>
-
Returns an array of action classes that are available for this flow type. Remember that some action types like
ArchActionTask
is an action that is only created as the action within anArchMenuTask
menu so do not make the assumption that every action returned here is directly creatable as a free standing action. -
readonly availableDataTypes :Array.<ArchDataType>
-
Returns an array of data type classes that are available for this flow type.
-
readonly availableLanguages :Array.<ArchLanguage>
-
Returns an array of ArchLanguage instances that are valid for use as a supported language for this flow type. If the flow type does not support languages, nothing is returned.
-
readonly availableMenus :Array.<ArchBaseMenu>
-
Returns an array of menu classes that are available for this flow type.
-
readonly availablePromptMediaTypes :Array.<string>
-
Returns an array of prompt media type string values that are available for this flow type.
ArchEnums#PROMPT_MEDIA_TYPES
list valid values that can be returned in the array. If no prompt media types are available for a flow type because the flow doesn't support prompts, an empty array is returned. Remember too that at the definition level for a common module we'll report that all prompt media types are available minus text which is currently reserved but until you have consuming flow types defined on a common module that's when it has context to know if specific prompt media types are available. -
readonly canCreateFromDefinition :boolean
-
Returns whether or not flow instances can be created in memory using create methods from
ArchFactoryFlows
such asArchFactoryFlows#createFlowFromDefinitionAsync
orArchFactoryFlows#createFlowInboundCallAsync
. Even though this property may return true, using operations such asArchBaseFlow#saveAsync
orArchBaseFlow#createAsync
may still fail if the flow definition does not support being created within the cloud. TheArchDefinitionFlow#isCreatable
property will return whether a flow type is creatable in the cloud.- See:
-
- ArchFactoryFlows.createFlowFromDefinitionAsync
-
readonly displayTypeName :string
-
Returns the display type name string 'ArchDefinitionFlow'.
-
readonly fileExtension :string
-
Returns the file extension for this flow type that's used when exporting a flow of this type to an
Architect format
export file. -
readonly isArchBaseCoreObject :boolean
-
Returns true indicating that this is an ArchBaseCoreObject instance.
- Inherited From:
-
readonly isArchBaseDefinition :boolean
-
Returns true indicating that this is an ArchBaseDefinition instance.
- Inherited From:
-
readonly isArchDefinitionFlow :boolean
-
Returns true indicating that this is an ArchDefinitionFlow instance.
-
readonly isAvailable :boolean
-
Returns whether or not the flow type is available for use.
-
readonly isCommonModuleCompatibleFlowType :boolean
-
Returns a boolean indicating whether or not this flow type can be used as a compatible flow type for the
compatible flow types
configured on acommon module flow
. -
readonly isCreatable :boolean
-
Returns a boolean indicating whether or not new instances of this flow type can be created in the cloud. You can still use
ArchFactoryFlows
to create flows in memory and when accessing the isCreated property, it will return false. These flows will not be created in the cloud until calling other operations such asArchBaseFlow#saveAsync
orArchBaseFlow#publishAsync
. Accessing this property. -
readonly label :string
-
Returns the display label for this flow type such as 'Inbound Call Flow'.
-
readonly languagesSupportDefaultLanguage :boolean
-
If a flow type
supports supported languages
, this returns whether or not a default language can be set. Otherwise, false. -
readonly languagesSupportDefaultLanguageSkill :boolean
-
If a flow type
supports supported languages
, this returns whether or not individual supported languages have a default language skill setting available. Otherwise, false. -
readonly languagesSupportSpeechToText :boolean
-
If a flow type
supports supported languages
, this returns whether or not individual supported languages can support Speech To Text settings at runtime. Otherwise, false. -
readonly languagesSupportTtsAndAsr :boolean
-
If a flow type
supports supported languages
, this returns whether or not individual supported languages have text to speech and speech recognition settings available. Otherwise, false. -
readonly languagesSupportTtsAndAsrRuntime :boolean
-
If a flow type
supports supported languages
, this returns whether or not individual supported languages can support TTS or ASR at runtime. Otherwise, false. -
readonly logStr :string
-
A string suitable for logging that contains information about this definition.
- 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:
-
readonly startUpObjectCanBeMenu :boolean
-
Returns whether or not an
ArchMenu
instance can be the startup object for the flow type. -
readonly startUpObjectCanBeState :boolean
-
Returns whether or not an
ArchState
instance can be the startup object for the flow type. -
readonly startUpObjectCanBeTask :boolean
-
Returns whether or not an
ArchTask
instance can be the startup object for the flow type. Remember, whileArchFlowInQueueCall
call flows do not support reusable tasks, the startup object is a repeating task so this will return true for an in-queue call flow definition. -
readonly supportsAudio :boolean
-
Returns whether or not audio is supported for this flow type.
-
readonly supportsDefaultLanguage :boolean
-
Returns whether or not this flow type supports default languages.
-
readonly supportsFlowCreationData :boolean
-
Returns whether or not flow creation supports passing in creation data.
-
readonly supportsGrammars :boolean
-
Returns whether this flow type supports Grammars.
-
readonly supportsMenusReusable :boolean
-
Returns whether or not this flow type supports reusable menus.
-
readonly supportsMoreThanOneSupportedLanguage :boolean
-
Returns whether this flow type supports the ability to add more than one supported language.
-
readonly supportsMultilingualKnowledge :boolean
-
Returns whether or not this flow type supports multilingual knowledge.
-
readonly supportsMultipleStates :boolean
-
Returns whether or not this flow type supports multiple states.
-
readonly supportsNaturalLanguageUnderstanding :boolean
-
Returns whether this flow type supports natural language understanding configuration.
-
readonly supportsNaturalLanguageUnderstandingIntents :boolean
-
Returns whether this flow type supports natural language understanding intents.
-
readonly supportsPeriodicState :boolean
-
Returns whether or not this flow type has a periodic state. The
periodic state
is a state available innon-call in-queue flows
. -
readonly supportsSecureVariables :boolean
-
Returns whether or not this flow type supports secure variables.
-
readonly supportsStates :boolean
-
Returns whether or not this flow type supports states.
-
readonly supportsSupportedLanguages :boolean
-
Returns whether or not this flow type supports supported languages.
-
readonly supportsTasksReusable :boolean
-
Returns whether or not this flow type supports reusable tasks.
-
readonly supportsVirtualAgent :boolean
-
Returns whether this flow type supports Virtual Agents.
-
readonly type :string
-
The flow type string for this flow definition. It will be a string value from
ArchEnums#FLOW_TYPES
which lists valid flow type strings.
Methods
-
getSupportsKnowledge(archLanguageopt) → {boolean}
-
Returns whether or not the flow type for a given language supports knowledge functionality such as knowledge bases. If you do not pass in a specific language to check, this function will check the flow type in general but remember that it's only specific languages that will support knowledge functionality within a given flow type so you'd need to check a language specifically to see if it's supported in a given flow instance. And obviously, if a flow doesn't support supported languages then this function returns false.
Parameters:
Name Type Attributes Description archLanguage
ArchLanguage <optional>
the language to check to see if knowledge functionality is supported. If no language is specified, this will perform the check against the flow type itself as an overall check to indicate if one or more supported languages support knowledge.
Returns:
boolean -
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 whenArchLogging#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 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.
- Inherited From:
-
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.
- Inherited From:
-
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.
- Inherited From:
-
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.
- 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 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- Inherited From: