Class OptionsVariantsHelper

java.lang.Object
com.ptc.windchill.esi.ov.OptionsVariantsHelper

public class OptionsVariantsHelper extends Object
Provides helper methods for Options and Variants capabilities for ESI.

Supported API: true

Extendable: false
  • Method Details

    • getOptionSetData

      public static Map<String,Object> getOptionSetData(OptionSet optionSet, Persistable cachingContextPersistable) throws WTException
      Returns all the associated Option, Choice and OptionSetMemberLink objects for the input option set.

      Supported API: true
      Parameters:
      optionSet - - Option set
      cachingContextPersistable - - The persistable object to be used for building the session cache. Typically this should be the primary business object that triggered the ESI publication, or a unique object that can be used to define the session.
      Returns:
      A Map containing OptionSet data. Call to Map.get(Object) API on the returned map returns following values for keys
      Key Value
      OptionsVariantsHelper.LINK_CHOICE_INFO A map whose key is an OptionSetMemberLink and the value is corresponding Choice.
      OptionsVariantsHelper.OPTION_TO_CHOICE_MAP A map whose key is an Option and the value is a set of all the Choices that belongs to this option.
      OptionsVariantsHelper.OPTIONSET_CHOICE_RULE_REF_LINK Set of all the OptionSetChoiceRuleMasterLink or OptionSetChoiceRuleLink objects.
      Throws:
      WTException
    • getOptionSetDiffData

      public static Map<String,Object> getOptionSetDiffData(OptionSet currentObj, OptionSet previousObj, Persistable cachingContextPersistable) throws WTException
      Compares two iterations of an OptionSet. This method internally invokes the API ESIObjectComparisonUtility.compareOptionSets(OptionSet, OptionSet). In addition to the comparison result, it also returns the options and choices associated with the current iteration of the option set.

      Supported API: true
      Parameters:
      currentObj - - current iteration of an option set.
      previousObj - - option set iteration to compare the current iteration with.
      cachingContextPersistable - - The persistable object to be used for building the session cache. Typically this should be the primary business object that triggered the ESI publication, or a unique object that can be used to define the session.
      Returns:
      A Map containing OptionSet difference information. Call to Map.get(Object) API on the returned map returns following values for keys
      Key Value
      ESIObjectComparisonUtility.ATTRIBUTE_DIFF_INFORMATION A map which holds the attribute differences. For more information, check the API ESIObjectComparisonUtility.compareOptionSets(OptionSet, OptionSet).
      OptionsVariantsHelper.OPTIONSETMEMBERLINKDIFFERENCE An array of Map containing OptionSetMemberLink as key and Choice as value. For more information, check the API ESIObjectComparisonUtility.compareOptionSets(OptionSet, OptionSet).
      OptionsVariantsHelper.OPTION_TO_CHOICE_MAP A Map containing Option as key and set of Choice as value.
      OptionsVariantsHelper.OPTIONSET_TO_OPTION_LINKDIFFERENCE An array of sets containing options. Set at index -0 contains all the options newly added to the current option set. Index - 1 contains the options that are removed from the current option set.
      OptionsVariantsHelper.OPTIONSETCHOICERULEMASTERLINKDIFFERENCE An array of Set containing OptionSetChoiceRuleMasterLink.
      Throws:
      WTException
      See Also:
    • getAssignedOptionSet

      public static AssignedOptionSetResult getAssignedOptionSet(Persistable anObject, Persistable context, boolean overRideOptionSetRevision, Persistable cachingContextPersistable) throws WTException
      Returns the OptionSet associated with the input configurable object in the form of
      invalid reference
      OptionSetAssignmentResult
      . API returns the OptionSetAssignmentResult either from cache or by querying database and populating OptionSetAssignmentResult.

      Supported API: true
      Parameters:
      anObject - - Input object for which an associated option set needs to be found out.
      context - - This object is passed in to the option service API that fetches the associated option set; has relevance only when processing choice mappable choice links. A null is passed in for this argument when processing associated option set links.
      overRideOptionSetRevision - - Flag to indicate if the option set should be overridden with the new revision.
      cachingContextPersistable - - The persistable object to be used for building the session cache. Typically this should be the primary business object that triggered the ESI publication, or a unique object that can be used to define the session.

      Note: anObject and context in the input parameter should be valid object for wich option set is displayed in 'Assigned Option Set' table on info page.
      Returns:
      - The OptionSetAssignmentResult having information about option set associated with the input object.
      Throws:
      WTException
    • getAllRuleDetails

      public static Map<ChoiceRule,OptionsVariantsHelper.ChoiceRuleSourceTargetInfo> getAllRuleDetails(OptionSet optionSet, Persistable cachingContextPersistable, ATONavigationFilter filter) throws WTException
      Return collection of choice rule and ChoiceRuleSourceTargetInfo bean for given option set and using given filter criteria. ChoiceRuleSourceTargetInfo contains collection of source choices(member links) and target choices(member action links) both.
      Supported API: true
      Parameters:
      optionSet - : Query for rules associated with this option set.
      cachingContextPersistable - : Primary object to store cache against.
      filter - : Navigation filter if any.
      Returns:
      Throws:
      WTException
    • getChoicesOptions

      public static WTValuedMap getChoicesOptions(Persistable cachingContextPersistable, WTSet choices) throws WTException
      Returns the Options and Choices map where key is Choice and value is Option for a Choice

      Supported API: true
      Parameters:
      cachingContextPersistable - - The persistable object to be used for building the session cache. Typically this should be the primary business object that triggered the ESI publication, or a unique object that can be used to define the session.
      choices - - The set of choice objects.
      Returns:
      - The value map containing Choice as key and Option as a value
      Throws:
      WTException
    • getChoices

      public static Map<Option,Set<Choice>> getChoices(Collection<Option> options) throws WTException
      For each option in the input collection, returns all its choices.

      Supported API: true
      Parameters:
      options - - Collection of options.
      Returns:
      - A Map whose key is an option and the value is a set of all its choices.
      Throws:
      WTException
    • retrieveModuleVariantLinksDiffUsingObjComparison

      public static HashMap retrieveModuleVariantLinksDiffUsingObjComparison(WTPart currentPart, WTPart previousPart, ESITarget esiTarget, VdbBuilder builder) throws WTException, WTPropertyVetoException
      Get the difference information for module variant information links for a part
      Supported API: true
      Parameters:
      currentPart - - Current iteration of the assembly part.
      previousPart - - Previously published iteration of the assembly part.
      esiTarget - - The currently processed distribution target.
      builder - - VdbBuilder instance
      Returns:
      A Map of difference information
      Throws:
      WTException
      WTPropertyVetoException