Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1066626 - Data model oracle ignores fields, when the fields are objects from another package
Summary: Data model oracle ignores fields, when the fields are objects from another pa...
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: DR4
: 6.1.0
Assignee: Toni Rikkola
QA Contact: Jiri Locker
URL:
Whiteboard:
Depends On:
Blocks: 1042798
TreeView+ depends on / blocked
 
Reported: 2014-02-18 18:15 UTC by Toni Rikkola
Modified: 2014-12-09 18:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
Screenshot with modification disabled (deleted)
2014-03-17 13:06 UTC, Jiri Locker
no flags Details

Description Toni Rikkola 2014-02-18 18:15:05 UTC
Description of problem:
Affects "call method from x", "set field in x" and the expression editor. x is a field variable for example Pattern( x : field )


Steps to Reproduce:
1. Make a declared fact type A into org.test1 package. Give it a field "name" of type String.
2. Make a declared fact type B into org.test2 package. Give it a field "a" of the type org.test1.A.
3. Make a guided rule and add pattern B. 
4. Add an expression into B. Start with the field "a". Now you should be able to add a.name, but "name" does not show up.

1 & 2 & 4 as above.
5. Add field "a" into Pattern B and give bind the field to a variable "var"
6, In RHS try to call a function from "var" or use a field for "var". You get a read only line that can not be edited further.

Comment 1 Toni Rikkola 2014-02-18 18:17:18 UTC
The workaround is to import the type of the missing field.

The problem cause for the problem is that the data model oracle filtering does not pick up fields of the patterns that are used.

Comment 3 Toni Rikkola 2014-02-19 07:30:29 UTC
Should be 1 & 2 & 3, not 4.

> 1 & 2 & 4 as above.
> 5. Add field "a" into Pattern B and give bind the field to a variable "var"
> 6, In RHS try to call a function from "var" or use a field for "var". You
> get a read only line that can not be edited further.

Comment 5 Jiri Locker 2014-03-17 13:06:23 UTC
Created attachment 875490 [details]
Screenshot with modification disabled

Hi Toni, step 4 works. I can call methods on the variable in step 6 but i cannot modify it.

Comment 6 Toni Rikkola 2014-03-19 12:37:28 UTC
Step 6 allows the user to select the function call for var, but if the instructions are followed var is a declared class and has no functions. Meaning the list for functions to call from var is empty.

So I tested with a custom jar. I added a the following into A


    public Integer sum(Integer x, Integer y) {
        return x + y;
    }

If I then add for example a the following into the guided rule: 
Person( a : age )
where age is Integer.

And I call sum(..) from A the method fails to pick the variable up and "Bound Variable" option is not shown for the user.

Comment 7 Toni Rikkola 2014-03-20 11:54:21 UTC
(In reply to Toni Rikkola from comment #0)
> 1 & 2 & 4 as above.
> 5. Add field "a" into Pattern B and give bind the field to a variable "var"
> 6, In RHS try to call a function from "var" or use a field for "var". You
> get a read only line that can not be edited further.

Turns out "var" is a reserved word in MVEL. So when testing this, something else should be used.

Made a ticket for this.
https://bugzilla.redhat.com/show_bug.cgi?id=1078835

Comment 9 Jiri Locker 2014-05-12 16:34:34 UTC
Step 6. still not working completely. On RHS I can call methods on the foreign class but I cannot modify its fields as illustrated by attachment 875490 [details].

On the screenshot, the rule and Test fact exist in org.kie.example.project1, Person (foreign fact) exists in org.kie.example.other.

I can access Person's name on LHS by adding Test.person field and Person.name sub-field or by using expression editor. This covers steps 1 & 2 & 3 & 4 and is not captured on the screenshot.

The screenshot covers steps 1 & 2 & 3 & 5 (successful) & 6 (partial success). Method call works OK, but I cannot modify Person.name due to the disabled UI element.


Note You need to log in before you can comment on or make changes to this bug.