2 Replies Latest reply on Jan 16, 2014 2:51 PM by Lei Fu

    How to load enumeration in to guvnors use glassfish?

    Lei Fu Newbie

      The current version I am using:


      Guvnors 5.4Final

      Here is what I have:

      1. I have load a POJO which contains a class/database table CollectionType with fields/members code, value, id

      2. I create classes to simulate load enumerations for CollectionType.code: Please see below code.

      3. I put the enum jar file in GLASSFISH_HOME\glassfish\modules

      4. Create the new enumerations in Guvnor.

      5. In the Enum edit screen, wrote the statement:

            'CollectionType.Code' : CollectionTypeEnumLoad.loadSimpleCode

      6. Receive error:

      [EnumTest1] Unable to load enumeration data.
      [EnumTest1] [Error: unresolvable property or identifier: CollectionTypeEnumLoad] [Near : {... lectionType.Code' : CollectionTypeEnumLoad.loadSim ....}] ^ [Line: 1, Column: 27]
      [EnumTest1] Error type: org.mvel2.PropertyAccessException



      Where should I put the enumeration jar file? or any other thing I did wrong?


      Thank you very in advance!


      Best Regards,




      ================================== Code ================

      public class CollectionTypeEnumLoad



               private enum valueString {



                   private String numberStr;


                   valueString(String number) {

                       this.numberStr = number;



                   public String getEnumString() {

                       return numberStr;




           public static List <String> loadSimpleCode () {

               List<String> returnList = new ArrayList<String>();

              for (int i=0; i < 4; i++) {

                  String tempString = null;

                  switch {

                      case 0:

                          tempString = valueString.THIRTY.getEnumString();


                      case 1:

                          tempString = valueString.SIXTY.getEnumString();


                      case 2:

                          tempString =valueString.NINETY.getEnumString();


                      case 3:

                          tempString = valueString.THREE.getEnumString();                




              return returnList;




        • 1. Re: How to load enumeration in to guvnors use glassfish?
          Lei Fu Newbie

          I have tried to use = sign

          'CollectionType.Code'=CollectionTypeEnumLoad.loadSimpleCode (use '=' instead of ':').

          and I put the jar file in

          C: \glassfish-\glassfish\modains\domain1\applications\guvnor\WEB-INF\lib.

          I can pass validation. I would assume that Guvnor able to find the class/method. But I am not able to get the drop down list for CollectionType.code from rule or test scenario.


          According to the menu:

          For the method return only a List <String> use ":" sign:  'CollectionType.Code':CollectionTypeEnumLoad.loadSimpleCode

          For the method return the Map <String, List<String>> with key is FactName.Field use" =" sign: 'CollectionType.Code'=CollectionTypeEnumLoad.loadSimpleCodeMap


          Therefore I add a new method return the map in CollectionTypeEnumLoad class:

          public static Map <String, List<String>> loadSimpleCodeMap() {

                 Map <String, List<String>> returnMap = new HashMap();


                 returnMap.put("CollectionType.code", loadSimpleCode());


                 return returnMap;




          In the enum creation:

          If I use ":" I am not able to pass validation


          If I use "=" sign I am able to pass validation but not able to get drop down:



          In the test scenario, I select name the fact name as CollectionType and select code field. I should get a drop down list for the selection, but I did not.

          Now, I am not sure what should be used and how can I get my drop down list. It looks like the behavior between ":" and "=" is different.

          Please let me know where am I missing or any suggestions on how can I trouble shoot is greatly appreciated -- Thank you.

          • 2. Re: How to load enumeration in to guvnors use glassfish?
            Lei Fu Newbie

            I finally get the array list work for the drop down:

            1. After create the *.jar, needs load it to Guvnor

            2. in the enum, needs to put the full path of the method:

            3. In the rule you can see the drop down: