Class AasIvmlMapper

  • All Implemented Interfaces:
    DecisionVariableProvider

    public class AasIvmlMapper
    extends AbstractIvmlModifier
    Maps an IVML configuration generically into an AAS with references to IIP-Ecosphere.
    Author:
    Holger Eichelberger, SSE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addMetaDefault​(net.ssehub.easy.varModel.confModel.IDecisionVariable var, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
      Adds the default value of var if there is a default value.
      private void addMetaDefault​(net.ssehub.easy.varModel.model.AbstractVariable decl, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
      Adds the default value of var if there is a default value.
      private void addMetaProperties​(net.ssehub.easy.varModel.confModel.IDecisionVariable var, net.ssehub.easy.varModel.model.datatypes.IDatatype varType, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
      Adds the meta properties of var of type varType to varBuilder.
      private void addOperations​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder, de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)
      Adds the default AAS operations for obtaining information on the configuration model / changing the model.
      private static void bind​(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
      Binds the AAS operations (ensure static lambda functions).
      void bindOperations​(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
      Binds the AAS operations.
      private static AasIvmlMapper.ServiceMap collectServices​(net.ssehub.easy.varModel.confModel.Configuration cfg, net.ssehub.easy.varModel.model.datatypes.IDatatype serviceType)
      Collects all declared services.
      private void createAppProject​(java.lang.String appName, java.lang.String appValueEx, AasIvmlMapper.ModelResults results)
      Writes an application project with the given new mesh variable.
      private PlatformInstantiator.InstantiationConfigurer createInstantiationConfigurer​(AasIvmlMapper.InstantiationMode mode, java.lang.String appId, java.lang.String fileName)
      Creates an instantiation configurer from ConfigurationSetup to create application code.
      protected java.io.File createIvmlConfigPath​(java.lang.String subpath, net.ssehub.easy.varModel.model.Project project)
      Creates an IVML configuration (not meta-model) model path with subpath and for project p.
      private void createMeshProject​(java.lang.String appName, java.lang.String meshName, IvmlGraphMapper.IvmlGraph graph, AasIvmlMapper.ModelResults results)
      Creates a mesh project for graph.
      private static de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder createTypeCollectionBuilder​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder, java.lang.String typeName)
      Creates a AAS collection representing an IVML type.
      private static void deleteAasVariableMapping​(de.iip_ecosphere.platform.support.aas.Submodel sm, java.lang.String typeName, java.lang.String varName)
      Deletes the mapping of the specified variable in the AAS.
      java.lang.Object deleteGraph​(java.lang.String appName, java.lang.String meshName)
      Deletes a graph structure in IVML.
      private net.ssehub.easy.varModel.model.values.ContainerValue deleteReferenceFromContainerValue​(net.ssehub.easy.varModel.confModel.IDecisionVariable var, net.ssehub.easy.varModel.model.AbstractVariable search)
      Deletes a reference from a container value and sets the new value.
      private net.ssehub.easy.varModel.model.Project findOrCreateProject​(net.ssehub.easy.varModel.model.Project scope, java.lang.String projectName, boolean find)
      Finds an existing IVML project in scope with given name or creates a new one with default freeze block.
      private static net.ssehub.easy.varModel.model.AbstractVariable findServiceVar​(AasIvmlMapper.ServiceMap services, java.lang.String name)
      Finds a service as IVML variable.
      private java.lang.String getApplicationProjectName​(java.lang.String appName)
      Returns the IVML project name for an application.
      private java.io.File getIvmlConfigFolder​(EasySetup ep)
      Returns the actual IVML config folder.
      protected net.ssehub.easy.varModel.confModel.Configuration getIvmlConfiguration()
      Returns the actual IVML configuration.
      protected java.lang.String getIvmlSubpath​(net.ssehub.easy.varModel.model.Project project)
      Returns the IVML subpath for the given project.
      (package private) static java.lang.String getLang()
      Returns the language to be used for LangString.
      private java.lang.String getMeshProjectName​(java.lang.String appName, java.lang.String meshName)
      Returns the IVML project name for a service mesh.
      private static java.lang.Object getValue​(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
      Returns the value of a variable.
      protected net.ssehub.easy.varModel.model.Project getVariableTarget​(net.ssehub.easy.varModel.model.Project root, net.ssehub.easy.varModel.model.datatypes.IDatatype type)
      Returns the target for a variable to be created.
      protected net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration getVilConfiguration()
      Returns the actual VIL configuration.
      private java.lang.Object instantiate​(PlatformInstantiator.InstantiationConfigurer configurer)
      Instantiates according to the given configurer.
      protected boolean isAllowedForModification​(net.ssehub.easy.varModel.model.Project prj)
      Returns whether the given project is allowed for modification (other than root).
      private static boolean isNonEmptyString​(java.lang.String string)
      Returns whether string is a non-empty string.
      private static boolean isRefWithName​(java.lang.String name, net.ssehub.easy.varModel.confModel.Configuration cfg, net.ssehub.easy.varModel.model.values.Value mVal)
      Returns if mVal is a reference to a variable with a field name with value name.
      void mapByType​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder, de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)
      Maps cfg into the submodel represented by smBuilder.
      private static java.lang.String mapParent​(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
      Returns the name of the parent project of var while considering PARENT_MAPPING.
      private net.ssehub.easy.varModel.model.datatypes.Compound mapType​(net.ssehub.easy.varModel.model.datatypes.Compound type)
      Maps the type of an IVML variable into the configuration submodel, usually searching for the top-most parent of compound types.
      private net.ssehub.easy.varModel.model.datatypes.IDatatype mapType​(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
      Maps the type of an IVML variable into the configuration submodel, usually searching for the top-most parent of compound types.
      (package private) void mapVariable​(net.ssehub.easy.varModel.confModel.IDecisionVariable var, de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder builder, java.lang.String id)
      Maps a single variable var into builder.
      private void mapVariableToAas​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB, net.ssehub.easy.varModel.confModel.IDecisionVariable var)
      Maps var into the submodel represented by smB.
      protected void reloadConfiguration()
      Reloads the configuration model.
      java.lang.Object setGraph​(java.lang.String appName, java.lang.String appValueEx, java.lang.String meshName, java.lang.String format, java.lang.String value)
      Changes an application/graph structure in IVML.
      private static void setSemanticId​(de.iip_ecosphere.platform.support.aas.Property.PropertyBuilder pBuilder, java.lang.String semanticId)
      Sets a semantic id if available.
      void setShortIdToMeta​(java.util.function.Function<java.lang.String,​java.lang.String> metaShortId)
      Defines a function that turns an IVML name for a meta value, e.g., type or status, into an AAS short id candidate.
      void setVariableFilter​(java.util.function.Predicate<net.ssehub.easy.varModel.model.AbstractVariable> variableFilter)
      Defines a predicate acting as IVML variable filter, i.e., variables to be included into the configuration AAS.
      private static java.lang.String toId​(java.lang.String string)
      Turns string into an identifier, i.e., each non-Java identifier characters into a "_".
      protected net.ssehub.easy.reasoning.core.reasoner.ReasoningResult validateAndPropagate()
      Validates the model and propagates values within the model.
      private java.lang.String validateName​(IvmlGraphMapper.IvmlGraphNode node, int count)
      Validates the name of a node and if there is none, sets a pseudo name based on count.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OP_CHANGE_VALUES

        public static final java.lang.String OP_CHANGE_VALUES
        See Also:
        Constant Field Values
      • OP_CREATE_VARIABLE

        public static final java.lang.String OP_CREATE_VARIABLE
        See Also:
        Constant Field Values
      • OP_DELETE_VARIABLE

        public static final java.lang.String OP_DELETE_VARIABLE
        See Also:
        Constant Field Values
      • OP_GEN_INTERFACES

        public static final java.lang.String OP_GEN_INTERFACES
        See Also:
        Constant Field Values
      • OP_GEN_APPS_NO_DEPS

        public static final java.lang.String OP_GEN_APPS_NO_DEPS
        See Also:
        Constant Field Values
      • FILTER_NO_CONSTRAINT_VARIABLES

        public static final java.util.function.Predicate<net.ssehub.easy.varModel.model.AbstractVariable> FILTER_NO_CONSTRAINT_VARIABLES
      • SHORTID_PREFIX_META

        public static final java.util.function.Function<java.lang.String,​java.lang.String> SHORTID_PREFIX_META
      • PRJ_NAME_ALLCONSTANTS

        protected static final java.lang.String PRJ_NAME_ALLCONSTANTS
        See Also:
        Constant Field Values
      • PRJ_NAME_ALLSERVICES

        protected static final java.lang.String PRJ_NAME_ALLSERVICES
        See Also:
        Constant Field Values
      • PRJ_NAME_ALLTYPES

        protected static final java.lang.String PRJ_NAME_ALLTYPES
        See Also:
        Constant Field Values
      • PRJ_NAME_TECHSETUP

        protected static final java.lang.String PRJ_NAME_TECHSETUP
        See Also:
        Constant Field Values
      • PROJECT_MAPPING

        private static final java.util.Map<java.lang.String,​java.lang.String> PROJECT_MAPPING
      • PARENT_MAPPING

        private static final java.util.Map<java.lang.String,​java.lang.String> PARENT_MAPPING
      • TYPE_VISITOR

        private static final TypeVisitor TYPE_VISITOR
      • PROGRESS_COMPONENT_ID

        private static final java.lang.String PROGRESS_COMPONENT_ID
        See Also:
        Constant Field Values
      • cfgSupplier

        private java.util.function.Supplier<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration> cfgSupplier
      • metaShortId

        private java.util.function.Function<java.lang.String,​java.lang.String> metaShortId
      • variableFilter

        private java.util.function.Predicate<net.ssehub.easy.varModel.model.AbstractVariable> variableFilter
      • types

        private java.util.Map<java.lang.String,​de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder> types
    • Constructor Detail

      • AasIvmlMapper

        public AasIvmlMapper​(java.util.function.Supplier<net.ssehub.easy.instantiation.core.model.vilTypes.configuration.Configuration> cfgSupplier,
                             IvmlGraphMapper graphMapper,
                             AbstractIvmlModifier.ConfigurationChangeListener changeListener)
        Creates a mapper with default settings, e.g., short ids for meta IVML information are prefixed by "meta" (SHORTID_PREFIX_META) and the variable filter excludes all IVML constraint variables (FILTER_NO_CONSTRAINT_VARIABLES).
        Parameters:
        cfgSupplier - a supplier providing the actual configuration instance
        graphMapper - maps a graph from IVML to an internal structure
        changeListener - optional configuration change listener, may be null
        Throws:
        java.lang.IllegalArgumentException - if cfgSupplier is null
    • Method Detail

      • mapParent

        private static java.lang.String mapParent​(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
        Returns the name of the parent project of var while considering PARENT_MAPPING. If there is no mapping, the name of the parent project is returned.
        Parameters:
        var - the variable to map
        Returns:
        the (mapped) name of the (declaring) parent project
      • setShortIdToMeta

        public void setShortIdToMeta​(java.util.function.Function<java.lang.String,​java.lang.String> metaShortId)
        Defines a function that turns an IVML name for a meta value, e.g., type or status, into an AAS short id candidate. The result of a function call will be validated by AasUtils.fixId(String). The default value is to prefix a given name with "meta".
        Parameters:
        metaShortId - the functor, ignored if null
      • setVariableFilter

        public void setVariableFilter​(java.util.function.Predicate<net.ssehub.easy.varModel.model.AbstractVariable> variableFilter)
        Defines a predicate acting as IVML variable filter, i.e., variables to be included into the configuration AAS.
        Parameters:
        variableFilter - the predicate, ignored if null
      • mapByType

        public void mapByType​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder,
                              de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)
        Maps cfg into the submodel represented by smBuilder.
        Parameters:
        smBuilder - the submodel builder representing the target
        iCreator - the invocables creator for operations
      • mapType

        private net.ssehub.easy.varModel.model.datatypes.IDatatype mapType​(net.ssehub.easy.varModel.model.datatypes.IDatatype type)
        Maps the type of an IVML variable into the configuration submodel, usually searching for the top-most parent of compound types.
        Parameters:
        type - the type to map
        Returns:
        the mapped type, may be type
      • mapType

        private net.ssehub.easy.varModel.model.datatypes.Compound mapType​(net.ssehub.easy.varModel.model.datatypes.Compound type)
        Maps the type of an IVML variable into the configuration submodel, usually searching for the top-most parent of compound types.
        Parameters:
        type - the type to map
        Returns:
        the mapped type, may be type
      • createTypeCollectionBuilder

        private static de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder createTypeCollectionBuilder​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder,
                                                                                                                                                    java.lang.String typeName)
        Creates a AAS collection representing an IVML type.
        Parameters:
        smBuilder - the submodel builder
        typeName - the type name (turned into an AAS shortID)
        Returns:
        the collection builder
      • bindOperations

        public void bindOperations​(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
        Binds the AAS operations.
        Parameters:
        sBuilder - the server builder
      • bind

        private static void bind​(de.iip_ecosphere.platform.support.aas.ProtocolServerBuilder sBuilder)
        Binds the AAS operations (ensure static lambda functions).
        Parameters:
        sBuilder - the server builder
      • instantiate

        private java.lang.Object instantiate​(PlatformInstantiator.InstantiationConfigurer configurer)
                                      throws java.util.concurrent.ExecutionException
        Instantiates according to the given configurer.
        Parameters:
        configurer - the configurer
        Returns:
        null
        Throws:
        java.util.concurrent.ExecutionException - when the instantiation fails
      • createInstantiationConfigurer

        private PlatformInstantiator.InstantiationConfigurer createInstantiationConfigurer​(AasIvmlMapper.InstantiationMode mode,
                                                                                           java.lang.String appId,
                                                                                           java.lang.String fileName)
        Creates an instantiation configurer from ConfigurationSetup to create application code.
        Parameters:
        mode - the instantiation mode
        appId - the id of the application to instantiate, may be empty or null for none
        fileName - the name of the implementation artifact to integrate, may be empty or null for none
        Returns:
        the configurer
      • getVariableTarget

        protected net.ssehub.easy.varModel.model.Project getVariableTarget​(net.ssehub.easy.varModel.model.Project root,
                                                                           net.ssehub.easy.varModel.model.datatypes.IDatatype type)
        Description copied from class: AbstractIvmlModifier
        Returns the target for a variable to be created.
        Overrides:
        getVariableTarget in class AbstractIvmlModifier
        Parameters:
        root - the root project (may be used as default)
        type - the actual type of the variable to be created, may be null then anyway no variable will be created
        Returns:
        the target project
        See Also:
        AbstractIvmlModifier.isAllowedForModification(Project prj)
      • getIvmlSubpath

        protected java.lang.String getIvmlSubpath​(net.ssehub.easy.varModel.model.Project project)
        Description copied from class: AbstractIvmlModifier
        Returns the IVML subpath for the given project.
        Specified by:
        getIvmlSubpath in class AbstractIvmlModifier
        Parameters:
        project - the project
        Returns:
        the subpath, may be null for a top-level or a non-writable project, may be empty for the top-level folder or a sub-folder
      • getIvmlConfigFolder

        private java.io.File getIvmlConfigFolder​(EasySetup ep)
        Returns the actual IVML config folder.
        Parameters:
        ep - the EASy setup instance
        Returns:
        the config folder
      • createIvmlConfigPath

        protected java.io.File createIvmlConfigPath​(java.lang.String subpath,
                                                    net.ssehub.easy.varModel.model.Project project)
        Description copied from class: AbstractIvmlModifier
        Creates an IVML configuration (not meta-model) model path with subpath and for project p.
        Specified by:
        createIvmlConfigPath in class AbstractIvmlModifier
        Parameters:
        subpath - the subpath, may be null for none
        project - the project to create the path for
        Returns:
        the file name/path
        See Also:
        AbstractIvmlModifier.getIvmlSubpath(Project)
      • deleteGraph

        public java.lang.Object deleteGraph​(java.lang.String appName,
                                            java.lang.String meshName)
                                     throws java.util.concurrent.ExecutionException
        Deletes a graph structure in IVML. [public for testing]
        Parameters:
        appName - the configured name of the application
        meshName - the configured name of the service mesh to delete a specific mesh in appName, may be null or empty to delete the entire app
        Returns:
        null always
        Throws:
        java.util.concurrent.ExecutionException - if setting the graph structure fails
      • deleteReferenceFromContainerValue

        private net.ssehub.easy.varModel.model.values.ContainerValue deleteReferenceFromContainerValue​(net.ssehub.easy.varModel.confModel.IDecisionVariable var,
                                                                                                       net.ssehub.easy.varModel.model.AbstractVariable search)
                                                                                                throws java.util.concurrent.ExecutionException
        Deletes a reference from a container value and sets the new value.
        Parameters:
        var - the variable to take the value from, may be null
        search - the variable declaration to search the reference for
        Returns:
        the new container value, may be null for not found
        Throws:
        java.util.concurrent.ExecutionException - if re-assigning the value fails
      • isNonEmptyString

        private static boolean isNonEmptyString​(java.lang.String string)
        Returns whether string is a non-empty string.
        Parameters:
        string - the string to test
        Returns:
        true for a non-empty string, false for an empty string or null
      • setGraph

        public java.lang.Object setGraph​(java.lang.String appName,
                                         java.lang.String appValueEx,
                                         java.lang.String meshName,
                                         java.lang.String format,
                                         java.lang.String value)
                                  throws java.util.concurrent.ExecutionException
        Changes an application/graph structure in IVML. Application/mesh files are dynamically linked and require a different approach as, e.g., constants. [public for testing]
        Parameters:
        appName - the configured name of the application
        appValueEx - the application value as IVML expression
        meshName - the configured name of the service mesh (may be null or empty for none; used as import resolution if given, existing and format or value are not given).
        format - the format of the graph (may be null or empty for none).
        value - the value (may be null or empty for none).
        Returns:
        null always
        Throws:
        java.util.concurrent.ExecutionException - if setting the graph structure fails
      • getApplicationProjectName

        private java.lang.String getApplicationProjectName​(java.lang.String appName)
        Returns the IVML project name for an application.
        Parameters:
        appName - the application name
        Returns:
        the project name
      • getMeshProjectName

        private java.lang.String getMeshProjectName​(java.lang.String appName,
                                                    java.lang.String meshName)
        Returns the IVML project name for a service mesh.
        Parameters:
        appName - the application name
        meshName - the configured name of the service mesh
        Returns:
        the project name
      • createAppProject

        private void createAppProject​(java.lang.String appName,
                                      java.lang.String appValueEx,
                                      AasIvmlMapper.ModelResults results)
                               throws net.ssehub.easy.varModel.model.ModelQueryException,
                                      net.ssehub.easy.basics.modelManagement.ModelManagementException,
                                      java.util.concurrent.ExecutionException
        Writes an application project with the given new mesh variable.
        Parameters:
        appName - the application name
        appValueEx - the IVML value expression for the application
        results - collected result information
        Throws:
        net.ssehub.easy.varModel.model.ModelQueryException - if IVML types/variables cannot be found
        net.ssehub.easy.basics.modelManagement.ModelManagementException - if IVML types/variables cannot be found
        java.util.concurrent.ExecutionException - if the application value cannot be set
      • isRefWithName

        private static boolean isRefWithName​(java.lang.String name,
                                             net.ssehub.easy.varModel.confModel.Configuration cfg,
                                             net.ssehub.easy.varModel.model.values.Value mVal)
        Returns if mVal is a reference to a variable with a field name with value name.
        Parameters:
        name - the name to look for
        cfg - the configuration to resolve the reference
        mVal - the value possibly containing a reference value
        Returns:
        true if it is a reference with the desired property, false else
      • validateAndPropagate

        protected net.ssehub.easy.reasoning.core.reasoner.ReasoningResult validateAndPropagate()
        Description copied from class: AbstractIvmlModifier
        Validates the model and propagates values within the model.
        Specified by:
        validateAndPropagate in class AbstractIvmlModifier
        Returns:
        the reasoning result
      • findOrCreateProject

        private net.ssehub.easy.varModel.model.Project findOrCreateProject​(net.ssehub.easy.varModel.model.Project scope,
                                                                           java.lang.String projectName,
                                                                           boolean find)
        Finds an existing IVML project in scope with given name or creates a new one with default freeze block.
        Parameters:
        scope - the scope to look for
        projectName - the project name
        find - try to find the project or directly create a new project
        Returns:
        the project, created or found
      • validateName

        private java.lang.String validateName​(IvmlGraphMapper.IvmlGraphNode node,
                                              int count)
        Validates the name of a node and if there is none, sets a pseudo name based on count.
        Parameters:
        node - the node to validate
        count - unique node counter per mesh
        Returns:
        the name of node
      • toId

        private static java.lang.String toId​(java.lang.String string)
        Turns string into an identifier, i.e., each non-Java identifier characters into a "_".
        Parameters:
        string - the string to be checked
        Returns:
        the validated string, potentially modified to be an id
      • createMeshProject

        private void createMeshProject​(java.lang.String appName,
                                       java.lang.String meshName,
                                       IvmlGraphMapper.IvmlGraph graph,
                                       AasIvmlMapper.ModelResults results)
                                throws net.ssehub.easy.varModel.model.ModelQueryException,
                                       net.ssehub.easy.basics.modelManagement.ModelManagementException,
                                       java.util.concurrent.ExecutionException
        Creates a mesh project for graph.
        Parameters:
        appName - the application name
        meshName - the mesh name
        graph - the graph to create the mesh project for
        results - the results to be modified as a side effect
        Throws:
        net.ssehub.easy.varModel.model.ModelQueryException - if IVML types/variables cannot be found
        net.ssehub.easy.basics.modelManagement.ModelManagementException - if IVML types/variables cannot be found
        java.util.concurrent.ExecutionException - if setting IVML values fails
      • collectServices

        private static AasIvmlMapper.ServiceMap collectServices​(net.ssehub.easy.varModel.confModel.Configuration cfg,
                                                                net.ssehub.easy.varModel.model.datatypes.IDatatype serviceType)
        Collects all declared services.
        Parameters:
        cfg - the configuration to take the services from
        serviceType - the IVML data type used to select services
        Returns:
        a mapping between service names and configured IVML variables
      • findServiceVar

        private static net.ssehub.easy.varModel.model.AbstractVariable findServiceVar​(AasIvmlMapper.ServiceMap services,
                                                                                      java.lang.String name)
        Finds a service as IVML variable.
        Parameters:
        services - the mapped services
        name - the service name to search for
        Returns:
        the service IVML variable, or null for not found
      • addOperations

        private void addOperations​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smBuilder,
                                   de.iip_ecosphere.platform.support.aas.InvocablesCreator iCreator)
        Adds the default AAS operations for obtaining information on the configuration model / changing the model.
        Parameters:
        smBuilder - the submodel builder representing the target
        iCreator - the invocables creator for operations
      • getLang

        static java.lang.String getLang()
        Returns the language to be used for LangString.
        Returns:
        the language
      • mapVariable

        void mapVariable​(net.ssehub.easy.varModel.confModel.IDecisionVariable var,
                         de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder builder,
                         java.lang.String id)
        Maps a single variable var into builder.
        Parameters:
        var - the variable to map as source
        builder - the builder as target (representing the parent of var)
        id - the id to use as variable name instead of the variable name itself, may be null for the variable name
      • addMetaDefault

        private void addMetaDefault​(net.ssehub.easy.varModel.confModel.IDecisionVariable var,
                                    de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
        Adds the default value of var if there is a default value.
        Parameters:
        var - the variable to take the default value from
        varBuilder - the variable builder to add the meta-value to
      • addMetaDefault

        private void addMetaDefault​(net.ssehub.easy.varModel.model.AbstractVariable decl,
                                    de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
        Adds the default value of var if there is a default value.
        Parameters:
        decl - the variable declaration to take the default value from
        varBuilder - the variable builder to add the meta-value to
      • addMetaProperties

        private void addMetaProperties​(net.ssehub.easy.varModel.confModel.IDecisionVariable var,
                                       net.ssehub.easy.varModel.model.datatypes.IDatatype varType,
                                       de.iip_ecosphere.platform.support.aas.SubmodelElementCollection.SubmodelElementCollectionBuilder varBuilder)
        Adds the meta properties of var of type varType to varBuilder.
        Parameters:
        var - the variable to take the meta-properties from
        varType - the type of var (as we already have determined it)
        varBuilder - the AAS builder representing var to add the AAS properties to
      • setSemanticId

        private static void setSemanticId​(de.iip_ecosphere.platform.support.aas.Property.PropertyBuilder pBuilder,
                                          java.lang.String semanticId)
        Sets a semantic id if available.
        Parameters:
        pBuilder - the property builder
        semanticId - the semantic id, may be null
      • getValue

        private static java.lang.Object getValue​(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
        Returns the value of a variable.
        Parameters:
        var - the variable
        Returns:
        the value
      • deleteAasVariableMapping

        private static void deleteAasVariableMapping​(de.iip_ecosphere.platform.support.aas.Submodel sm,
                                                     java.lang.String typeName,
                                                     java.lang.String varName)
        Deletes the mapping of the specified variable in the AAS.
        Parameters:
        sm - the submodel to delete from
        typeName - the type name
        varName - the variable name
      • mapVariableToAas

        private void mapVariableToAas​(de.iip_ecosphere.platform.support.aas.Submodel.SubmodelBuilder smB,
                                      net.ssehub.easy.varModel.confModel.IDecisionVariable var)
        Maps var into the submodel represented by smB.
        Parameters:
        smB - the submodel builder
        var - the variable