Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Rule Executor: java.lang.RuntimeException: Failed to compile DRL

  1. #1

    Default Rule Executor: java.lang.RuntimeException: Failed to compile DRL

    Hello, I'm currently 1st time working with the Rule Executor Step and Drools. Unfortunately, most of my experiments end in the mentioned error. Here my rules definition: (With variants)

    Code:
    package org.pentaho.di.trans.steps.rules
     
    import org.pentaho.di.trans.steps.rules.Rules.Column;
    
    rule "Node"
        dialect "mvel"
        when
    //        Column( name == "prefix", payload == " |--   " ) 
            Column( name == "prefix", $prefix : payload)
            eval ( $prefix  == " |--   " )
    //        eval ( $prefix matches ".*|--   $")
    //        eval ( $prefix str[endsWith] "|--   ")
    //        Column( name == "prefix", payload str[endsWith] "|--   ")
    //        eval($prefix.length() == 0 OR $prefix.substring($prefix.length()-6) == "|--   ")
    //        Column( name == "prefix", payload matches ".*--   $")
        then
            Column col = new Column();
            col.name = "nodetype"
            col.type = String.class
            col.payload = "NODE"        
    
            insert(col)
    end
    
    rule "Leaf"
        dialect "mvel"
        when
            Column( name == "prefix", payload != " |--   ")
        then
            Column col = new Column();
            col.name = "nodetype"
            col.type = String.class
            col.payload = "LEAF"        
    
            insert(col)
    end
    Every time I use another condition than payload == " |-- " (direct or with $prefix and eval), Rule Executor tells me that it failed to compile the DRL (see below). Any hints what I'm doing wrong are welcome.

    Code:
    2015/09/16 14:10:19 - Rule Executor.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected error
    2015/09/16 14:10:19 - Rule Executor.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : java.lang.RuntimeException: Failed to compile DRL
    2015/09/16 14:10:19 - Rule Executor.0 -     at org.pentaho.di.trans.steps.rules.RulesExecutorData.initializeRules(RulesExecutorData.java:111)
    2015/09/16 14:10:19 - Rule Executor.0 -     at org.pentaho.di.trans.steps.rules.RulesExecutor.runtimeInit(RulesExecutor.java:78)
    2015/09/16 14:10:19 - Rule Executor.0 -     at org.pentaho.di.trans.steps.rules.RulesExecutor.processRow(RulesExecutor.java:104)
    2015/09/16 14:10:19 - Rule Executor.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
    2015/09/16 14:10:19 - Rule Executor.0 -     at java.lang.Thread.run(Unknown Source)
    Thanks in advance,
    Jo

  2. #2

    Default

    Hi,
    In Rules Executor,
    I have the same problem, I would like to use Regex expressions with the «matches» instruction in the LHS.
    Is there anyone who did that with success?
    I work with PDI CE.

    Thanks,
    PA

    The problem is resolved with version 7.0
    Last edited by PARobitaille; 12-13-2016 at 05:15 PM. Reason: resolved

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.