Class AbstractDataManagementStrategy
- java.lang.Object
-
- org.drools.workbench.screens.scenariosimulation.client.editor.strategies.AbstractDataManagementStrategy
-
- All Implemented Interfaces:
DataManagementStrategy
- Direct Known Subclasses:
AbstractDMNDataManagementStrategy,AbstractDMODataManagementStrategy
public abstract class AbstractDataManagementStrategy extends Object implements DataManagementStrategy
Abstract class to provide common methods to be used by actual implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractDataManagementStrategy.ResultHolder
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDataManagementStrategy.ResultHolderfactModelTreeHolderprotected org.drools.scenariosimulation.api.model.ScenarioSimulationModelmodel-
Fields inherited from interface org.drools.workbench.screens.scenariosimulation.client.editor.strategies.DataManagementStrategy
SIMPLE_CLASSES_MAP
-
-
Constructor Summary
Constructors Constructor Description AbstractDataManagementStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortedMap<String,org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree>getInstanceMap(SortedMap<String,org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> sourceMap)Returns aMapof the instances as defined in the grid and the mappedFactModelTree<T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData>
Map<String,List<List<String>>>getPropertiesToHide(AbstractScesimGridModel<T,E> abstractScesimGridModel)This method returns aMapwith the properties of a given Type (Fact, class, other dmn defined) instance, to be hidden from the right panel.protected <T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData>
List<List<String>>getPropertiesToHide(ScenarioGridColumn selectedColumn, AbstractScesimGridModel<T,E> abstractScesimGridModel)This method returns aListwith the properties of a given Type (Fact, class, other dmn defined) instance, to be hidden from the right panel for the selected column.static org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTreegetSimpleClassFactModelTree(String classSimpleName, String fullClassName)It creates a FactModelTree for a Simple Class Fact.voidsetModel(org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)voidstoreData(org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTuple factModelTuple, TestToolsView.Presenter testToolsPresenter, ScenarioSimulationContext context, GridWidget gridWidget)Store data in required target objects-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.drools.workbench.screens.scenariosimulation.client.editor.strategies.DataManagementStrategy
isADataType, manageScenarioSimulationModelContent, populateTestTools
-
-
-
-
Field Detail
-
model
protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel model
-
factModelTreeHolder
protected AbstractDataManagementStrategy.ResultHolder factModelTreeHolder
-
-
Method Detail
-
setModel
public void setModel(org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)
- Specified by:
setModelin interfaceDataManagementStrategy
-
getSimpleClassFactModelTree
public static org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree getSimpleClassFactModelTree(String classSimpleName, String fullClassName)
It creates a FactModelTree for a Simple Class Fact.- Parameters:
classSimpleName- The class simple name (eg. for 'com.Test' is 'Test'. For 'com.Test.Nested' is 'Test.Nested')fullClassName- The class simple name (eg. for 'com.Test' or 'com.Test$Nested')- Returns:
-
getPropertiesToHide
public <T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData> Map<String,List<List<String>>> getPropertiesToHide(AbstractScesimGridModel<T,E> abstractScesimGridModel)
This method returns aMapwith the properties of a given Type (Fact, class, other dmn defined) instance, to be hidden from the right panel. key: the name of the Fact class (ex. Author), value: list of properties to hide from right panel If click happen on an already assigned property, all all the properties of given type should be shown; if, instead, click is on an unassigned property, the already assigned properties must be hidden. (e.g. inside GIVEN there is an "Author" group; if clicking on "books" property header, the value of theMapreturned by this method is an emptyList; if click is on an unassigned property column, the value of theMapreturned by this method is aList. with all the already assigned Author's properties)- Parameters:
abstractScesimGridModel-- Returns:
-
getPropertiesToHide
protected <T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData> List<List<String>> getPropertiesToHide(ScenarioGridColumn selectedColumn, AbstractScesimGridModel<T,E> abstractScesimGridModel)
This method returns aListwith the properties of a given Type (Fact, class, other dmn defined) instance, to be hidden from the right panel for the selected column.If click happen on an already assigned property, all all the properties of given type should be shown; if, instead, click is on an unassigned property, the already assigned properties must be hidden. (e.g. inside GIVEN there is an "Author" group; if clicking on "books" property header, this method returns an empty
List; if click is on an unassigned property column, this method returns aList. with all the already assigned Author's properties)- Parameters:
selectedColumn-abstractScesimGridModel-- Returns:
-
storeData
public void storeData(org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTuple factModelTuple, TestToolsView.Presenter testToolsPresenter, ScenarioSimulationContext context, GridWidget gridWidget)Store data in required target objects
-
getInstanceMap
public SortedMap<String,org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> getInstanceMap(SortedMap<String,org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> sourceMap)
Returns aMapof the instances as defined in the grid and the mappedFactModelTree- Parameters:
sourceMap-- Returns:
-
-