Cannot assign a bound variable to a method invocation that uses another bound variable as an argument in rule LHS

Solution Verified - Updated -

Issue

  • Given an object that is inserted into the Knowledge Session, when trying to access its getters that does not require any parameters and bound variables can be created by getting output from of the getter method. For instance:
...
rule "Get SENIOR Employee for Given Employee"

    when
        SalaryUpdate( $employees : employees )

        Employee( $employeeId : id, relationship != Relationship.SENIOR ) from $employees

        // this is what is expected to get, but it does not work
        EmployeeIDManager( $senior : getMappedEmployee( $EmployeeId ) )
    then
         System.out.println( $senior );
end
...
  • In above scenario, there is a method named getMappedEmployee() within the EmployeeIDManager object. This simple scenario is working as expected but it will not work if the method with string parameter is called by passing bound variable.

Environment

  • Red Hat JBoss BRMS 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content