如何在骆驼简单的XML DSL中使用运算符?

时间:2020-01-24 16:43:21

标签: apache-camel spring-camel camel-blueprint

我正在使用骆驼2.17.0。我需要在blueprint.xml文件中以简单语言使用in运算符,如下所示

library(shiny) library(shinymanager) credentials <- data.frame( user = c("a", "b"), password = c("a", "b"), stringsAsFactors = FALSE ) ui <- fluidPage( verbatimTextOutput("auth_output") ) ui <- secure_app(ui) lang <- shinymanager:::language$new() lang$add( "Please authenticate" = "Test Page", "Username:" = "Username:", "Password:" = "Password:", "Login" = "Sign in" ) server <- function(input, output, session) { res_auth <- secure_server( check_credentials = check_credentials(credentials) ) output$auth_output <- renderPrint({ reactiveValuesToList(res_auth) }) session$onSessionEnded(function() { print("onSessionEnded Run!!!") }) } shinyApp(ui, server)

但是,它不起作用,并引发以下异常:

org.apache.camel.CamelExecutionException:在交易所执行期间发生了异常:Exchange [ID-A5668784-61983-1579873128661-9-6] 在org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1706) 在org.apache.camel.builder.SimpleBuilder.createPredicate(SimpleBuilder.java:104) 在org.apache.camel.builder.SimpleBuilder.matches(SimpleBuilder.java:83)

顺便说一句,我很长时间以来一直在使用选择/条件。然后我尝试使用||和或运算符如下:

<choice id="_choice3">
                        <when id="_when3">
                            <simple>${header.STATUS} in 'Draft,Review'</simple>
                            ......

在所有情况下,它都会引发相同的异常。请帮忙。预先感谢

1 个答案:

答案 0 :(得分:0)

最后,您可能会丢失那些多余的“()”(方括号)。 你可以尝试这样的东西

<simple>${header.STATUS} contains'Draft' or ${header.STATUS} contains 'Review'</simple>

我假定您正在标题中设置“草稿(字符串)”值。

我希望它会有所帮助。 :)