Interface DependencyProvider
-
- All Known Implementing Classes:
NodeDependencyProvider
,VolatileNodeDependencyProvider
public interface DependencyProvider
ADependencyProvider
establishes the context forSystemDataConsumer
s and provides dependency-related information about them. This allows to implement editors (like theStaffAssignmentRuleDialogue
) forSystemDataConsumer
s in a generic way, without having to know any details about which kinds of dependency types exist, what contextual arguments they have or what would be a suitable label text.- Author:
- Patrick Schmidt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Pair<ProcessConstants.AdeptDataType,String>
getCompleteDataTypeOf(String parameterName)
Returns the data type (including the UDT name if appropriate) of the parameter with the specified name ornull
if the parameter does not exist.Dependency
getDependencyOf(String parameterName)
Returns dependency-related information about the parameter with the specified name ornull
if the parameter has currently no dependency bound to it or the parameter does not exist.Map<Dependency,String>
getDependencyTypeArguments(Object dependencyType, ProcessConstants.AdeptDataType dataType, String udtName)
The same asgetDependencyTypeArguments(Object, de.aristaflow.adept2.model.globals.ProcessConstants.AdeptDataType, UUID)
but restricting based on the designated UDT name instead of the identifier ID.Map<Dependency,String>
getDependencyTypeArguments(Object dependencyType, ProcessConstants.AdeptDataType dataType, UUID identifierID)
Returns all available dependencies for the specified dependency type in a map.Map<Object,String>
getDependencyTypes(ProcessConstants.AdeptDataType dataType, UUID identifierID)
Returns all available dependency types in a map.String
getLabelForArgument(Dependency dependency)
Returns a label text for argument of the designated dependency.String
getLabelForType(Object dependencyType)
Returns a label text for the given dependency type.String
getLabelForTypeAndArgument(Dependency dependency)
Returns a label text for the designated dependency.ParameterRef[]
getParameters()
Returns all already existing parameters.ParameterRef
getPreferredParameter(Dependency dependency)
Returns the preferred parameter name and type for the specified dependency.boolean
parameterExists(String parameterName)
Returns whether a parameter with the specified name already exists.
-
-
-
Method Detail
-
getParameters
ParameterRef[] getParameters()
Returns all already existing parameters. UsegetDependencyOf(String)
to retrieve dependency information about each parameter.- Returns:
- all already existing parameters
-
parameterExists
boolean parameterExists(String parameterName)
Returns whether a parameter with the specified name already exists.- Parameters:
parameterName
- name of the parameter to be looked for- Returns:
- whether a parameter with the specified name already exists
-
getDependencyOf
Dependency getDependencyOf(String parameterName)
Returns dependency-related information about the parameter with the specified name ornull
if the parameter has currently no dependency bound to it or the parameter does not exist.- Parameters:
parameterName
- the name of the parameter for which to return dependency-related information- Returns:
- dependency-related information for the specified parameter
-
getCompleteDataTypeOf
Pair<ProcessConstants.AdeptDataType,String> getCompleteDataTypeOf(String parameterName)
Returns the data type (including the UDT name if appropriate) of the parameter with the specified name ornull
if the parameter does not exist.- Parameters:
parameterName
- the name of the parameter for which to return dependency-related information- Returns:
- The data type including the UDT name of the specified parameter. If
the designated parameter does not exist,
null
will be returned. If the designated parameter is notProcessConstants.AdeptDataType.USERDEFINED
, the second element of the pair will benull
.
-
getDependencyTypes
Map<Object,String> getDependencyTypes(ProcessConstants.AdeptDataType dataType, UUID identifierID)
Returns all available dependency types in a map. This number of dependency types can optionally be limited by specifying adata type
and (also optionally} an identifier ID.The dependency types are represented by objects and used as keys in the maps. The value is a label text created by
getLabelForType(Object)
.The map should have a specific, consistent order (-> e.g.
LinkedHashMap
).- Parameters:
dataType
- data type to limit the number of returned dependency types; may benull
for no restrictionidentifierID
- identifier ID to further limit the number of returned dependency types; may benull
for no restriction- Returns:
- all available dependency types in a map (matching the optionally specified data type and identifier ID)
-
getDependencyTypeArguments
Map<Dependency,String> getDependencyTypeArguments(Object dependencyType, ProcessConstants.AdeptDataType dataType, UUID identifierID)
Returns all available dependencies for the specified dependency type in a map. The arguments are the dependencies while the value is a label text created bygetLabelForType(Object)
.If the dependency type does not need any arguments a singleton map with
null
as key is returned. If the returned map is empty this means that there are no valid arguments which basically renders the dependency type unusable in the current context.The map should have a specific, consistent order (-> e.g.
LinkedHashMap
).- Parameters:
dependencyType
- the dependency type for which to return available argumentsdataType
- data type to limit the number of returned dependency type argumentsidentifierID
- identifier ID to further limit the number of returned dependency type arguments; may benull
for no restriction- Returns:
- all arguments for the specified dependency type in a map (matching the optionally specified data type and identifier ID)
-
getDependencyTypeArguments
Map<Dependency,String> getDependencyTypeArguments(Object dependencyType, ProcessConstants.AdeptDataType dataType, String udtName)
The same asgetDependencyTypeArguments(Object, de.aristaflow.adept2.model.globals.ProcessConstants.AdeptDataType, UUID)
but restricting based on the designated UDT name instead of the identifier ID.- Parameters:
dependencyType
- The dependency type for which to return available arguments.dataType
- The data type to limit the number of returned dependency type arguments.udtName
- The name of the UDT (in case of a UDT) to limit the number of returned dependency type arguments. This may benull
.- Returns:
- All arguments for the specified dependency type in a map (matching the data type and UDT name).
-
getLabelForType
String getLabelForType(Object dependencyType)
Returns a label text for the given dependency type.- Parameters:
dependencyType
- dependency type for which to return a label- Returns:
- a label text for the given dependency type
-
getLabelForArgument
String getLabelForArgument(Dependency dependency)
Returns a label text for argument of the designated dependency.- Parameters:
dependency
- The dependency of which to receive a label of the argument.- Returns:
- A label text for the argument of the designated dependency.
-
getLabelForTypeAndArgument
String getLabelForTypeAndArgument(Dependency dependency)
Returns a label text for the designated dependency.- Parameters:
dependency
- the dependency for which to return a label- Returns:
- a label text for the given dependency
-
getPreferredParameter
ParameterRef getPreferredParameter(Dependency dependency)
Returns the preferred parameter name and type for the specified dependency. Each combination of dependency type and argument should have its own unique name. If a parameter for the dependency already exists, that parameter's name is returned instead, even if it doesn't have the preferred name. If the preferred name is already occupied by a parameter which is associated to a different dependency, a different parameter name is generated in a deterministic way.- Parameters:
dependency
- the dependency for which to return the preferred parameter name- Returns:
- the preferred parameter name for the specified dependency
-
-