Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Unable to fire rules using Rest-API

    Posted on

    Am facing an issue while am calling the request form REST-API and am unable to fire the rules.
    No output is shown.
    package com.bnsf.cavalidationbusinessrules;

    import com.bnsf.cavalidationbusinessrules.CACode;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;

    //from row number: 1
    rule "Row 1 Code 09"
    ruleflow-group "Code09Validation"
    no-loop true
    dialect "mvel"
    when
    $caValidCode : CACode( caCode == "09" , occupation in ( "01", "02", "03", "04", "05" ), rwDivision in ( "20", "21", "22", "23" ), formerRoad == "A" , ticketType == 1 , hoursOnDuty 8.0 )
    then
    modify( $caValidCode ) {
    setCaPayableStatus( true ),
    setCaRate( "0029" ),
    setMethodCode( "CA0901" )
    }
    end

    //from row number: 2
    rule "Row 2 Code 09"
    ruleflow-group "Code09Validation"
    no-loop true
    dialect "mvel"
    when
    $caValidCode : CACode( caCode == "09" , occupation in ( "01", "02", "03", "04", "05" ), rwDivision in ( "10", "11", "12", "14", "15" ), formerRoad == "A" , ticketType == 1 , trainType != "L " , trainType != "R" , hoursOnDuty 8.0 )
    then
    modify( $caValidCode ) {
    setCaPayableStatus( true ),
    setCaRate( "0029" ),
    setMethodCode( "CA0902" )
    }
    end

    //from row number: 3
    rule "Row 3 Code 09"
    ruleflow-group "Code09Validation"
    no-loop true
    dialect "mvel"
    when
    $caValidCode : CACode( caCode == "09" , occupation in ( "01", "02", "03", "04", "05" ), rwDivision in ( "30", "31", "32" ), formerRoad == "A" , ticketType == 1 , onDutyStation == 15000 , offDutyStation == 17400 , hoursOnDuty 8.0 )
    then
    modify( $caValidCode ) {
    setCaPayableStatus( true ),
    setCaRate( "0029" ),
    setMethodCode( "CA7203" )
    }
    end

    //from row number: 4
    rule "Row 4 Code 09"
    ruleflow-group "Code09Validation"
    no-loop true
    dialect "mvel"
    when
    $caValidCode : CACode( caCode == "09" , occupation in ( "01", "02", "03", "04", "05" ), rwDivision in ( "30", "31", "32" ), formerRoad == "A" , ticketType == 1 , onDutyStation == 23000 , offDutyStation == 19000 , hoursOnDuty 8.0 )
    then
    modify( $caValidCode ) {
    setCaPayableStatus( true ),
    setCaRate( "0029" ),
    setMethodCode( "CA7203" )
    }
    end

    //from row number: 5
    rule "Row 5 Code 09"
    ruleflow-group "Code09Validation"
    no-loop true
    dialect "mvel"
    when
    $caValidCode : CACode( caCode == "09" , occupation in ( "01", "02", "03", "04", "05" ), rwDivision in ( "30", "31", "32" ), formerRoad == "A" , ticketType == 1 , onDutyStation == 20500 , offDutyStation == 19800 , hoursOnDuty 8.0 )
    then
    modify( $caValidCode ) {
    setCaPayableStatus( true ),
    setCaRate( "0029" ),
    setMethodCode( "CA7203" )
    }
    end

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat