Dependency enumeration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dependency enumeration

agarwalk
Hi

I have created following enumeration and java class file.

Enumeration:

'OrderData.propertyState':(new com.asps.rules.OrderData()).loadStates()
'OrderData.fulfillmentReviewerName[propertyState]':'(new com.asps.rules.OrderData()).loadReviewers("@{propertyState}")'

Java class:

public class OrderData implements Serializable {
       private String propertyState;
        private String fulfillmentReviewerName;

// getters and setters

        public List<String> loadStates() {
                List<String> states = new ArrayList<String>();
                states.add("CA");
                states.add("NY");
                states.add("FL");
                return states;
        }

        public List<String> loadReviewers(final String propertyState) {
                List<String> reviewers = new ArrayList<String>();
                System.out.println("### in load reviewers ### : " + propertyState);
                if ("CA".equalsIgnoreCase(propertyState)) {
                        reviewers.add("A");
                        reviewers.add("B");
                        System.out.println("Reviewers : A & B");
                } else if ("NY".equalsIgnoreCase(propertyState)) {
                        reviewers.add("C");
                        reviewers.add("D");
                        System.out.println("Reviewers : C& D");
                } else if ("FL".equalsIgnoreCase(propertyState)) {
                        reviewers.add("E");
                        reviewers.add("F");
                        System.out.println("Reviewers : E& F");
                } else {
                        reviewers.add("G");
                        reviewers.add("H");
                        System.out.println("Reviewers : G& H");
                }
                return reviewers;
        }
}

I created a rule as follows

    WHEN
               There is an OrderData with:
            propertyState[propertyState] FL --- This is a drop down which is being displayed correctly
         
          fulfillmentReviewerName [fulfillmentReviewerName]  -- This should have been the drop down. Values are dependent on the state selected.


When i try to create above rule the enumeration is loaded correctly for propertyState but the enumeration is not loaded for  fulfillmentReviewerName field. When I saw the logs the correct method  and condition is being invoked (as per Sys out)but drop down does not contain anything.

ANy suggestions?

Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Dependency enumeration

manstis
This is a known bug in Guvnor, https://issues.jboss.org/browse/GUVNOR-1106.

I assume your example uses a single DSL sentence - if not the bug is still related and at present unresolved.

With kind regards,

Mike

On 11 August 2011 13:05, agarwalk <[hidden email]> wrote:
Hi

I have created following enumeration and java class file.

*Enumeration:*

'OrderData.propertyState':(new com.asps.rules.OrderData()).loadStates()
'OrderData.fulfillmentReviewerName[propertyState]':'(new
com.asps.rules.OrderData()).loadReviewers("@{propertyState}")'

*Java class:*

public class OrderData implements Serializable {
      private String propertyState;
       private String fulfillmentReviewerName;

// getters and setters

       public List<String> loadStates() {
               List<String> states = new ArrayList<String>();
               states.add("CA");
               states.add("NY");
               states.add("FL");
               return states;
       }

       public List<String> loadReviewers(final String propertyState) {
               List<String> reviewers = new ArrayList<String>();
               System.out.println("### in load reviewers ### : " + propertyState);
               if ("CA".equalsIgnoreCase(propertyState)) {
                       reviewers.add("A");
                       reviewers.add("B");
                       System.out.println("Reviewers : A & B");
               } else if ("NY".equalsIgnoreCase(propertyState)) {
                       reviewers.add("C");
                       reviewers.add("D");
                       System.out.println("Reviewers : C& D");
               } else if ("FL".equalsIgnoreCase(propertyState)) {
                       reviewers.add("E");
                       reviewers.add("F");
                       System.out.println("Reviewers : E& F");
               } else {
                       reviewers.add("G");
                       reviewers.add("H");
                       System.out.println("Reviewers : G& H");
               }
               return reviewers;
       }
}

I created a rule as follows

   WHEN
              There is an OrderData with:
           propertyState[propertyState]* FL* --- This is a drop down which
is being displayed correctly

         fulfillmentReviewerName [fulfillmentReviewerName]  -- This should
have been the drop down. Values are dependent on the state selected.


When i try to create above rule the enumeration is loaded correctly for
propertyState but the enumeration is not loaded for  fulfillmentReviewerName
field. When I saw the logs the correct method  and condition is being
invoked (as per Sys out)but drop down does not contain anything.

ANy suggestions?



--
View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p3245703.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Dependency enumeration

ashish6276
Can anyone tell me if this issue fixed now ?
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Dependency enumeration

manstis

What does the JIRA say?

Sent on the move

On 19 Sep 2013 08:24, "ashish6276" <[hidden email]> wrote:
Can anyone tell me if this issue fixed now ?



--
View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p4026045.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users