Lucas1 | 2022-01-17 16:02:50 UTC | #1
The latest version of Archy (2.1.3) fails when trying to re-publish a Bot flow that has an empty array for the intents (which is the value of the property when exported from Architect). Below is how to reproduce this error:
- Publish the Bot Flow: bot-flow-empty-intents.yml|attachment (3.4 KB)
- Publish the same Bot Flow a second time and an error will be thrown:
RACE:[architect.validation] Unhandled exception caught!
ailure during validate
pdating description from 'undefined' to ''.
node:87887) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'filter' of undefined
at /snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:71:850016
at Array.forEach (<anonymous>)
at N.updateIntents (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:71:849904)
at N.<anonymous> (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:71:847099)
at Generator.next (<anonymous>)
at /snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:16:1758
at new Promise (<anonymous>)
at c (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:16:1503)
at N.initializeDesignTime (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:71:846892)
at /snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:2024589
at Function.gt (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:1:10846)
at Y._initializeDesignTime (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:2024553)
at Y._initializeDesignTime (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:366585)
at Y.initializeDesignTime (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:201657)
at S._processManifestResults (/snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:1948650)
at /snapshot/architect-archy/node_modules/purecloud-flow-scripting-api-sdk-javascript/build-scripting/release/scripting.bundle.js:43:1947891
The error appears to originate from the purecloud-flow-scripting-api-sdk-javascript package. When you navigate to where the stack-trace is pointing, you find the code e.intents.filter.
Workaround
After exporting the YAML file for a Bot Flow that has an empty array of intents, replace the intents within settingsNaturalLanguageUnderstanding to:
settingsNaturalLanguageUnderstanding:
nluDomainVersion:
intents:
- utterances:
- segments:
- text: test2
- segments:
- text: test
entityNameReferences: [ ]
name: Example
entities:
- name: TestSlot
type: "builtin:number"
entityTypes: []
language: en
Publishing the flow multiple times now works.
Nicola_Burns | 2022-01-17 16:35:32 UTC | #2
Hello!
I am one of the Product Managers for Bot Flows.
A minimum number of intents use to be a requirement, however we recently removed this when we released "global slots", i.e. the ability to create a bot with slots only, for example, ask ID number, do lookup then transfer to the right agent. Looks like this change hasn't made it's way to Archy yet.
One of the team will look into this tomorrow for you.
Nicola
jon.vansteen | 2022-01-18 15:56:23 UTC | #3
Hi Lucas1,
I've identified the issue and will have a fix for this in the next release of Archy. Thanks again for reporting this issue!
Jon
Lucas1 | 2022-01-18 15:56:17 UTC | #4
Thank you both for your prompt responses!
system | 2022-02-17 15:56:26 UTC | #5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 13230