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 (3.4 KB)
- Publish the same Bot Flow a second time and an error will be thrown:
TRACE:[architect.validation] Unhandled exception caught!
Failure during validate
updating 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.