Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-2867

[Guided Rule] You have to reopen rule to load dependent enums

XMLWordPrintable

    • NEW
    • NEW

      Imagine you have data object like

      package com.myspace.new_one_project;
      
      public class Person implements java.io.Serializable {
      
      	static final long serialVersionUID = 1L;
      
      	private java.lang.String name;
      
      	private java.lang.String name2;
      
      	public Person() {
      	}
      
      	public java.lang.String getName() {
      		return this.name;
      	}
      
      	public void setName(java.lang.String name) {
      		this.name = name;
      	}
      
      	public java.lang.String getName2() {
      		return this.name2;
      	}
      
      	public void setName2(java.lang.String name2) {
      		this.name2 = name2;
      	}
      
      	public Person(java.lang.String name, java.lang.String name2) {
      		this.name = name;
      		this.name2 = name2;
      	}
      
      }
      

      and enumeration

      'Person.name' : ['a','b']
      'Person.name2[name=a]' : ['c', 'd']
      

      Then create constraint like

      Then update it like:

      Then update it like:

      Notice the constraint for name2 field doesn't offer enums 'c' and 'd'. If you save and reopen the rule 'c' and 'd' will be offered. They should be offered without reopening the rule.

      Acceptance Test

      EnumerationDepenedentGuidedRuleTest

              trikkola Toni Rikkola
              rh-ee-jomarko Jozef Marko (Inactive)
              Jozef Marko Jozef Marko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: