Class ChoiceRuleRenderer

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

public class ChoiceRuleRenderer extends BasicESIRenderer
Renders the ChoiceRule object along with RuleMemberLink and RuleMemberActionLink.

Supported API: true

Extendable: true
  • Method Details

    • getRules

      public void getRules(Persistable context, Map<ChoiceRule,OptionsVariantsHelper.ChoiceRuleSourceTargetInfo> ruleDetails, ESITarget target, Map<String,Object> paramsMap, String auth, VdbBuilder builder) throws ESIRendererException
      Deprecated.
      As of 13.0.1.0. Use the other overloaded API that takes in an OptionSet instead.
      Renders the ChoiceRule and links that defines rule.

      Supported API: true
      Parameters:
      context - - Object which is referring to this ChoiceRule (OptionSet etc.). Can be null when an ChoiceRule is published as a stand alone object.
      ruleDetails - - A Map containing choice rules as key and set choice to be rendered. If this null or empty, then the caller is expected to provide a value to the input argument "objectID".
      target - - Distribution target to which the rule 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 - - Authentication information for Info*Engine tasks.
      builder - -The VdbBuilder to use when creating output.
      Throws:
      ESIRendererException
    • getRules

      public void getRules(Persistable context, Map<ChoiceRule,OptionsVariantsHelper.ChoiceRuleSourceTargetInfo> ruleDetails, ESITarget target, Map<String,Object> paramsMap, String auth, VdbBuilder builder, OptionSet previousExportedOptionSet) throws ESIRendererException
      Renders the ChoiceRule and links that defines rule.

      Supported API: true
      Parameters:
      context - - Object which is referring to this ChoiceRule (OptionSet etc.). Can be null when an ChoiceRule is published as a stand alone object.
      ruleDetails - - A Map containing choice rules as key and set choice to be rendered. If this null or empty, then the caller is expected to provide a value to the input argument "objectID".
      target - - Distribution target to which the rule 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 - - Authentication information for Info*Engine tasks.
      builder - - The VdbBuilder to use when creating output.
      previousExportedOptionSet - - Previously published option set.
      Throws:
      ESIRendererException
    • setData

      public void setData(Persistable context, Map<ChoiceRule,OptionsVariantsHelper.ChoiceRuleSourceTargetInfo> ruleDetails, ESITarget target, Map<String,Object> paramsMap, String auth) throws ESIRendererException
      Deprecated.
      As of 13.01.0. Use the other overloaded API that takes in an OptionSet instead.
      Initializes this renderer instance appropriately.

      Supported API: true
      Parameters:
      context - - Object which is referring to this ChoceRule(s) (Product\Library\OptionSet etc.). Can be null when an expressionable ChoiceRule 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 - - Authentication information for Info*Engine tasks.
      allChoiceRuleToBeRendered - - A Map containing choice rules as key and set choice to be rendered. If this null or empty, then the caller is expected to provide a value to the input argument "objectID".
      Throws:
      WTException
      ESIRendererException
    • setData

      public void setData(Persistable context, Map<ChoiceRule,OptionsVariantsHelper.ChoiceRuleSourceTargetInfo> ruleDetails, ESITarget target, Map<String,Object> paramsMap, String auth, OptionSet previousExportedOptionSet) throws ESIRendererException
      Initializes this renderer instance appropriately.

      Supported API: true
      Parameters:
      context - - Object which is referring to this ChoceRule(s) (Product\Library\OptionSet etc.). Can be null when an expressionable ChoiceRule 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 - - Authentication information for Info*Engine tasks.
      previousExportedOptionSet - - Previously published option set.
      allChoiceRuleToBeRendered - - A Map containing choice rules as key and set choice to be rendered. If this null or empty, then the caller is expected to provide a value to the input argument "objectID".
      Throws:
      WTException
      ESIRendererException
    • validate

      protected void validate() throws ESIRendererException
      Throws an exception if any of the following instance members do not exists or do not carry a valid value - Choice rule, authentication and adapter parameters.

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

      protected void buildGroups() throws ESIRendererException
      Renders ChoiceRules along RuleMemberLink and RuleMemberActionLinks.
      Note: At 10.2 Source Choices if available for Rule are rendered in RuleMemberLink element and target choices are rendered in RuleMemberActionLink in response.
      • 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.
      • Renders rule member links. At 10.2 source choice for Enable/Include rules are renderd in RuleMemberLink
      • Renders rule member action links. At 10.2 target choices for Enable/Include/Exclude rules are renderd in RuleMemberLink


      Supported API: true
      Specified by:
      buildGroups in class BasicESIRenderer
      Throws:
      ESIRendererException
      See Also:
    • adjustChoiceRuleElement

      protected com.infoengine.object.factory.Element adjustChoiceRuleElement(com.infoengine.object.factory.Element element, String groupName, ChoiceRule rule, Persistable ruleContext, 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 input element from 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.
      rule - - RoleA object of the current rule member link.
      ruleContext - - The context object for rule such as OptionSet/Product etc. If available
      targets - - The collection of ESITarget objects.
      Returns:
      An updated element.