Description of problem: - The requirement has been to enable Enumeration users in Guided Rule editor so that the selected option from one drop down in the editor be used as a criteria to populate the list of the options for a second drop down in the same rule. Of course both the drop down's values would be populated using the feature of Enumeration. This is how it looks like from ground reality. First enumeration which populates the values for the first drop down: ~~~ 'Selector.slType' : ['ClassName', 'Department'] ~~~ Once a user selects the "slType" to any value (say, "ClassName") from the populated first drop down , the second drop down's enumeration would use the chosen value from the first drop down (i.e. "ClassName") to fetch the values for the next drop down, dynamically through another enumeration (which does it through external source/method call) . Something like this: ~~~ 'Selector.slTypeDetails[slType]' : (new com.test.selection.ReturnSelectionType()).returnSelection("@{slType}") ~~~ On the other hand if I hard code the values in the method parameter it works fine. ~~~ 'Selector.slTypeDetails' : (new com.test.selection.ReturnSelectionType()).returnSelection("TEST") ~~~ - It appears that this syntax was possible as per the decision table use case from this Bugzilla [https://bugzilla.redhat.com/show_bug.cgi?id=1132885] , but I do not see it working for the Guided Rule Editor in BRMS 6.1.0. - I have attached my test project "helperclass.zip" which contains the source code for the "com.test.selection.ReturnSelectionType" class used in the Enumeration above. Also, in the attachment you can find the "git_repository.zip" file which contains the bare repository (.niogit folder) along with the artifact repository folder (repositories) for your reference. Do note that the repository contains a project named "EnumerationSpecificProjectHardCoded" which shows the example where had coded values passed through the method parameter works fine. Just follow the same steps given below to test it in this project. Is this a bug? Version-Release number of selected component (if applicable): - BRMS 6.1.0 How reproducible: - Always Steps to Reproduce: 1. Download the attached "git_repository.zip" file and extract it's contents inside the BRMS 6.1.0 installation's "/bin" folder (after backing up and removing the "repositories", ".index", ".niogit" and ".security" folders). Even if you just replace the "repositories", ".niogit" folders that would be fine too. 2. Log on to Business Central. Move to "EnumerationSpecificProject" project and open the "TestEnumeration" guided rule. Add a field constraint under "There is a Selector with:" condition. From the "Modify constraints for Selector " pop-up, select "slTypeDetails" from the "Add a restriction on a field" constraint. 3. From the newly created "slTypeDetails" field's constraint select "equal to" from the drop-down and click on the pencil icon next to it to select "Field Value" from a pop-up. Click on to "Literal Value" . Actual results: - The drop down comes as blank. Expected results: - The drop down containing the values for the second field constraint should populate the result selected from the first drop down. Additional info: - Nothing
Created attachment 1037346 [details] helperclass.zip
Created attachment 1037348 [details] git_repository.zip
My, my, this is all a bit of a muddle :( I've debugged the given scenario (thanks for the files) and the "expression" needs to be enclosed in quotes: 'Selector.slTypeDetails[slType]' : '(new com.test.selection.ReturnSelectionType()).returnSelection("@{slType}")' With this change both the Guided Rule Editor and Guided Decision Table Editor both handled "dynamic enumerations" fine. The (community) document isn't entirely clear on this (so I'll update this). It states "...but note... on the right of the ":" there are quotes around the expression. This expression will then be evaluated, only when needed, substituting the values from the fields specified..." So, we sort of elude to the correct syntax for dynamic expressions; but it wasn't clear to me - without debugging.. so I'm not surprised Users have difficulties. I'll update the community documentation and will let Vikram Goyal know about the product documentation.
Woww!!! That works superb and as expected. Thank you :)
I've created a documentation BZ for this, which can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=1279432 , so I'm marking this as verified.
Clearing needinfo here, will be resolved as part of the BZ in comment 10.