select(Callable selector)
This method selects all parameters matching a given selector.
- Arguments
selector
: A Python callable object.
- Return Value
- Returns a list-like Python object containing all parameters matching the selector.
The selector is passed each parameter in the data set. The parameters are formatted as
dictionary-like objects. The following example selects all input
parameters:
def inputFilter(param):
return param["role"] == "INPUT"
inputs= ParameterAPI.select(inputFilter)
PLMObject
parameters in the analytics case are not supported in the Parameter API.
createParameter(String role, String dataType, String structure, Integer priority,
Number priorityWeight, Number weightFactor, Number basketWeight, String dimensions, String
unit, String notes, String displayName, String name, String parentId)
This method creates a new parameter with specified attributes.
- Arguments
-
role
: The role of the new parameter. Values are
INPUT
, OUTPUT
, and
UNKNOWN
.
dataType
: The type of data to be added to the new parameter if
it does not contain string data. Values are INTEGER
,
REAL
, and BOOLEAN
.
structure
: The structure of the data in the new parameter.
Values are SCALAR
and ARRAY
.
priority
: The priority of the new parameter. This also defined
an initial rough weight, if weight is not defined. It must be an integer between 0
and 5.
weightFactor
: A number specifying the weight to be used in
scoring calculations.
dimensions
: The dimensions of the parameter if it is of type
ARRAY
.
unit
: The unit of the parameter, such as miles
or kg
.
notes
: Additional notes on the parameter.
displayName
: A short name to be displayed for the parameter.
name
will be used if displayName
is not
defined.
name
: The full name of the parameter.
parentId
: The ID of the group containing the parameter. The
parameter will be directly under the root group for the case if this is not
defined.
- Return Value
- Returns dictionary-like object representing the newly created parameter, including
an auto-generated ID field used to identify the parameter in many other methods.
The parameter must have a unique name attribute (specified by the key
name
in the attributes object). All other parameters are optional.
modifyParameter(String paramId, String role, String dataType, String structure, Integer
priority, String dimensions, String unit, String notes, String displayName, String name,
String parentId)
This method updates specified attributes on a specified parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
role
: The role of the parameter. Values are
INPUT
, OUTPUT
, and
UNKNOWN
.
dataType
: The type of data to be added to the parameter, if it
does not contain string data. Values are INTEGER
,
REAL
, and BOOLEAN
.
structure
: The structure of the data in the parameter. Values
are SCALAR
and ARRAY
.
priority
: The priority of the parameter. This also defined an
initial rough weight, if weight is not defined. This must be an integer between 0
and 5.
weightFactor
: A number specifying the weight to be used in
scoring calculations.
dimensions
: The dimensions of the parameter if it is of type
ARRAY
.
unit
: The unit of the parameter, such as miles
or kg
.
notes
: Additional notes on the parameter.
displayName
: A short name to be displayed for the parameter.
name
will be used if displayName
is not
defined.
name
: The full name of the parameter.
parentId
: The ID of the group containing the parameter. The
parameter will be directly under the root group for the case if this is not
defined.
- Return Value
- Returns a dictionary-like object representing the modified parameter.
All arguments other than
id
are optional. Arguments provided will
overwrite previously defined values, while parameter attributes for which no corresponding
argument is provided will retain their previous values.
modifyParameterRole(String paramId, String role)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
role
: The role of the parameter. Values are
INPUT
, OUTPUT
, and
UNKNOWN
.
- Return Value
- none
modifyParameterDataType(String paramId, String dataType)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
dataType
: The type of data to be added to the parameter, if it
does not contain string data. Values are INTEGER
,
REAL
, and BOOLEAN
.
- Return Value
- None.
modifyParameterStructure(String paramId, String structure)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
structure
: The structure of the data in the parameter. Values are
SCALAR
and ARRAY
.
- Return Value
- None.
modifyParameterPriority(String paramId, Integer priority)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
priority
: The priority of the parameter. This also defined an
initial rough weight, if weight is not defined. This must be an integer between 0
and 5.
- Return Value
- None.
modifyParameterDimensions(String paramId, String dimensions)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
dimensions
: The dimensions of the parameter if it is of type
ARRAY
.
- Return Value
- None.
modifyParameterUnit(String paramId, String unit)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
unit
: The unit of the parameter, such as miles
or kg
.
- Return Value
- None.
modifyParameterNotes(String paramId, String notes)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
notes
: Additional notes on the parameter.
- Return Value
- None.
modifyParameterDisplayName(String paramId, String displayName)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
displayName
: A short name to be displayed for the parameter.
name
will be used if displayName
is not
defined.
- Return Value
- None.
modifyParameterName(String paramId, String name)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
name
: The full name of the parameter.
- Return Value
- None.
modifyParameterParent(String paramId, String parentId)
This method modifies the role of a parameter.
- Arguments
-
paramId
: A string ID uniquely identifying one parameter.
parentId
: The ID of the group containing the parameter. The
parameter will be directly under the root group for the case if this is not
defined.
- Return Value
- None.
deleteParameter(String paramId)
This method deletes a specified parameter.
- Arguments
paramId
: A string ID uniquely identifying one parameter.
- Return Value
- None.
getIterator()
This method creates a new iterator for the set of all parameters.
- Arguments
- None.
- Return Value
- Returns a string used to uniquely identify the newly generated iterator.
PLMObject parameters in the analytics case are not supported in the Parameter API.
next(String iteratorId)
This method gets the next item for an iterator.
- Arguments
iteratorId
: The ID string returned by the
getIterator()
method.
- Return Value
- Returns a dictionary-like object describing the next item in the iterator.
hasNext(String iteratorId)
This method returns true if an iterator has at least one more item.
- Arguments
iteratorId
: The ID string returned by the
getIterator()
method.
- Return Value
- Returns true if the iterator has at least one more item.
getComments(String paramId)
This method returns all comments for a specified parameter.
- Arguments
paramId
: A string uniquely identifying a parameter.
- Return Value
- Returns a list-like object containing dictionaries describing all comments that have
been made on a specified parameter.
paramId
is the ID attribute on parameter objects, such as those
returned by the
select
or next methods.
addComment(String paramId, String text, String parentId)
This method adds a comment on a parameter or a subcomment on a parameter comment.
- Arguments
-
paramId
: A string identifying the parameter for which the
comment should be defined.
text
: The text content of the comment.
parentId
: An optional parameter defining a parent comment under
which the comment should be added. This is used only for defining
subcomments.
- Return Value
- Returns a dictionary-like object describing the newly added comment.
The
parentId
attribute is optional.
The parentId
attribute is the ID attribute on the comment objects returned
by comment methods in the Parameter API, such as addComment()
or
getComments()
.
The paramId
attribute is the ID attribute on parameter objects, such as
those returned by the select()
or next()
methods.
removeComment(String paramId, String commentId)
This method removes a comment from a parameter or a subcomment from a parameter comment.
- Arguments
-
paramId
: A string identifying the parent parameter of the
comment to be deleted.
commentId
: A string identifying the comment to be deleted.
- Return Value
- Returns a list-like object containing all remaining comments that exists on the
parameter.
The
commentId
attribute is the ID attribute on the comment objects
returned by comment methods in the Parameter API, such as
addComment()
or
getComments()
.
The paramId
attribute is the ID attribute on parameter objects, such as
those returned by the select()
or next()
methods.
getLikesForComment(String paramId, String commentId)
This method gets all likes for a specified comment on a specified parameter.
- Arguments
-
paramId
: A string identifying the parent parameter of the
comment.
commentId
: A string identifying the comment.
- Return Value
- Returns a list-like object containing all likes that users have made on the
specified comment.
The
commentId
attribute is the ID attribute on the comment objects
returned by comment methods in the Parameter API, such as
addComment()
or
getComments()
.
The paramId
attribute is the ID attribute on parameter objects, such as
those returned by the select()
or next()
methods.
addLikeForComment(String paramId, String commentId)
This method adds a like for the current user on a specified comment for a specified parameter.
- Arguments
-
paramId
: A string identifying the parent parameter of the
comment.
commentId
: A string identifying the comment.
- Return Value
- Returns a list-like object containing all likes that users have made on the
specified comment.
The
commentId
attribute is the ID attribute on the comment objects
returned by
comment
methods in the Parameter API, such as
addComment()
or
getComments()
.
The paramId
attribute is the ID attribute on parameter objects, such as
those returned by the select()
or next()
methods.
removeLikeForComment(String paramId, String commentId)
This method removes a like for the current user on a specified comment for a specified parameter.
- Arguments
-
paramId
: A string identifying the parent parameter of the
comment.
commentId
: A string identifying the comment.
- Return Value
- Returns a list-like object containing all likes that users have made on the
specified comment.
The
commentId
attribute is the ID attribute on the comment objects
returned by comment methods in the Parameter API, such as
addComment()
or
getComments()
.
The paramId
attribute is the ID attribute on parameter objects, such as
those returned by the select()
or next()
methods.
createGroup(String displayName, String parentId, Integer priority, Number
weightFactor)
This method creates a new empty group.
- Arguments
-
displayName
: The name to be displayed for the new group.
parentId
: An optional argument identifying a parent group under
which the new group will be created. If no parentId
is provided,
the parent group will be the root group for the analytics case.
priority
: The priority of the group. It must be an integer
between 0 and 5.
weightFactor
: An optional argument specifying the weighting
factor for the group.
- Return Value
- Returns a dictionary-like object describing the newly created group.
modifyGroup(String groupId, String displayName, String parentId, Number weightFactor,
Number basketWeight, Integer priority)
This method modifies a specified existing group.
- Arguments
-
groupId
: A string identifying the group.
displayName
: The name to be displayed for the new group.
priority
: The priority of the group. It must be an integer
between 0 and 5.
weightFactor
: An optional argument specifying the weighting
factor for the group.
parentId
: An optional argument identifying a parent group under
which the new group will be created. If no parentId
is provided,
the parent group will be the root group for the analytics case.
- Return Value
- Returns a dictionary-like object describing the updated group.
modifyGroupDisplayName(String groupId, String displayName)
- Arguments
-
paramId
: A string identifying the group.
displayName
: The display name of the group.
modifyGroupPriority(String groupId, Integer priority)
- Arguments
-
paramId
: A string identifying the group.
priority
: The priority of the group. It must be an integer
between 0 and 5.
modifyGroupWeightFactor(String groupId, Number weightFactor)
- Arguments
-
paramId
: A string identifying the group.
weightFactor
: An optional argument specifying the weighting
factor for the group.
modifyGroupParent(String groupId, String parentId)
- Arguments
-
paramId
: A string identifying the group.
parentId
: An optional argument identifying a parent group under
which the new group will be created. If no parentId
is provided,
the parent group will be the root group for the analytics case.
getGroup(String groupId)
This method returns a specified group.
- Arguments
groupId
: A string identifying an existing group.
- Return Value
- Returns a dictionary-like object describing the group.
removeGroup(String groupId)
This method deletes a specified group.
- Arguments
groupId
: A string identifying an existing group.
- Return Value
- None.
All group and parameter children of the removed group are appended as children of the
parent group of the removed group.