[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1929) In the then part (RHS) of guided rule editor, it is not possible to affect a value with variable name of the when part (LHS) and not possible to call a method in the new created instance
Nicolas Heron (JIRA)
jira-events at lists.jboss.org
Mon Mar 9 16:14:35 EDT 2009
[ https://jira.jboss.org/jira/browse/JBRULES-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12456297#action_12456297 ]
Nicolas Heron commented on JBRULES-1929:
----------------------------------------
It is a little more complex :
it only takes the method with one parameter but there must be at least one field with one setter.
For example :
public class PipoClass {
public void AMethode(String i, String j) {
System.out.println("i = " + i + " j=" + j);
}
public void AMethode2(String i) {
System.out.println("i = " + i);
}
}
this is the example on the second picture.
Now I add two private variables :
package demodrools;
public class PipoClass {
private String a;
private String b;
public String getA() {
return a;
}
public void setA(String a) {
this.a = a;
}
public String getB() {
return b;
}
public void setB(String b) {
this.b = b;
}
public void AMethode(String i, String j) {
System.out.println("i = " + i + " j=" + j);
}
public void AMethode2(String i) {
System.out.println("i = " + i);
}
}
and now I get the "Amethod2" method available. It is fine for me
My question : do you take my patch for the first part of the jira ?
> In the then part (RHS) of guided rule editor, it is not possible to affect a value with variable name of the when part (LHS) and not possible to call a method in the new created instance
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-1929
> URL: https://jira.jboss.org/jira/browse/JBRULES-1929
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-guvnor
> Affects Versions: 5.0.0.M4
> Reporter: Nicolas Heron
> Assignee: Michael Neale
> Attachments: CallMethod.pdf, path1929_1.txt, Picture2.jpeg, PictureCallMethode.jpeg, PictureCallMethode.jpeg, View1.png, View2.png
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> In drl, the rule would look like this :
> when
> p : Person()
> c : Car (owner == p)
> then
> Insurrance i = new Insurrance();
> i.setPerson(p);
> c.addInssurance(i);
> end
> This cannot be done with the guided editor in Guvnor for "i.setPerson(p);"
> and also, il is not possible to call a metthod on a (LHS) defined fact outside the variables set/get methods "c.addInssurance(i);"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list