下面是瀑布方法,将在第一步中显示英雄卡。在第二步中,它将接收该值,并根据选择内容开始一个对话框。但是,在团队中进行测试时,我面临一个问题。请找到以下详细信息
代码:
async serviceRequestTypes(stepContext) {
const srTypes = stepContext.options;
console.log('INSIDE SR TYPES');
const serviceRequestCard = CardFactory.heroCard('Service Requests', 'Please choose the belwo options to create the appropriate service Requests',
CardFactory.images(['https://www.usnews.com/dims4/USNEWS/65f1856/2147483647/thumbnail/970x647/quality/85/?url=http%3A%2F%2Fcom-usnews-beam-media.s3.amazonaws.com%2Fbe%2Fdd%2F8f25b4174b6398285139452fb7d5%2F190313-collegeapplication-stock.jpg']),
CardFactory.actions([
{
type: 'messageBack',
title: 'Create Generic Service Request',
value: 'Create Generic Service Request'
},
{
type: 'messageBack',
title: 'Create Application Service Request',
value: 'Create Application Service Request'
},
{
type: 'messageBack',
title: 'Create Virtual Desktop Service Request',
value: 'Create Virtual Desktop Service Request'
}
])
);
await stepContext.context.sendActivity({ attachments: [serviceRequestCard], attachmentLayout: AttachmentLayoutTypes.carousel });
return { status: DialogTurnStatus.waiting };
}
}
async classifySRDialog(stepContext) {
console.log('INSIDE CLASSIFY SR DIALOG');
**console.log(stepContext.context.activity.value);
stepContext.values.classifiedSR = stepContext.context.activity.value;**
console.log(stepContext.values.classifiedSR);
if (stepContext.values.classifiedSR === 'Create Generic Service Request') {
return await stepContext.beginDialog('createGenericSRDialog');
} else if (stepContext.values.classifiedSR === 'Create Application Service Request') {
console.log('Inside Application SR');
return await stepContext.beginDialog('createApplicationDialog');
} else if (stepContext.values.classifiedSR === 'Create Virtual Desktop Service Request') {
return await stepContext.beginDialog('createVDIDialog');
} else {
}
}
}
在第二种瀑布方法中,我需要
stepContext.values.classifiedSR = stepContext.context.activity.value;
这在bot模拟器和webchat中绝对可以正常工作。但是,当使用Microsoft团队测试相同功能时。
stepContext.context.activity.value以{}对象的形式出现。可以请任何帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句