小编bga*_*ara的帖子

亚马逊lex - 机器人可以发起消息吗?

我是amazon lex的新手.我想让机器人发起一个对话而不是用户通过提问来触发启动流程,有没有办法做到这一点?

amazon-web-services amazon-lex

5
推荐指数
1
解决办法
971
查看次数

ruby 脚本 - (NameError) main:Object 的未定义局部变量或方法“null”

我的代码

require "json"
require "erb"

flowvar = $workflowvar
path = 'src/main/resources/'+$workflowvar+'.drl'
rule = ""

File.open(path,"w") do |f|
    f.puts "package com.drools.demo\;"+"\n"+"import org.mule.MessageExchangePattern\;"+"\n"+"import com.drools.demo.cashliquidassets\;"+"\n"+"global org.mule.module.bpm.MessageService mule\;"+"\n"+
    "dialect \"mvel\""+"\n"+"dialect \"java\""+"\n"+"declare cashliquidassets"+"\n"+"@role\(\'event\'\)"+"\n"+"end"+"\n"
    f.close
end

def concateRule(attribute,val)
    if(val==null || val=="") 
            return "";
    end
    if(attribute != null)
            if (attribute == "taxonomy_code" || attribute == "parent_taxonomy_code" || attribute == "report_name")
                return "";
            end
    end

    if val.start_with('<>')
            return attribute+" != "+val[3,val.length].strip
    elsif val.start_with('>')
            return attribute+" > "+val
    elsif val.start_with('<')
            return attribute+" < "+val
    elsif val.include? ","
            return attribute+".contains("+val+"\)" …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails

2
推荐指数
1
解决办法
5375
查看次数