[JBoss JIRA] (DROOLS-1985) Test Scenario fails to populate Date field
by Guilherme Gomes (Jira)
[ https://issues.redhat.com/browse/DROOLS-1985?page=com.atlassian.jira.plug... ]
Guilherme Gomes updated DROOLS-1985:
------------------------------------
Labels: drools-tools (was: )
> Test Scenario fails to populate Date field
> ------------------------------------------
>
> Key: DROOLS-1985
> URL: https://issues.redhat.com/browse/DROOLS-1985
> Project: Drools
> Issue Type: Bug
> Components: Test Scenarios Editor
> Affects Versions: 5.5.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Mark Coble
> Priority: Major
> Labels: drools-tools
> Attachments: repository_export_mvel_date.zip
>
>
> Under the conditions:
> - Model A has a Date field
> - Model B extends Model A
> - All rules have "java" dialect
> When you set a value to the Date field of Model B in a Test Scenario, the Test scenario fails to run and throws the Exception.
> {noformat}
> 20:59:23,323 INFO [stdout] (http--127.0.0.1-8080-1) ERROR 14-11 20:59:23,322 (LoggingHelper.java:error:74) Unable to run the scenario.
> 20:59:23,323 INFO [stdout] (http--127.0.0.1-8080-1) [Error: could not access/write property (dateTime) in: defaultPackage.SubModel]
> 20:59:23,323 INFO [stdout] (http--127.0.0.1-8080-1) [Near : {... __fact__.dateTime= __val__ ....}]
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) ^
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) [Line: 1, Column: 1]
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.PropertyAccessor.set(PropertyAccessor.java:372)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.PropertyAccessor.set(PropertyAccessor.java:139)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.ast.DeepAssignmentNode.getReducedValue(DeepAssignmentNode.java:97)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:106)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:49)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.mvel2.MVEL.eval(MVEL.java:165)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.ide.common.server.testscenarios.populators.FieldPopulator.populateField(FieldPopulator.java:47)
> 20:59:23,324 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.ide.common.server.testscenarios.populators.SimpleFieldPopulator.populate(SimpleFieldPopulator.java:35)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.ide.common.server.testscenarios.populators.FactPopulator.populate(FactPopulator.java:52)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.ide.common.server.testscenarios.ScenarioRunner.applyFixtures(ScenarioRunner.java:119)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.ide.common.server.testscenarios.ScenarioRunner.run(ScenarioRunner.java:82)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.guvnor.server.TestScenarioServiceImplementation.runScenario(TestScenarioServiceImplementation.java:160)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.guvnor.server.TestScenarioServiceImplementation.runScenario(TestScenarioServiceImplementation.java:111)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.guvnor.server.TestScenarioServiceImplementation.runScenario(TestScenarioServiceImplementation.java:101)
> 20:59:23,325 INFO [stdout] (http--127.0.0.1-8080-1) at org.drools.guvnor.server.TestScenarioServiceServlet.runScenario(TestScenarioServiceServlet.java:39)
> {noformat}
> This is because org.drools.ide.common.server.testscenarios.populators.FieldPopulatorFactory.isDate() uses Class.getDeclaredMethods which doesn't return super class methods.
> {code:java}
> private boolean isDate(String fieldName) {
> for (Method method : factObject.getClass().getDeclaredMethods()) {
> if (hasMutator(fieldName, method)) {
> if (java.util.Date.class.isAssignableFrom(method.getParameterTypes()[0])) {
> return true;
> }
> }
> }
> return false;
> }
> {code}
> BTW, if your rules use "mvel" dialect, Guvnor will load org.drools.base.mvel.MVELCompilationUnit class and its static block registers for Date and Calendar org.mvel2.DataConversion. Hence this issue will not occur.
> {code:java}
> static {
> //for handling dates as string literals
> DataConversion.addConversionHandler( Date.class,
> new MVELDateCoercion() );
> DataConversion.addConversionHandler( Calendar.class,
> new MVELCalendarCoercion() );
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-4799) Adding "expression" type handling for Collection type propereties
by Guilherme Gomes (Jira)
[ https://issues.redhat.com/browse/DROOLS-4799?page=com.atlassian.jira.plug... ]
Guilherme Gomes updated DROOLS-4799:
------------------------------------
Labels: UX UXTeam drools-tools (was: UX UXTeam)
> Adding "expression" type handling for Collection type propereties
> -----------------------------------------------------------------
>
> Key: DROOLS-4799
> URL: https://issues.redhat.com/browse/DROOLS-4799
> Project: Drools
> Issue Type: Feature Request
> Components: Scenario Simulation and Testing, Test Scenarios Editor
> Reporter: Yeser Amer
> Assignee: Elizabeth Clayton
> Priority: Major
> Labels: UX, UXTeam, drools-tools
> Attachments: Screen Shot 2019-11-26 at 1.26.54 PM.png, dmn-dt-enumeration-constraint.png, dmn-dt-expression-constraint.png, expression-list_error.png, scesim-list.png
>
>
> I need a clarification regarding the behaviour of the updated Collection Editor, in particular for this section -->https://marvelapp.com/5ab248j/screen/62093042/layer/102496330.
> Considering the editor introduces a new way to handle a Collection ("Define List"), can you please give us detailed behaviour for the following case:
> - What happen if a user starts to input data inside a section (Define List/Create List) and then switch on the other one?
> eg. if I start to define a List using "Define List" option (i.e. an expression) and then I change to "Create List" case. What should happen?
> - Currently, after adding a Collection, the Grid cell will show "List (1)". It should be the same for "Define list" (i.e. Expression) case?
> In case of additional clarificaiton, I'll update this ticket.
> Hope it's clear, if not you can contact me anytime.
> Thanks
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-4585) Focus doesn't moves after the selected cell
by Guilherme Gomes (Jira)
[ https://issues.redhat.com/browse/DROOLS-4585?page=com.atlassian.jira.plug... ]
Guilherme Gomes updated DROOLS-4585:
------------------------------------
Labels: CustomerFocus drools-tools (was: CustomerFocus)
> Focus doesn't moves after the selected cell
> -------------------------------------------
>
> Key: DROOLS-4585
> URL: https://issues.redhat.com/browse/DROOLS-4585
> Project: Drools
> Issue Type: Bug
> Components: Scenario Simulation and Testing
> Affects Versions: 7.28.0.Final
> Reporter: Anna Dupliak
> Assignee: Yeser Amer
> Priority: Major
> Labels: CustomerFocus, drools-tools
>
> {color:red}*Failure*{color}
> If you navigate cell that is obscured by the right panel in header then it dosen't automatically scrolls to it as it done for grid body.
> *Expected*
> Viewed part of grid follows the selected cell
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months