Class ScenarioSimulationServiceImpl
- java.lang.Object
-
- org.kie.workbench.common.services.backend.service.KieService<org.drools.workbench.screens.scenariosimulation.model.ScenarioSimulationModelContent>
-
- org.drools.workbench.screens.scenariosimulation.backend.server.ScenarioSimulationServiceImpl
-
- All Implemented Interfaces:
org.drools.workbench.screens.scenariosimulation.service.ScenarioSimulationService,org.uberfire.ext.editor.commons.service.support.SupportsCopy,org.uberfire.ext.editor.commons.service.support.SupportsCreate<org.drools.scenariosimulation.api.model.ScenarioSimulationModel>,org.uberfire.ext.editor.commons.service.support.SupportsDelete,org.uberfire.ext.editor.commons.service.support.SupportsRead<org.drools.scenariosimulation.api.model.ScenarioSimulationModel>,org.uberfire.ext.editor.commons.service.support.SupportsRename,org.uberfire.ext.editor.commons.service.support.SupportsSaveAndRename<org.drools.scenariosimulation.api.model.ScenarioSimulationModel,org.guvnor.common.services.shared.metadata.model.Metadata>,org.uberfire.ext.editor.commons.service.support.SupportsUpdate<org.drools.scenariosimulation.api.model.ScenarioSimulationModel,org.guvnor.common.services.shared.metadata.model.Metadata>
@ApplicationScoped public class ScenarioSimulationServiceImpl extends org.kie.workbench.common.services.backend.service.KieService<org.drools.workbench.screens.scenariosimulation.model.ScenarioSimulationModelContent> implements org.drools.workbench.screens.scenariosimulation.service.ScenarioSimulationService
-
-
Field Summary
Fields Modifier and Type Field Description protected org.drools.workbench.screens.scenariosimulation.service.DMNTypeServicedmnTypeServiceprotected ScenarioSimulationBuilderscenarioSimulationBuilderprotected ScenarioValidationServicescenarioValidationService
-
Constructor Summary
Constructors Constructor Description ScenarioSimulationServiceImpl()ScenarioSimulationServiceImpl(org.uberfire.rpc.SessionInfo sessionInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.drools.workbench.screens.scenariosimulation.model.ScenarioSimulationModelContentconstructContent(org.uberfire.backend.vfs.Path path, org.guvnor.common.services.shared.metadata.model.Overview overview)org.uberfire.backend.vfs.Pathcopy(org.uberfire.backend.vfs.Path path, String newName, String comment)org.uberfire.backend.vfs.Pathcopy(org.uberfire.backend.vfs.Path path, String newName, org.uberfire.backend.vfs.Path targetDirectory, String comment)org.uberfire.backend.vfs.Pathcreate(org.uberfire.backend.vfs.Path context, String fileName, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment)org.uberfire.backend.vfs.Pathcreate(org.uberfire.backend.vfs.Path context, String fileName, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type, String value)protected voidcreateActivatorIfNotExist(org.uberfire.backend.vfs.Path context)voiddelete(org.uberfire.backend.vfs.Path path, String comment)protected booleaneditPomIfNecessary(org.guvnor.common.services.project.model.Dependencies dependencies, org.guvnor.common.services.project.model.GAV gav)protected booleanensureDependencies(org.kie.workbench.common.services.shared.project.KieModule module)Verify if the project contains all the needed dependencies removing the old ones if availableprotected org.uberfire.java.nio.file.PathgetActivatorPath(org.guvnor.common.services.project.model.Package rootModulePackage)protected List<org.guvnor.common.services.project.model.GAV>getDependencies(String kieVersion)protected org.uberfire.java.nio.file.PathgetJunitActivatorPackagePath(org.guvnor.common.services.project.model.Package rootModulePackage)protected List<org.guvnor.common.services.project.model.GAV>getOldDependencies()protected org.guvnor.common.services.project.model.PackagegetOrCreateJunitActivatorPackage(org.kie.workbench.common.services.shared.project.KieModule kieModule)voidinit()org.drools.scenariosimulation.api.model.ScenarioSimulationModelload(org.uberfire.backend.vfs.Path path)protected booleanremoveFromPomIfNecessary(org.guvnor.common.services.project.model.Dependencies dependencies, org.guvnor.common.services.project.model.GAV oldDependency)protected voidremoveOldActivatorIfExists(org.uberfire.java.nio.file.Path activatorPath, org.kie.workbench.common.services.shared.project.KieModule kieModule)This routine looks for existing activators to migrateorg.uberfire.backend.vfs.Pathrename(org.uberfire.backend.vfs.Path path, String newName, String comment)org.drools.workbench.screens.scenariosimulation.model.SimulationRunResultrunScenario(org.uberfire.backend.vfs.Path path, org.drools.scenariosimulation.api.model.ScesimModelDescriptor simulationDescriptor, List<org.drools.scenariosimulation.api.model.ScenarioWithIndex> scenarios, org.drools.scenariosimulation.api.model.Settings settings, org.drools.scenariosimulation.api.model.Background background)org.uberfire.backend.vfs.Pathsave(org.uberfire.backend.vfs.Path resource, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, org.guvnor.common.services.shared.metadata.model.Metadata metadata, String comment)org.uberfire.backend.vfs.PathsaveAndRename(org.uberfire.backend.vfs.Path path, String newFileName, org.guvnor.common.services.shared.metadata.model.Metadata metadata, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment)protected org.drools.scenariosimulation.api.model.ScenarioSimulationModelunmarshalInternal(String content)List<org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError>validate(org.drools.scenariosimulation.api.model.Simulation simulation, org.drools.scenariosimulation.api.model.Settings settings, org.uberfire.backend.vfs.Path path)-
Methods inherited from class org.kie.workbench.common.services.backend.service.KieService
getSource, loadContent
-
-
-
-
Field Detail
-
scenarioSimulationBuilder
@Inject protected ScenarioSimulationBuilder scenarioSimulationBuilder
-
dmnTypeService
@Inject protected org.drools.workbench.screens.scenariosimulation.service.DMNTypeService dmnTypeService
-
scenarioValidationService
@Inject protected ScenarioValidationService scenarioValidationService
-
-
Method Detail
-
init
@PostConstruct public void init()
-
runScenario
public org.drools.workbench.screens.scenariosimulation.model.SimulationRunResult runScenario(org.uberfire.backend.vfs.Path path, org.drools.scenariosimulation.api.model.ScesimModelDescriptor simulationDescriptor, List<org.drools.scenariosimulation.api.model.ScenarioWithIndex> scenarios, org.drools.scenariosimulation.api.model.Settings settings, org.drools.scenariosimulation.api.model.Background background)- Specified by:
runScenarioin interfaceorg.drools.workbench.screens.scenariosimulation.service.ScenarioSimulationService
-
create
public org.uberfire.backend.vfs.Path create(org.uberfire.backend.vfs.Path context, String fileName, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment)- Specified by:
createin interfaceorg.uberfire.ext.editor.commons.service.support.SupportsCreate<org.drools.scenariosimulation.api.model.ScenarioSimulationModel>
-
create
public org.uberfire.backend.vfs.Path create(org.uberfire.backend.vfs.Path context, String fileName, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type, String value)- Specified by:
createin interfaceorg.drools.workbench.screens.scenariosimulation.service.ScenarioSimulationService
-
load
public org.drools.scenariosimulation.api.model.ScenarioSimulationModel load(org.uberfire.backend.vfs.Path path)
- Specified by:
loadin interfaceorg.uberfire.ext.editor.commons.service.support.SupportsRead<org.drools.scenariosimulation.api.model.ScenarioSimulationModel>
-
constructContent
protected org.drools.workbench.screens.scenariosimulation.model.ScenarioSimulationModelContent constructContent(org.uberfire.backend.vfs.Path path, org.guvnor.common.services.shared.metadata.model.Overview overview)- Specified by:
constructContentin classorg.kie.workbench.common.services.backend.service.KieService<org.drools.workbench.screens.scenariosimulation.model.ScenarioSimulationModelContent>
-
save
public org.uberfire.backend.vfs.Path save(org.uberfire.backend.vfs.Path resource, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, org.guvnor.common.services.shared.metadata.model.Metadata metadata, String comment)- Specified by:
savein interfaceorg.uberfire.ext.editor.commons.service.support.SupportsUpdate<org.drools.scenariosimulation.api.model.ScenarioSimulationModel,org.guvnor.common.services.shared.metadata.model.Metadata>
-
delete
public void delete(org.uberfire.backend.vfs.Path path, String comment)- Specified by:
deletein interfaceorg.uberfire.ext.editor.commons.service.support.SupportsDelete
-
rename
public org.uberfire.backend.vfs.Path rename(org.uberfire.backend.vfs.Path path, String newName, String comment)- Specified by:
renamein interfaceorg.uberfire.ext.editor.commons.service.support.SupportsRename
-
copy
public org.uberfire.backend.vfs.Path copy(org.uberfire.backend.vfs.Path path, String newName, String comment)- Specified by:
copyin interfaceorg.uberfire.ext.editor.commons.service.support.SupportsCopy
-
copy
public org.uberfire.backend.vfs.Path copy(org.uberfire.backend.vfs.Path path, String newName, org.uberfire.backend.vfs.Path targetDirectory, String comment)- Specified by:
copyin interfaceorg.uberfire.ext.editor.commons.service.support.SupportsCopy
-
saveAndRename
public org.uberfire.backend.vfs.Path saveAndRename(org.uberfire.backend.vfs.Path path, String newFileName, org.guvnor.common.services.shared.metadata.model.Metadata metadata, org.drools.scenariosimulation.api.model.ScenarioSimulationModel content, String comment)- Specified by:
saveAndRenamein interfaceorg.uberfire.ext.editor.commons.service.support.SupportsSaveAndRename<org.drools.scenariosimulation.api.model.ScenarioSimulationModel,org.guvnor.common.services.shared.metadata.model.Metadata>
-
validate
public List<org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError> validate(org.drools.scenariosimulation.api.model.Simulation simulation, org.drools.scenariosimulation.api.model.Settings settings, org.uberfire.backend.vfs.Path path)
- Specified by:
validatein interfaceorg.drools.workbench.screens.scenariosimulation.service.ScenarioSimulationService
-
createActivatorIfNotExist
protected void createActivatorIfNotExist(org.uberfire.backend.vfs.Path context)
-
getOrCreateJunitActivatorPackage
protected org.guvnor.common.services.project.model.Package getOrCreateJunitActivatorPackage(org.kie.workbench.common.services.shared.project.KieModule kieModule)
-
removeOldActivatorIfExists
protected void removeOldActivatorIfExists(org.uberfire.java.nio.file.Path activatorPath, org.kie.workbench.common.services.shared.project.KieModule kieModule)This routine looks for existing activators to migrate- Parameters:
activatorPath-kieModule-
-
ensureDependencies
protected boolean ensureDependencies(org.kie.workbench.common.services.shared.project.KieModule module)
Verify if the project contains all the needed dependencies removing the old ones if available- Parameters:
module-- Returns:
- boolean that specify if there was old dependencies
-
removeFromPomIfNecessary
protected boolean removeFromPomIfNecessary(org.guvnor.common.services.project.model.Dependencies dependencies, org.guvnor.common.services.project.model.GAV oldDependency)
-
editPomIfNecessary
protected boolean editPomIfNecessary(org.guvnor.common.services.project.model.Dependencies dependencies, org.guvnor.common.services.project.model.GAV gav)
-
getActivatorPath
protected org.uberfire.java.nio.file.Path getActivatorPath(org.guvnor.common.services.project.model.Package rootModulePackage)
-
getJunitActivatorPackagePath
protected org.uberfire.java.nio.file.Path getJunitActivatorPackagePath(org.guvnor.common.services.project.model.Package rootModulePackage)
-
getOldDependencies
protected List<org.guvnor.common.services.project.model.GAV> getOldDependencies()
-
getDependencies
protected List<org.guvnor.common.services.project.model.GAV> getDependencies(String kieVersion)
-
-