Rules File
The rules file specifies the rules to be applied when transforming an upstream structure to the downstream structure. A rule is specified as a set of conditions that should match for the transformation to occur.
A rules file contains a set of conditions that must be met for the given transformation method to trigger. Before you begin defining the rules file, ensure that you have the information required for the conditions and transformation methods.
Conditions
What type of upstream part do you want to transfer?
What should be the attribute value on the upstream part, part usage, or part occurrence that you want to transfer?
Transformation Methods
What should be the type of downstream part under which you want to transfer the upstream part?
Do you want to transfer the upstream part by pasting, pasting as a new part, or pasting as a new branch?
What should be the attribute value of the downstream part under which the upstream part with a given attribute value should be transferred?
Is there any node in the upstream structure that you do not want to traverse?
Is there any node in the upstream structure that you do not want to transform?
Defining a Rules File
After collating the required information, add it in a structured way in a text file in the JSON format using the elements given below:
As given in the example, you can define multiple rules in a rules file. Each rule begins and ends within curly brackets ( { } ). A rule must contain a source type, and optionally, attributes. Different rules can be defined for different attributes of a single object type. The rule defined for a type is valid for its subtypes as well.
For more information on the transformation methods, see Solution.
You can add additional transformation methods in the rules file as appropriate. For more information, see the use cases listed in Use Cases: Generate Downstream Structure.
Key Points
If multiple rules are defined on an attribute, the first rule that matches is triggered. The subsequent rules are ignored.
You can add the elements in any order within the rule definition block. However, it is recommended to add the elements in the order shown in the example to make it easy to interpret.
Equivalent link, equivalent usage path link, and equivalent occurrence link are created during transformation.
Was this helpful?