Loading Variant Specifications Using VariantLoadNavCriteriaBean API
You can load variant specification using a Java API provided out-of-the-box. To invoke the API, make a call similar to this in your Java code:
List<VariantSpecLoadOutputBean> resultBeans = VariantSpecLoaderHelper.service.loadVariantSpecs(navCriteriabeansList, partConfigSpecBeanList, atoConfigSpecBeanList);
You must provide the following information for the API:
A list of VariantLoadNavCriteriaBean objects— For each bean, a variant specification is created or updated. This bean contains the same information as the Variant Specification worksheet. This bean can contain the following information:
variantSpecName—The name of the variant specification to create.
variantSpecNumber—A valid variant specification number if you are reconfiguring an existing variant specification.
variantSpecDescription—The description for the variant specification.
variantSpecFolder—A string representing the folder where you want to place the variant specification (for example, “/Default”).
variantSpecCreateVariants— A Boolean value specifying whether to create module variants based on this variant specification.
partNumber—The part number for which a variant must be created. It must have an option set assigned to it. If only partNumber is specified, then the latest version is used.
organization—The owning organization which the part belongs to (for example, Demo organization).
partRevision—The revision of the part. For example, to use Part A.1, provide “A” as the revision.
partIteration—The iteration of the part. For example, for Part A.1, use “1” for the iteration.
partView—The view for the part version (for example, Design).
optionSetName—The name of the option set to use. Provide this value only if you have not provided a part. This enables the creation of the variant specification based on the option set.
optionSetRevision—The revision of the option set.
optionSetIteration—The iteration of the option set.
applyToTop— A Boolean value. Setting this attribute to true is equivalent to checking the same box on the Configuration Specification tab of the Configure window. When this attribute is set to true, the system applies the configuration specification to the top-most part on the part structure provided. This is applicable only if the part is specified.
ruleCheckingDisabled—By default, this is set to false. When this attribute is set to true, it is equivalent to selecting Disable Rule Checking on the Configure window.
filterMode—An integer value: set it to 1 for Standard, or to 2 for Alternate filtering mode.
optionsMapMap<String, List<String>. This is a Map of Option Names and its corresponding List of Choice Names. This is equivalent to the selections you make on the Edit Filter tab. Choice rules are applied to these choices during the option filtering. See the sample code for an example of how to create this Map.
partConfigSpecsList<String> Provide this information if you want to apply specific part configuration specifications to the part. Make sure that anything you add has a corresponding entry in the API method argument partconfigSpecBeans. If this is null, then the Latest part configuration specification is applied. This is applicable only if the part is specified.
atoRuleConfigSpecsList<String> Provide this information if you want to use a specific Option Filter configuration specification. Make sure that anything you add has a corresponding entry in the API method argument atoConfigSpecBeans. If this is null, then the Latest configuration specification is applied.
variantSpecLifeCycleTemplate – The name of the life cycle template to assign to the variant specification.
variantSpecLifeCycleState – The enumerated value identifying the life cycle state to assign to the variant specification. For example, specify “INWORK” to use “In Work” as the life cycle state.
variantSpecIBAsMap<String, Object>. A map of internal names for soft attributes and the corresponding values to assign to the variant specification. The supported attribute types are: String, Boolean, Integer Number, Real Number, Real Number with Units, Date and Time, and URL.
A list of VariantLoadPartConfigSpecBean objects— For each bean, a part configuration specification is created. This bean contains the same information as the Part Config Specs worksheet. You can set this parameter to null if you intend to use only the Latest configuration specification. To use more a detailed configuration specification, as you would with the Configure user interface, set this bean to contain the following attributes or use the constructor on the bean:
configSpecName—(Required) A unique name for the configuration specification.
viewName— The name of a valid view (for example, "Design"). This value can be null.
lifeCycleState— The name of the life cycle state (for example, "Released"). This value can be null.
baselineName—The name of an existing baseline.
effectivityDate—The effectivity date for the configuration specification. This value can be null.
A list of VariantLoadATORuleConfigSpecBean objects— For each bean, a configuration specification for the Option Filter is created. This bean contains the same information as the Option Filter Config Specs worksheet. You can set this parameter to null if you intend to use the Latest configuration specification only. To use a more detailed configuration specification, as you would on the Configure user interface, set this bean to contain the following attributes or use the constructor from the bean:
configSpecName—(Required) A unique name for the configuration specification.
lifeCycleState—The name of the life cycle state (for example, "Released"). This value can be null.
effectivityDate—The effectivity date for the configuration specification. This value can be null.
Было ли это полезно?