Class DMNTypeServiceImpl

  • All Implemented Interfaces:
    org.drools.workbench.screens.scenariosimulation.service.DMNTypeService

    @ApplicationScoped
    public class DMNTypeServiceImpl
    extends AbstractKieContainerService
    implements org.drools.workbench.screens.scenariosimulation.service.DMNTypeService
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkTypeSupport​(org.kie.dmn.api.core.DMNType type, org.drools.workbench.screens.scenariosimulation.backend.server.DMNTypeServiceImpl.ErrorHolder errorHolder, String fullPropertyPath)
      Recursively visit a composite DMNType to eventually detect and add errors to given ErrorHolder
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForCollection​(Map<String,​List<String>> genericTypeInfoMap, String factName, String importPrefix, org.kie.dmn.api.core.DMNType type, SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType, List<String> alreadyVisited)
      Creates a FactModelTree for DMNType where DMNType.isCollection() == true
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForComposite​(Map<String,​List<String>> genericTypeInfoMap, String name, String importPrefix, String fullPropertyPath, org.kie.dmn.api.core.DMNType type, SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType, List<String> alreadyVisited)
      Creates a FactModelTree for DMNType where DMNType.isComposite() == true
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForGenericType​(Map<String,​List<String>> genericTypeInfoMap, String factName, String importPrefix, String propertyName, String fullPropertyPath, org.kie.dmn.api.core.DMNType type, SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType, List<String> alreadyVisited)
      Creates a FactModelTree for DMNType
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForNoCollection​(Map<String,​List<String>> genericTypeInfoMap, String factName, String importPrefix, String propertyName, String fullPropertyPath, org.kie.dmn.api.core.DMNType type, SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType, List<String> alreadyVisited)
      Creates a FactModelTree for DMNType where DMNType.isCollection() !
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForSimple​(String factName, String importPrefix, String typeName, String propertyClass, Map<String,​List<String>> genericTypeInfoMap, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType)
      Creates a FactModelTree for DMNType where DMNType.isComposite() !
      protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createTopLevelFactModelTree​(String factName, String importPrefix, org.kie.dmn.api.core.DMNType type, SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts, org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType)
      This method is the entry point for FactModelTree.
      org.drools.workbench.screens.scenariosimulation.model.DMNMetadata getDMNMetadata​(org.uberfire.backend.vfs.Path path, String dmnPath)  
      org.kie.dmn.api.core.DMNModel getDMNModel​(org.uberfire.backend.vfs.Path path, String dmnPath)  
      org.kie.dmn.api.core.DMNRuntime getDMNRuntime​(org.uberfire.backend.vfs.Path path)  
      void initializeNameAndNamespace​(org.drools.scenariosimulation.api.model.Settings settings, org.uberfire.backend.vfs.Path path, String dmnPath)  
      protected void internalCheckTypeSupport​(org.kie.dmn.api.core.DMNType type, boolean alreadyInCollection, org.drools.workbench.screens.scenariosimulation.backend.server.DMNTypeServiceImpl.ErrorHolder errorHolder, String fullPropertyPath, Set<String> alreadyVisited)  
      org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTuple retrieveFactModelTuple​(org.uberfire.backend.vfs.Path path, String dmnPath)  
    • Constructor Detail

      • DMNTypeServiceImpl

        public DMNTypeServiceImpl()
    • Method Detail

      • retrieveFactModelTuple

        public org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTuple retrieveFactModelTuple​(org.uberfire.backend.vfs.Path path,
                                                                                                                          String dmnPath)
        Specified by:
        retrieveFactModelTuple in interface org.drools.workbench.screens.scenariosimulation.service.DMNTypeService
      • initializeNameAndNamespace

        public void initializeNameAndNamespace​(org.drools.scenariosimulation.api.model.Settings settings,
                                               org.uberfire.backend.vfs.Path path,
                                               String dmnPath)
        Specified by:
        initializeNameAndNamespace in interface org.drools.workbench.screens.scenariosimulation.service.DMNTypeService
      • getDMNMetadata

        public org.drools.workbench.screens.scenariosimulation.model.DMNMetadata getDMNMetadata​(org.uberfire.backend.vfs.Path path,
                                                                                                String dmnPath)
        Specified by:
        getDMNMetadata in interface org.drools.workbench.screens.scenariosimulation.service.DMNTypeService
      • getDMNModel

        public org.kie.dmn.api.core.DMNModel getDMNModel​(org.uberfire.backend.vfs.Path path,
                                                         String dmnPath)
      • getDMNRuntime

        public org.kie.dmn.api.core.DMNRuntime getDMNRuntime​(org.uberfire.backend.vfs.Path path)
      • createTopLevelFactModelTree

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createTopLevelFactModelTree​(String factName,
                                                                                                                                 String importPrefix,
                                                                                                                                 org.kie.dmn.api.core.DMNType type,
                                                                                                                                 SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts,
                                                                                                                                 org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType)
                                                                                                                          throws WrongDMNTypeException
        This method is the entry point for FactModelTree. It is the one to be called from the very top level DMNType
        Parameters:
        factName -
        type -
        hiddenFacts -
        fmType -
        Returns:
        Throws:
        WrongDMNTypeException
      • createFactModelTreeForCollection

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForCollection​(Map<String,​List<String>> genericTypeInfoMap,
                                                                                                                                      String factName,
                                                                                                                                      String importPrefix,
                                                                                                                                      org.kie.dmn.api.core.DMNType type,
                                                                                                                                      SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts,
                                                                                                                                      org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType,
                                                                                                                                      List<String> alreadyVisited)
                                                                                                                               throws WrongDMNTypeException
        Creates a FactModelTree for DMNType where DMNType.isCollection() == true
        Parameters:
        factName -
        type -
        hiddenFacts -
        fmType -
        Returns:
        Throws:
        WrongDMNTypeException - if DMNType.isCollection() != true
      • createFactModelTreeForNoCollection

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForNoCollection​(Map<String,​List<String>> genericTypeInfoMap,
                                                                                                                                        String factName,
                                                                                                                                        String importPrefix,
                                                                                                                                        String propertyName,
                                                                                                                                        String fullPropertyPath,
                                                                                                                                        org.kie.dmn.api.core.DMNType type,
                                                                                                                                        SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts,
                                                                                                                                        org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType,
                                                                                                                                        List<String> alreadyVisited)
                                                                                                                                 throws WrongDMNTypeException
        Creates a FactModelTree for DMNType where DMNType.isCollection() != true
        Parameters:
        propertyName -
        fullPropertyPath -
        type -
        hiddenFacts -
        fmType -
        Returns:
        Throws:
        WrongDMNTypeException - if DMNType.isCollection() == true
      • createFactModelTreeForGenericType

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForGenericType​(Map<String,​List<String>> genericTypeInfoMap,
                                                                                                                                       String factName,
                                                                                                                                       String importPrefix,
                                                                                                                                       String propertyName,
                                                                                                                                       String fullPropertyPath,
                                                                                                                                       org.kie.dmn.api.core.DMNType type,
                                                                                                                                       SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts,
                                                                                                                                       org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType,
                                                                                                                                       List<String> alreadyVisited)
                                                                                                                                throws WrongDMNTypeException
        Creates a FactModelTree for DMNType
        Parameters:
        propertyName -
        fullPropertyPath -
        type -
        hiddenFacts -
        fmType -
        Returns:
        Throws:
        WrongDMNTypeException
      • createFactModelTreeForSimple

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForSimple​(String factName,
                                                                                                                                  String importPrefix,
                                                                                                                                  String typeName,
                                                                                                                                  String propertyClass,
                                                                                                                                  Map<String,​List<String>> genericTypeInfoMap,
                                                                                                                                  org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType)
        Creates a FactModelTree for DMNType where DMNType.isComposite() != true. Returned FactModelTree will have only one single property, whose name is VALUE and whose value is the given propertyClass
        Parameters:
        genericTypeInfoMap -
        factName -
        propertyClass -
        fmType -
        Returns:
      • createFactModelTreeForComposite

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree createFactModelTreeForComposite​(Map<String,​List<String>> genericTypeInfoMap,
                                                                                                                                     String name,
                                                                                                                                     String importPrefix,
                                                                                                                                     String fullPropertyPath,
                                                                                                                                     org.kie.dmn.api.core.DMNType type,
                                                                                                                                     SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> hiddenFacts,
                                                                                                                                     org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree.Type fmType,
                                                                                                                                     List<String> alreadyVisited)
                                                                                                                              throws WrongDMNTypeException
        Creates a FactModelTree for DMNType where DMNType.isComposite() == true
        Parameters:
        name -
        fullPropertyPath -
        type -
        hiddenFacts -
        fmType -
        Throws:
        WrongDMNTypeException - if DMNType.isComposite() != true
      • checkTypeSupport

        protected void checkTypeSupport​(org.kie.dmn.api.core.DMNType type,
                                        org.drools.workbench.screens.scenariosimulation.backend.server.DMNTypeServiceImpl.ErrorHolder errorHolder,
                                        String fullPropertyPath)
        Recursively visit a composite DMNType to eventually detect and add errors to given ErrorHolder
        Parameters:
        type -
        errorHolder -
        fullPropertyPath -
      • internalCheckTypeSupport

        protected void internalCheckTypeSupport​(org.kie.dmn.api.core.DMNType type,
                                                boolean alreadyInCollection,
                                                org.drools.workbench.screens.scenariosimulation.backend.server.DMNTypeServiceImpl.ErrorHolder errorHolder,
                                                String fullPropertyPath,
                                                Set<String> alreadyVisited)