New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drools 4648 Define and Implement a DataModel to hold Background Table Data #1254
Conversation
# Conflicts: # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-businesscentral-client/src/main/java/org/drools/workbench/screens/scenariosimulation/businesscentral/client/editor/ScenarioSimulationEditorBusinessCentralWrapper.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/commands/ScenarioSimulationContext.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/commands/actualcommands/AbstractScenarioSimulationCommand.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/commands/actualcommands/AbstractSelectedColumnCommand.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationEditorPresenter.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationEditorWrapper.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationView.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationViewImpl.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/strategies/AbstractDMNDataManagementStrategy.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/factories/CollectionEditorSingletonDOMElementFactory.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/test/java/org/drools/workbench/screens/scenariosimulation/client/commands/actualcommands/AbstractScenarioSimulationCommandTest.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/test/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationEditorPresenterTest.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/test/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationViewImplTest.java
# Conflicts: # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-backend/src/main/java/org/drools/workbench/screens/scenariosimulation/backend/server/util/DMNSimulationSettingsCreationStrategy.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationEditorPresenter.java # drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/test/java/org/drools/workbench/screens/scenariosimulation/client/editor/ScenarioSimulationEditorPresenterTest.java
jenkins please retest this |
/** | ||
* <code>Command</code> to <b>append</b> (i.e. put in the last position) a row | ||
*/ | ||
public class ScenarioGridWidgetFocusCommand extends AbstractScenarioSimulationCommand { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR
int SIMULATION_TAB_INDEX = 0; | ||
int BACKGROUND_TAB_INDEX = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these value here? What about move them to constantHolder or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielezonca
Those value are meaningful only for the ScenarioSimulationEditorWrappers, that's why I put them here
void selectSimulationTab(); | ||
|
||
void selectBackgroundTab(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR?
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! 👍
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one new line would be enough. Ideally no change here. Keep in mind more changes you do in commit == more conflicts resolution in future.
@@ -48,7 +48,7 @@ public ScenarioGrid getScenarioGrid() { | |||
* @param scenarioGrid ScenarioGrid to add to the Layer | |||
* @return The Layer | |||
*/ | |||
public Layer addScenarioGrid(final ScenarioGrid scenarioGrid) { | |||
public Layer addScesimDataGrid(final ScenarioGrid scenarioGrid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong rename
// to restore when implement tab switching | ||
// @Test | ||
// public void redoNotEmptyDifferentGrid() { | ||
// scenarioCommandRegistry.undoneCommands.push(appendRowCommandMock); | ||
// when(appendRowCommandMock.commonUndoRedoPreexecution(eq(scenarioSimulationContextLocal))).thenReturn(Optional.of(CommandResultBuilder.SUCCESS)); | ||
// int currentSize = scenarioCommandRegistry.undoneCommands.size(); | ||
// scenarioCommandRegistry.redo(scenarioSimulationContextLocal); | ||
// assertEquals(currentSize, scenarioCommandRegistry.undoneCommands.size()); | ||
// verify(scenarioCommandRegistry, never()).commonUndoRedoOperation(eq(scenarioSimulationContextLocal), eq(appendRowCommandMock), eq(false)); | ||
// verify(scenarioCommandRegistry, never()).setUndoRedoButtonStatus(eq(scenarioSimulationContextLocal)); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR
// @Test | ||
// public void setFocusedContext() { | ||
// presenter.setFocusedContext(contextMock); | ||
// verify(presenter, times(1)).populateRightDocks(eq(TestToolsPresenter.IDENTIFIER)); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code
// TODO {gcardosi} restore after correction on presenter | ||
// verify(scenarioBackgroundGridWidgetMock, times(1)).setContent(isA(Simulation.class), eq(scenarioSimulationContextLocal.getSettings().getType())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? not part of this PR?
import static org.mockito.Mockito.when; | ||
|
||
@RunWith(LienzoMockitoTestRunner.class) | ||
//@RunWith(LienzoMockitoTestRunner.class) | ||
public class ScenarioSimulationViewProducerTest extends AbstractProducerTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielezonca
done
@@ -435,13 +436,13 @@ public void testShowContextMenuGivenOrExpect() { | |||
private Simulation getSimulation() { | |||
Simulation toReturn = new Simulation(); | |||
SimulationDescriptor simulationDescriptor = toReturn.getSimulationDescriptor(); | |||
simulationDescriptor.setType(ScenarioSimulationModel.Type.RULE); | |||
// simulationDescriptor.setType(ScenarioSimulationModel.Type.RULE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code
jenkins execute full downstream build |
@@ -56,9 +57,9 @@ | |||
* @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @param settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dupliaka
done
* @param kieContainer | ||
* @return | ||
*/ | ||
@Override | ||
public List<FactMappingValidationError> validate(Simulation simulation, KieContainer kieContainer) { | ||
public List<FactMappingValidationError> validate(Simulation simulation, Settings settings, KieContainer kieContainer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you added settings parameter but do not use it. But if we will set rule group for test scenario background would the rule group validated on this step? Shouldn't we include the validation of settings here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dupliaka
As far as I remember there was not the validation of any "setting": we could add one, but I'm not sure what/how we would validate; anyway, I would do that in another ticket.
Beside that, that "Settings" param is there only to fullfill the contract of the declared abstract method
@danielezonca @dupliaka @yesamer |
jenkins please retest this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -86,62 +87,44 @@ | |||
extends KieService<ScenarioSimulationModelContent> | |||
implements ScenarioSimulationService { | |||
|
|||
private static final String KIE_VERSION = "kie.version"; | |||
private static final String junitActivatorPackageName = "testscenario"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell if you reject to keep the same style on purpose? Shouldn't we change junitActivatorPackageName on JUNIT_ACTIVATOR_PACKAGE_NAME
case DMN: | ||
return dmnSimulationCreationStrategy.createBackground(context, value); | ||
default: | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: can we throw an exception here? Like IlligalStateException? So to have a chance to understand what happened by logs in runtime?
} | ||
|
||
/** | ||
* Create an empty column using factMappingType defined. The new column will be added as last column of | ||
* the group (GIVEN/EXPECT) (see findLastIndexOfGroup) | ||
* @param simulationDescriptor | ||
* @param scenarioWithIndex | ||
* @param scesimDataWithIndex | ||
* @param placeholderId | ||
* @param factMappingType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we add @param columnIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dupliaka
done
@jomarko |
@jomarko |
What I see in the video is expected - Background grid has different goal and semantics from scenario one. Maybe it should be somehow better enforced |
@jomarko |
@jomarko |
@jomarko |
@dupliaka |
I am not sure, My idea was that exactly for DMN we are showing all the properties that we got for DMN in Model, but Background even for DMN should initialise as empty table. Will retest it |
@dupliaka See #1254 (comment) - it works if the newly created target grid has the same columns as the original one |
Nobody expected this. |
@dupliaka |
@dupliaka |
@dupliaka |
@dupliaka when you import a csv there is a popup warn about header structure; beside that, this is how it has been implemented. @danielezonca wdyt? |
@gitgabrio |
@gitgabrio |
URL is the via items in Data Object tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gitgabrio I checked your resolution to my comments to code and manual review comments. as result of this I reported two more jiras. I am not doing any intensive re-review due to my time resources. Thank you
Sorry but it should not show error and after that show the unexpected error after i try to change anything in the document. |
@dupliaka |
Ok, I gathered the results here https://docs.google.com/spreadsheets/d/1bsQb9_EbOuQFotH41KmfETd8wkQhQU_lgsnKvpnKmF8/edit?usp=sharing |
jenkins execute full downstream build |
@dupliaka |
@dupliaka |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QE review is finished from my side : https://docs.google.com/spreadsheets/d/1bsQb9_EbOuQFotH41KmfETd8wkQhQU_lgsnKvpnKmF8/edit#gid=0
@dupliaka @yesamer @danielezonca
Client-side part of multi-repo ticket:
https://issues.jboss.org/browse/DROOLS-4648
see https://github.com/kiegroup/drools/pull/2630
This PR implement a specific Background object inside the data model; that object is completely isolated from Simulation and is managed inside the Background grid.
There is only one single history, where modification of both models are stored/managed.
On undo/redo command, currently the tab are not switched (to be implemented in next ticket).