Class OptionSetRenderer

java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
com.ptc.windchill.esi.ov.OptionSetRenderer
All Implemented Interfaces:
ESIRenderer

public class OptionSetRenderer extends BasicESIRenderer
Renders an OptionSet.The class is instantiated when publishing an option set in the object-centric mode say, by setting its lifecycle state or via the Send To Distribution Target option a Change Notice holding an option set as a resulting object a promotion request holding an option set as a promotable or a business object (say, a part) having an assigned option set (either directly or via its context) and a certain distribution target attribute is set. This class is also instantiated when local choice rule are added in a Change Notice and it has associated valid OptionSet associated with it. Thus Option Set gets published when local Choice Rules are changed via change process apart from above mentioned scenarios.

Supported API: true

Extendable: true
  • Method Details

    • getOptionSet

      public com.infoengine.object.IeCollection getOptionSet(String objectID, Persistable context, ESITransaction txn, Collection<ESITarget> targets, Map<ESITarget,Map<String,Object>> paramMap, String auth) throws ESIRendererException, WTException
      Creates a VdbBuilder instance for the input transaction, renders the input option set and creates release activities as appropriate for each of the distribution targets in the input target collection. The settings pertaining to ESI response generation for a given distribution target are fetched from the target itself. Returns the rendered output as an Info*Engine collection to the caller.

      Supported API: true
      Parameters:
      objectID - - UFID of the option set to be rendered.
      context - - Persistable object in the context of which this Option Set information needs to be rendered. For example, it can be a part or a process plan; a null is passed in when an Option Set is published as a stand alone object.
      txn - - ESITransaction object that represents the delivery of data to the distribution targets in the target collection; will be null when the method is invoked for the Preview functionality.
      targets - - Collection of distribution targets that represent a given destination, such as an ERP instance.
      paramMap - - Map holding ESITarget objects as keys and Maps as values; Currently this is not being used by Out-Of-box code.
      auth - - This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      Returns:
      IeCollection The Info*Engine collection that holds the ESI response.
      Throws:
      ESIRendererException
      WTException
    • getOptionSet

      public void getOptionSet(OptionSet optionSet, Persistable context, String auth, VdbBuilder builder) throws ESIRendererException
      Renders the input option set into the response. This API is intended to be invoked from change notice and promotion request renders.

      Supported API: true
      Parameters:
      optionSet - - Option set.
      context - - Persistable object in the context of which this Option Set information needs to be rendered. For example, it can be a part or a process plan; a null is passed in when an Option Set is published as stand alone object.
      auth - - This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      builder - - VDB Builder instance.
      Throws:
      WTException
      ESIRendererException
    • setData

      public void setData(OptionSet optionSet, Persistable context, ESITarget target, Map<String,Object> paramsMap, String auth)
      Initializes this renderer instance appropriately.

      Supported API: true
      Parameters:
      context - - Object (part, process plan etc.) that the optionSet is associated to. A null is passed in when an option set is published as a stand alone object.
      target - - Distribution target to which the option is being processed.
      paramsMap - - Can be used to pass additional data to this renderer. Currently this is not being used by Out-Of-box code.
      auth - - This parameter contains authentication information required for executing certain Windchill adapter webjects as part of the rendering process.
      objectID - - The UFID of the option set being processed.
      Throws:
      WTException
    • validate

      protected void validate() throws ESIRendererException
      Ensures that the data needed to execute this renderer is passed in correctly.

      Supported API: true
      Specified by:
      validate in class BasicESIRenderer
      Throws:
      ESIRendererException
    • buildGroups

      protected void buildGroups() throws ESIRendererException
      Renders the input option set and its related objects as added, deleted, changed, and unchanged objects based on their release history.
      • Invokes the OptionRenderer to render options and choices.
      • Invokes the ChoiceRuleRenderer to render choice rule information used by this option set.
      • If the attribute "Publish only Incremental Changes for a Modified Option set" on the target is set to "No", the option set and its related objects will be rendered as added objects regardless of their release history. If it is set to "Yes" only difference will be published.
      • If the preference "Enforce Distribution Target" is set to "Yes" and the objects being published have no targets associated, throws exception and the rendering will be aborted.


      Supported API: true
      Specified by:
      buildGroups in class BasicESIRenderer
      Throws:
      ESIRendererException
    • adjustOptionSetElement

      protected com.infoengine.object.factory.Element adjustOptionSetElement(com.infoengine.object.factory.Element element, Persistable context, String groupName, OptionSet optionSet, Collection<ESITarget> targets)
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      element - - The element to be updated.
      context - - Persistable object in the context of which this Option Set information needs to be rendered. For example, a part or a process plan; a null is passed in when an Option Set is published as stand alone object.
      groupName - - The logical name of the group to which the element will be added.
      optionSet - - The option set that is being processed.
      targets - - The collection of ESITarget objects.
      Returns:
      updated element.
    • adjustOptionSetMemberLinkElement

      protected com.infoengine.object.factory.Element adjustOptionSetMemberLinkElement(com.infoengine.object.factory.Element element, String groupName, OptionSetMemberLink memberLink, OptionSet optionSet, Choice choice, Collection<ESITarget> targets)
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      element - - The element to be updated.
      groupName - - The logical name of the group to which the element will be added.
      memberLink - - The option set member link that is being processed.
      optionSet - - RoleA object of the current option set member link.
      choice - - RoleB object of the current option set member link.
      targets - - The collection of ESITarget objects.
      Returns:
      updated element.
    • adjustOptionSetOptionLinkElement

      protected com.infoengine.object.factory.Element adjustOptionSetOptionLinkElement(com.infoengine.object.factory.Element elem, String groupName, Option option, OptionSet optionSet, Collection<ESITarget> targets)
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      elem - - The element to be updated.
      groupName - - The logical name of the group to which the element will be added.
      option - - option for which option set option link is being rendered.
      optionSet - - option set which is one end of the option set option link.
      targets - - Collection of ESITarget objects.
      Returns:
      updated element.
    • adjustOptionSetToRuleReferenceElement

      protected com.infoengine.object.factory.Element adjustOptionSetToRuleReferenceElement(com.infoengine.object.factory.Element element, String groupName, ObjectToObjectLink optionSetChoiceRuleLink, OptionSet optionSet, ChoiceRule choiceRule, Collection<ESITarget> targets) throws ESIRendererException
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return input element from the argument.

      Supported API: true
      Parameters:
      element - - An mapped element for the option set choice rule link.
      groupName - - Name of the group in ESI response for which to perform the mapping.
      optionSetChoiceRuleLink - - The link between option set and choice rule link or choice rule master. It can be OptionSetChoiceRuleLink or OptionSetChoiceRuleMasterLink.
      optionSet - - An option set using choice rule.
      choiceRule - - A choice rule that is associated with link to option set.
      targets - - Collection of ESITarget instances. These will be used to add distribution target related attributes to the output I*E element.
      Returns:
      -An adjusted element.
      Throws:
      ESIRendererException