【问题标题】:MVEL Expression with multiple conditions具有多个条件的 MVEL 表达式
【发布时间】:2014-03-14 15:55:53
【问题描述】:

我正在尝试使 MVEL 表达式正常工作,但我遇到了问题。我很想确定定义为属性的日期是否介于其他两个日期之间。

props['ExistingStartDate'] >= props['current_period_start_date'] && props['ExistingStartDate'] <= props['current_period_end_date']

所以在这种情况下,我的 ExistingStartDate = 3/6/14、current_period_start_date = 3/3/14 和 current_period_end_date = 3/16/14

我希望这是真的。我觉得我的语法一定有问题。任何帮助将不胜感激!

【问题讨论】:

    标签: eclipse mvel


    【解决方案1】:

    为多个条件的每个术语使用括号:

    (props['ExistingStartDate'] >= props['current_period_start_date']) && (props['ExistingStartDate'] <= props['current_period_end_date'])
    

    此外,props 引用的语法可能不正确,具体取决于它是什么类型的 Java 对象。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-09
      • 2012-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-11
      • 1970-01-01
      相关资源
      最近更新 更多