'use strict'; module.exports = { metadata: () => ({ name: 'Greeting', properties: { name: {required: true,type: 'string'}, }, supportedActions: ['ok', 'error'] }), /** * invoke method gets called when the custom component state is executed in the dialog flow * @param {CustomComponentContext} context */ invoke: (context,done) => { const {name} = context.properties(); if(!name){ context.reply("Please give name"); context.transition('error'); }else{ context .reply(`Hello, ${name}`) .reply('how may i help you') .transition('ok'); done(); } } };