About Derived Parameters and Function Formats
Derived parameters obtain their values via specified functions. The functions can be customized Java functions or default system functions. The following function formats are defined in the system:
dg_inherit_from_ancestor
Returns the value of the source parameter of the ancestor at the specified level. It uses the format_property, level, and default_format parameters:
format_property is the name of a parameter.
level is 0 or a positive integer. A value of 1 means the immediate parent. A value of 2 means the grandparent. A value of 0 means the top-level ancestor.
default_format is a function format (optional).
For example, dg_inherit_from_ancestor(rating, 1) returns the value of the rating parameter from the immediate parent.
dg_inherit_from_connected
Returns a value for the parameter by tracing through connections in the specified direction with the specified diagram type. It searches until an artifact with the specified source parameter at the specified level is found or until it reaches the level defined by the level parameter. It uses the direction, diagram_type_name, source, and level parameters:
direction is the direction in which to trace. Possible values are forward or reverse.
diagram_type_name is the name of the diagram type in which to trace.
source is the name of the source parameter. If this parameter is not defined, it defaults to the name of the parameter using the function.
level is 0 or a positive integer. A value of 1 means the connected port. A value of 2 means the port's parent. A value of 0 means the top-level ancestor. If not specified, it defaults to 1. The level parameter defines the maximum level that the function will be tracing for and not the level from which it will retrieve the parameter value. For example, when level=2 and the parameter exists on the port and on its parent, it retrieves the value from the port. This is the first level that it finds the parameter in the trace.
* 
This function will return parameter values only from one connected object. For example, when multiple wires are connected to the same port the required parameter value will be returned only from one wire.
dg_derive_from_enclosure
Returns the value of the source parameter of the graphically enclosed object with the specified source type. If no such graphically enclosed object is found, the function returns the specified default value. It uses the source_type, source_property, and default parameters:
source_type is the type path
source_property is the parameter name
default is the default value
For example,
dg_derive_from_enclosure(component!housing, location, unplaced) returns the value of the location parameter of any item of type component!housing that encloses this item. If there is no enclosing object, returns the value unplaced.
dg_derive_indirect
Returns the result of evaluating the value of the specified format parameter as a function format. If the object has no format parameter, or if the value is not a string, the function returns the result of evaluating the default format as a function format. It uses the format_property, and default_format parameters:
format_property is the name of a parameter
default_format is a function format (optional)
For example,
dg_derive_indirect(alternative_format,dg_inherit_from_ancestor(default, 0)) returns the value of evaluating dg_inherit_from_ancestor(default, 0). If a string parameter alternative_format has been specified, the function returns the result of evaluating the value.
dg_derive_indirect2
Returns the result of evaluating the value of the specified format parameter as a label format. If the object has no format parameter, or if the value is not a string, the function returns the result of evaluating the default format as a label format. It uses the format_property, and default_format parameters:
format_property is the name of a parameter.
default_format is a label format (optional).
For example,
dg_derive_indirect2(alternative_format, default) returns the result of evaluating the value if you set the string parameter alternative_format. Otherwise, it returns the value default, which is the result of evaluating default as a label format. If you use the returned value in dg_derive_indirect the error value *Procedure 'default' does not exist* is returned.
* 
dg_derive_indirect uses the second parameter as a function format. dg_derive_indirect2 uses the second parameter as a label format.
dg_derive_as_label
Returns the result of evaluating the specified format function as a label format. It uses the dg_derive_as_label(label_format) parameter. In this case, label_format is a label format, for example, [dg_xref].
* 
If you format a function in a user-defined Java method, enclose the function name in curly braces { }. For example, to use the static method user_derived from the class UserFunctions, specify the function name as {UserFunctions.user_derived}.