Class BasicESIRenderer

java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
All Implemented Interfaces:
ESIRenderer
Direct Known Subclasses:
AssignedOptionSetLinkRenderer, ChoiceRuleRenderer, ESIAbstractDocumentsRenderer, ESIAbstractEDRenderer, ESIAlternateUnitOfMeasureRenderer, ESIBOMHeaderRenderer, ESIBOMSubordinateRenderer, ESIControlCharacteristicRenderer, ESIDocumentsRenderer, ESIECNHeaderRenderer, ESIEffectivityRenderer, ESIOperatedOnPartLinkRenderer, ESIOperationConsumableResourceRenderer, ESIOperationPBORenderer, ESIOperationRenderer, ESIOperationToPartLinkRenderer, ESIOperationUsageLinkRenderer, ESIOperationWorkCenterRenderer, ESIPartToProcessPlanLinkRenderer, ESIPlantAssignmentLinkRenderer, ESIPlantLocalizationLinkRenderer, ESIProcessPlanHeaderRenderer, ESIProcessPlanLocalizationLinkRenderer, ESIProcessPlanRenderer, ESIProductionVersionAssignmentLinkRenderer, ESIProductionVersionRenderer, ESIPromotionRequestRenderer, ESIQualityLinkRenderer, ESIResourceRenderer, ESISequenceRenderer, ESISequenceUsageLinkRenderer, ESISmartCollectionRenderer, ESIStandardCCLinkRenderer, ESIStandardCCToProcessPlanLinkRenderer, ESIStandardCCToResourceLinkRenderer, ESIStandardCCUsageToDDLinkRenderer, ESIStandardCCUsageToDRLinkRenderer, ESIStandardCCUsageToEPMDDLinkRenderer, ESIStandardCCUsageToProcessPlanLinkRenderer, ESIStandardCCUsageToResourceLinkRenderer, ESIStandardProcedureLinkRenderer, ESIWorkInstructionRenderer, ESIWTChangeOrder2Renderer, ExpressionRenderer, NavigationCriteriaAssociatedObjectRenderer, OptionRenderer, OptionSetRenderer, RuleMemberActionLinkRenderer, RuleMemberLinkRenderer, SelectedChoicesInfoRenderer, VariantSpecRenderer

public abstract class BasicESIRenderer extends Object implements ESIRenderer
A repository for convenience methods which are useful in many renderers.

Supported API: true

Extendable: true
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    adjustDateEffCxt(com.infoengine.object.factory.Element element, Eff eff)
    Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the date effectivity context part number attribute on the passed I*E element.
    protected void
    adjustDateEffectivities(com.infoengine.object.factory.Element element, Eff eff)
    Adds date effectivity information to an Element based on the date effectivity of an Object as specified.
    protected void
    adjustEffectivities(com.infoengine.object.factory.Element element, Eff[] effs)
    Invokes an appropriate method for each of the elements that figure in the passed array of Effs.
    protected void
    adjustLotNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
    Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the lot number effectivity context part number attribute on the passed I*E element.
    protected void
    adjustLotNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
    It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively.
    protected void
    adjustObjectID(com.infoengine.object.factory.Element element, String objectID)
    If the Info*Engine element argument has an "objectID" attribute, change its value to the value of the objectID argument.
    protected void
    adjustSerialNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
    Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the serial number effectivity context part number attribute on the passed I*E element.
    protected void
    adjustSerialNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
    It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively.
    protected void
    adjustTargets(com.infoengine.object.factory.Element element, Collection targets)
    For each entry in the targets argument, create a new Info*Engine Att object and add it to the element argument.
    protected abstract void
    Abstract method that forces subclasses to implement buildGroups.
    protected String
    buildUfidString(Collection objects, String completeUFIDString, Class objectType)
    This method will build the ufid string of Object ids for the I*E task.
    protected boolean
    evaluateBussinessRule(Persistable part, BusinessRuleSetBean[] businessRuleSetBeans)
    Return the result of bussiness rule evaluation

    Supported API: true
    protected String
    Returns the value of the attribute adapterName.
    Gets the value of the attribute: aumRenderer.
    protected String
    Gets the value of the attribute: authentication.
    Gets the value of the attribute: builder.
    Returns the previous object for input current object from the internal storage of a renderer instance.
    Returns an instance of the utility class "ESITargetUtility".
    protected Collection<String>
    Provides the list for attributes not required for different objects like(WTPartStandardConfigSpec,WTPartBaselineConfigSpec, etc) from the wt.properties file

    Supported API: true
    protected com.infoengine.object.IeCollection
    invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter)
    This method will call the I*E task specified by the task name.
    protected com.infoengine.object.IeCollection
    invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName)
    This method will call the I*E task specified by the task name.
    protected com.infoengine.object.IeCollection
    invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName, String attrList)
    This method will call the I*E task specified by the task name.
    protected boolean
    isGroupAvailable(String groupLogicalName)
    Checks whether or not a group with the input logical name exists in the ESI response meta information file.
    static boolean
    Returns true if the attribute "ESIOS_PublishAssocOptionSetsFlag" on the input target is set to true.
    protected com.infoengine.object.factory.Element
    mapDateEffectivities(com.infoengine.object.factory.Element element, Eff eff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets)
    Adds date effectivity information to an Element based on the date effectivity of an Object as specified.
    protected com.infoengine.object.factory.Element
    mapEffectivities(com.infoengine.object.factory.Element element, List<Eff> effList, String grpName, Collection<ESITarget> targets)
    Invokes an appropriate method for each of the elements that figure in the passed arraylist of Effs.
    void
    mapEffectivityAttributes(com.infoengine.object.factory.Element element, com.infoengine.object.factory.Element effectivityElement, Eff eff, Collection<ESITarget> targets)
    Fetches the Effectivity attributes associated with the passed Eff instance and uses the fetched information to populate the effectivity attributes on the passed I*E element.
    protected com.infoengine.object.factory.Element
    mapElement(String groupName, com.infoengine.object.factory.Element element)
    Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input.
    protected com.infoengine.object.factory.Element
    mapElement(String groupName, com.infoengine.object.factory.Element element, boolean includeEmptyAttributes)
    Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input.
    protected com.infoengine.object.factory.Element
    mapElement(String groupName, com.infoengine.object.factory.Element element, Persistable object)
    Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input.
    protected com.infoengine.object.factory.Element
    mapLotNumberEffectivities(com.infoengine.object.factory.Element element, Eff lotEff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets)
    It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively.
    protected com.infoengine.object.factory.Element
    mapObject(String groupName, Object object)
    Calls the ESI mapper to create an Info*Engine Element using an object as input.
    protected com.infoengine.object.factory.Element
    mapObject(String groupName, Object object, Map<?,?> softTypes)
    Calls the ESI mapper to create an Info*Engine Element using an object as input.
    protected com.infoengine.object.factory.Element
    mapSerialNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets)
    It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively.
    protected static void
    mergeElements(com.infoengine.object.factory.Element sourceElement, com.infoengine.object.factory.Element targetElement)
    Merge attributes of source element to target element using attribute list passed as input.
    protected void
    overrideAttrValue(com.infoengine.object.factory.Element element, String attrName, String value)
    Fetch the attribute indicated by the input argument "attrName" from the input element and set its value to the value indicated by the input argument "value" without checking the value of attribute already set in input element.
    protected boolean
    Used to indicate processBussinessRuleValidationResultSet API to return true only if all business rule are successful.
    protected boolean
    Used to get the status for the business rules evaluation succeeded or failed from the input validationResultSet.
    protected Object
    Default implementation of the API that is invoked by ESIBOMRenderer and by ESIOperationUsageLinkRenderer when no qualifying version was found for the input master object.
    protected void
    removeAttributesNotRequired(com.infoengine.object.factory.Element element, Collection<String> unwantedAtts)
    Remove the unwanted attributes from the input Element

    Supported API: true
    void
    render(VdbBuilder builder)
    This is a template method for ESI Services renderers.
    protected void
    setAttrValue(com.infoengine.object.factory.Element element, String attrName, String value)
    Fetch the attribute indicated by the input argument "attrName" from the input element and set its value to the value indicated by the input argument "value".
    protected void
    setAttrValues(com.infoengine.object.factory.Element sourceElement, com.infoengine.object.factory.Element targetElement, Map<String,String> attributesMap)
    From the source element, retrieves all the values of an attribute (whose name is equal to the key of the input map) and add them to the corresponding attribute(whose name is equal to corresponding value of the input map) on the target element.
    void
    Sets the value of the attribute: builder.
    boolean
    Returns a true if the attribute ESIOS_PublishAssocOptionSetsFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible or (2) the attribute ESIOS_PublishAssocOptionSetWithNonConfigObjectFlag on the input distribution target has a value true.
    boolean
    Returns the value of the ESI property "com.ptc.windchill.esi.renderEffectivityElementInPartElement", and this behavior will be available with all the OOTB extensions of this class by default.
    boolean
    Returns the value of the ESI property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes", and this behavior will be available with all the OOTB extensions of this class by default.
    void
    This API is intended to be used to store an object and its previous iteration.
    void
    This API is intended to be used to store an object and its previous iteration.
    protected abstract void
    Force all subclasses to implement the method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getBuilder

      public VdbBuilder getBuilder()
      Gets the value of the attribute: builder.

      Supported API: true
      Returns:
      VdbBuilder
    • setBuilder

      public void setBuilder(VdbBuilder a_Builder)
      Sets the value of the attribute: builder.

      Supported API: true
      Parameters:
      a_Builder -
    • adjustDateEffectivities

      protected void adjustDateEffectivities(com.infoengine.object.factory.Element element, Eff eff) throws ESIRendererException
      Adds date effectivity information to an Element based on the date effectivity of an Object as specified. Uses the input effectivity object, fetches start and end date effectivity and adds it to the input element. Does the following:
      1. Reads ESI preference to find the attribute names for start and end date effectivity. These names will be used to identify the start and end date effectivity attributes in the input element. If either of those attributes are missing, or contain a value they are ignored.
      2. Obtains the appropriate effectivity format from the preference "Effectivity Format". If the value of this preference is blank, the format will be obtained from the currentTarget. Hence before invoking this API, the instance variable currentTarget should be set to the current target being processed using one of the setter APIs available in this class.
      3. Formats and adds the start date to the appropriate attribute in the input element.
      4. If the end date is present in the input effectivity object, formats it and adds it to the appropriate attribute in the input element.


      Supported API: true
      Parameters:
      element - - The I*E element to be updated.
      eff - - The Eff instance to look up for the date effectivity values to add to the I*E element.
      Throws:
      ESIRendererException
    • adjustSerialNumberEffectivities

      protected void adjustSerialNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
      It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end serial number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end serial number effectivity, the method calls adjustSerialNumberEffCxt() to populate the serial number effectivity context part number attribute on the passed I*E element.

      Supported API: true
      Parameters:
      element - The I*E Element whose serial number effectivity attributes are to be updated.
      eff - The Eff instance to look up for the serial number effectivity values to add to the I*E Element.
    • adjustSerialNumberEffCxt

      protected void adjustSerialNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
      Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the serial number effectivity context part number attribute on the passed I*E element. The name of the attribute is fetched from a certain ESI property.

      Supported API: true
      Parameters:
      element - The I*E Element whose serial number effectivity context part number attribute needs to be updated.
      eff - The Eff instance to look up for the serial number effectivity context - the part number associated with the fetched context is then used for setting the relevant attribute on the passed I*E element.
    • adjustLotNumberEffectivities

      protected void adjustLotNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff)
      It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end lot number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end lot number effectivity, the method calls adjustLotNumberEffCxt() to populate the lot number effectivity context part number attribute on the passed I*E element.

      Supported API: true
      Parameters:
      element - The I*E Element whose lot number effectivity attributes are to be updated.
      eff - The Eff instance to look up for the lot number effectivity values to add to the I*E Element.
    • adjustLotNumberEffCxt

      protected void adjustLotNumberEffCxt(com.infoengine.object.factory.Element element, Eff eff)
      Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the lot number effectivity context part number attribute on the passed I*E element. The name of the attribute is fetched from a certain ESI property.

      Supported API: true
      Parameters:
      element - The I*E Element whose lot number effectivity context part number attribute needs to be updated.
      eff - The Eff instance to look up for the lot number effectivity context - the part number associated with the fetched context is then used for setting the relevant attribute on the passed I*E element.
    • adjustEffectivities

      protected void adjustEffectivities(com.infoengine.object.factory.Element element, Eff[] effs)
      Invokes an appropriate method for each of the elements that figure in the passed array of Effs. The method invoked will be adjustDateEffectivies(), adjustSerialNumberEffectivities() or adjustLotNumberEffectivities(), according as the element encountered in the array is of type WTDatedEffectivity, ProductSerialNumberEffectivity or ProductLotNumberEffectivity respectively.

      Supported API: true
      Parameters:
      element - The I*E Element whose date, serial number and lot number effectivity attributes are to be updated.
      effs - An array of Effs to look up for date, serial number and lot number effectivity values to add to the passed I*E element.
    • adjustObjectID

      protected void adjustObjectID(com.infoengine.object.factory.Element element, String objectID) throws ESIRendererException
      If the Info*Engine element argument has an "objectID" attribute, change its value to the value of the objectID argument.

      Supported API: true
      Parameters:
      element - The element to be updated.
      objectID - The value to assign to the objectID attribute of the element argument.
      Throws:
      ESIRendererException
    • adjustTargets

      protected void adjustTargets(com.infoengine.object.factory.Element element, Collection targets) throws ESIRendererException
      For each entry in the targets argument, create a new Info*Engine Att object and add it to the element argument.

      Supported API: true
      Parameters:
      element - The Info*Engine element that is to be updated.
      targets - A collection of ESITarget objects.
      Throws:
      ESIRendererException
    • buildGroups

      protected abstract void buildGroups() throws ESIRendererException, Exception
      Abstract method that forces subclasses to implement buildGroups. The concrete method is expected to navigate the object of interest and to create I*E groups of Elements and Atts. When completed with the construction of the groups, the concrete class is expected to add the constructed groups into the IeCollection that this object created. ESI renderers use the services of a VdbBuilder to create and render the output.

      Supported API: true
      Throws:
      ESIRendererException
      Exception
      WTException
    • buildUfidString

      protected String buildUfidString(Collection objects, String completeUFIDString, Class objectType) throws WTException
      This method will build the ufid string of Object ids for the I*E task. The ufids will be returned delimited by "~" character.

      Supported API: true
      Parameters:
      objects - Collection of persistable objects.
      completeUFIDString - String of UFIDs from a previous call
      objectType - The class of the persistable object. Used to return only objects of that type.
      Returns:
      String
      Throws:
      WTException
    • invokeQueryTask

      protected com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter) throws WTException
      This method will call the I*E task specified by the task name. The I*E collection from the task is returned.

      Supported API: true
      Parameters:
      taskName - The URL location and name of the task to be executed.
      className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
      ufids - This is a list of object ids to run the task with.
      auth - This is the I*E authorization to run the task.
      wcAdapter - Windchill adapter instance where the task will be executed.
      Returns:
      IeCollection
      Throws:
      WTException
    • invokeQueryTask

      protected com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName) throws WTException
      This method will call the I*E task specified by the task name. The I*E collection from the task is returned.

      Supported API: true
      Parameters:
      taskName - The URL location and name of the task to be executed.
      className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
      ufids - This is a list of object ids to run the task with.
      auth - This is the I*E authorization to run the task.
      wcAdapter - Windchill adapter instance where the task will be executed.
      groupName - The output group name.
      Returns:
      IeCollection
      Throws:
      WTException
    • invokeQueryTask

      protected com.infoengine.object.IeCollection invokeQueryTask(String taskName, String className, String ufids, String auth, String wcAdapter, String groupName, String attrList) throws WTException
      This method will call the I*E task specified by the task name. The I*E collection from the task is returned.

      Supported API: true
      Parameters:
      taskName - The URL location and name of the task to be executed.
      className - The Windchill class to run the I*E task on. This is the "Type" parameter in the Webject call.
      ufids - This is a list of object ids to run the task with.
      auth - This is the I*E authorization to run the task.
      wcAdapter - Windchill adapter instance where the task will be executed.
      groupName - The output group name.
      attrList - The source attribute list (i.e. windchill attributes) excluding 'obid' in map file.
      Returns:
      IeCollection
      Throws:
      WTException
    • mapElement

      protected com.infoengine.object.factory.Element mapElement(String groupName, com.infoengine.object.factory.Element element) throws ESIRendererException
      Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input. Obtains the map information using the logical group name in the groupName argument.

      Supported API: true
      Parameters:
      groupName - The logical VDB group name.
      element - The Info*Engine Element to map.
      Returns:
      Element
      Throws:
      ESIRendererException
    • mapElement

      protected com.infoengine.object.factory.Element mapElement(String groupName, com.infoengine.object.factory.Element element, boolean includeEmptyAttributes) throws ESIRendererException
      Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input. Obtains the map information using the logical group name in the groupName argument. Empty attributes will not be included in the returned element if the boolean "includeEmptyAttributes" is false. If true, the behavior is identical to that of mapElement(String, Element) API.

      Supported API: true
      Parameters:
      groupName - - The logical VDB group name.
      element - - The Info*Engine Element to map.
      includeEmptyAttributes - - If false, the output element doesn't contain the empty attributes.
      Returns:
      Element
      Throws:
      ESIRendererException
    • mapObject

      protected com.infoengine.object.factory.Element mapObject(String groupName, Object object) throws ESIRendererException
      Calls the ESI mapper to create an Info*Engine Element using an object as input. Obtains the map information using the logical group name in the groupName argument.

      Supported API: true
      Parameters:
      groupName - The logical group name. Used to obtain the appropriate map information.
      object - The object that is to be rendered as an Info*Engine element.
      Returns:
      Element
      Throws:
      ESIRendererException
    • render

      public void render(VdbBuilder builder) throws ESIRendererException
      This is a template method for ESI Services renderers. It saves the argument and then calls validate() and buildGroups().

      Supported API: true
      Specified by:
      render in interface ESIRenderer
      Parameters:
      builder - The VDB builder to use when rendering output.
      Throws:
      ESIRendererException
    • validate

      protected abstract void validate() throws ESIRendererException
      Force all subclasses to implement the method. The concrete method is expected to examine the attributes of the object and throw an exception if they are not set properly.

      Supported API: true
      Throws:
      ESIRendererException
    • getAdapterName

      protected String getAdapterName()
      Returns the value of the attribute adapterName. This attribute holds the name of the Windchill Adapter instance where the Query-Objects webject is to be executed. There is no setter for this attribute - it must be set using setData(). This method must be called after the method setData() was invoked from the subclass.

      Supported API: true
      Returns:
      The value stored in the field adapterName.
    • getAuth

      protected String getAuth()
      Gets the value of the attribute: authentication. This attribute holds the authentication information to pass to the Windchill Adapter when executing the Query-Objects webject. There is no setter for this attribute - it must be set using setData().

      Supported API: true
      Returns:
      String
    • mapObject

      protected com.infoengine.object.factory.Element mapObject(String groupName, Object object, Map<?,?> softTypes) throws ESIRendererException
      Calls the ESI mapper to create an Info*Engine Element using an object as input. Obtains the map information using the logical group name in the groupName argument. An additional parameter softTypes is passed to the method. This vector will be populated with all those attributes that do not have a getter method. Note: As of X-12 this method tries to map object by considering map file at organization container if not found will use default site specific map to map the object

      Supported API: true
      Parameters:
      groupName - The logical group name. Used to obtain the appropriate map information.
      object - The object that is to be rendered as an Info*Engine element.
      Returns:
      Element
      Throws:
      ESIRendererException
    • getAUMRenderer

      protected ESIAlternateUnitOfMeasureRenderer getAUMRenderer() throws ESIRendererException
      Gets the value of the attribute: aumRenderer. Initializes it if its null.

      Supported API: true
      Returns:
      String
      Throws:
      ESIRendererException
    • processNoMatchingVersionFound

      protected Object processNoMatchingVersionFound(WTContained master) throws ESIRendererException
      Default implementation of the API that is invoked by ESIBOMRenderer and by ESIOperationUsageLinkRenderer when no qualifying version was found for the input master object. This could be because the user may not have the necessary privileges to access the version or there might not be a version defined that matches the configuration specification defined for the saved filter. Custom extensions of the said renderers may provide an overridden version of this method, providing a different behaviour.

      Supported API: true
      Parameters:
      master - The WTContained master object for which no qualifying version was found.
      Returns:
      A null, if the preference "Show No Qualifying Version Found Error" is set to "No".
      Throws:
      ESIRendererException - , if the said preference is set to "Yes".
    • storeCurrentAndItsPreviousObject

      public void storeCurrentAndItsPreviousObject(Persistable currentObject, Persistable previousObject)
      This API is intended to be used to store an object and its previous iteration. In case of a link, its previously published link should be stored. This API can be used to pass this information between renderers. Use the API getPreviousObject(Persistable) to retrieve the previous object.

      Supported API: true
      Parameters:
      currentObject - - Current object.
      previousObject - - Previous version/iteration of the current object. This should be a previously published link in case the current object is a link.
    • storeCurrentAndItsPreviousObject

      public void storeCurrentAndItsPreviousObject(Map<Persistable,Persistable> currentAndItsPreviousObjects)
      This API is intended to be used to store an object and its previous iteration. In case of a link, its previously published link should be stored. This API can be used to pass this information between renderers. Use the API getPreviousObject(Persistable) to retrieve the previous object.

      Supported API: true
      Parameters:
      currentAndItsPreviousObjects - - The map containing current object as key and previous object as a value.
    • getPreviousObject

      public Persistable getPreviousObject(Persistable currentObject)
      Returns the previous object for input current object from the internal storage of a renderer instance.

      Supported API: true
      Parameters:
      currentObject - - The current object whose previous association or version/iteration is needed.
      Returns:
      - The previous object for a specified current object. This may be null if there is no valid object for the current object available in internal storage collection
      See Also:
    • isPublishAssocOptionSetFlagEnabled

      public static boolean isPublishAssocOptionSetFlagEnabled(ESITarget target)
      Returns true if the attribute "ESIOS_PublishAssocOptionSetsFlag" on the input target is set to true. A false, otherwise.

      Supported API: true
      Parameters:
      target - - Input distribution target.
      Returns:
      True if the attribute "ESIOS_PublishAssocOptionSetsFlag" on the input target is set to true. A false, otherwise.
    • shallPublishAssocOptionSet

      public boolean shallPublishAssocOptionSet(ESITarget target, WTPart part)
      Returns a true if the attribute ESIOS_PublishAssocOptionSetsFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible or (2) the attribute ESIOS_PublishAssocOptionSetWithNonConfigObjectFlag on the input distribution target has a value true.

      Supported API: true
      Parameters:
      target - - Input distribution target
      part - - Input part
      Returns:
      - A true, if the attribute ESIOS_PublishAssocOptionSetsFlag on the input distribution target has a value true and either (1) the input part is configurable and not collapsible or (2) the distribution target attribute ESIOS_PublishAssocOptionSetWithNonConfigObjectFlag has a value true.
    • isGroupAvailable

      protected boolean isGroupAvailable(String groupLogicalName)
      Checks whether or not a group with the input logical name exists in the ESI response meta information file. Returns a true if an ESIGroupInfo object with the input name exists, and a false otherwise. This API is meant to be used to check whether or not a group exists before adding any rendered object's elements to it.

      Supported API: true
      Parameters:
      groupLogicalName - - The input logical group name - for e.g., "AddedBOMs".
      Returns:
      A true if a group with the input name exists in the ESI response meta information file; a false otherwise.
    • getTargetUtility

      protected ESITargetUtility getTargetUtility()
      Returns an instance of the utility class "ESITargetUtility".

      Supported API: true
      Returns:
      ESITargetUtility instance.
    • setAttrValue

      protected void setAttrValue(com.infoengine.object.factory.Element element, String attrName, String value)
      Fetch the attribute indicated by the input argument "attrName" from the input element and set its value to the value indicated by the input argument "value".
      Note:The value of the attribute will be updated only if the existing value is blank or null.

      Supported API: true
      Parameters:
      element - - Element. Should not be null.
      attrName - - Attribute name.
      value - - value to be set on this attribute.
    • setAttrValues

      protected void setAttrValues(com.infoengine.object.factory.Element sourceElement, com.infoengine.object.factory.Element targetElement, Map<String,String> attributesMap)
      From the source element, retrieves all the values of an attribute (whose name is equal to the key of the input map) and add them to the corresponding attribute(whose name is equal to corresponding value of the input map) on the target element. This API handles multi valued attributes appropriately.

      Input map is expected to have the source attribute(as seen in ESIResponseMetaInfo.xml) as its key and the target attribute as its value. For example, in the following mapping entry, "obid" is the source attribute and "ObjectID" is target attribute.

      <esi:attributeMapping sourceAttribute="obid">ObjectID</esi:attributeMapping>

      Supported API: true

      Parameters:
      sourceElement - - Info*Engine element which is populated with values for the attributes whose names are indicated by the key of the input map. Generally this element is obtained by invoking QUERY-OBJECTS webject.
      targetElement - - Info*engine element which has attributes whose names are indicated by the values of the input map. Generally this element is obtained by invoking the API mapObject(String, Object, Map) API.
      attributesMap - - A Map whose key is the source attribute and the value is the target attribute from the mappings defined in ESIResponseMetaInfo.xml file.
    • mapElement

      protected com.infoengine.object.factory.Element mapElement(String groupName, com.infoengine.object.factory.Element element, Persistable object) throws ESIRendererException
      Calls the ESI mapper to create an Info*Engine Element using a different I*E element as input. Obtains the map information using the logical group name in the groupName argument. Uses specified object to set additional attribute to be set by calling getter methods on object adn referenced object.

      Supported API: true
      Parameters:
      groupName - - The logical VDB group name.
      element - - The Info*Engine Element to map.
      object - - The object that is to be rendered as an Info*Engine element.
      Returns:
      Element
      Throws:
      ESIRendererException
    • overrideAttrValue

      protected void overrideAttrValue(com.infoengine.object.factory.Element element, String attrName, String value)
      Fetch the attribute indicated by the input argument "attrName" from the input element and set its value to the value indicated by the input argument "value" without checking the value of attribute already set in input element. Method overrides the value of attribute even when element has attribute value queried.

      Supported API: true
      Parameters:
      element - - Element. Should not be null.
      attrName - - Attribute name.
      value - - value to be set on this attribute.
    • mergeElements

      protected static void mergeElements(com.infoengine.object.factory.Element sourceElement, com.infoengine.object.factory.Element targetElement)
      Merge attributes of source element to target element using attribute list passed as input. If an attribute is already present in target element, it would be over written by target attribute.

      Supported API: true
      Parameters:
      sourceElement - - Source element.
      targetElement - - Target element.
    • evaluateBussinessRule

      protected boolean evaluateBussinessRule(Persistable part, BusinessRuleSetBean[] businessRuleSetBeans) throws ESIRendererException
      Return the result of bussiness rule evaluation

      Supported API: true
      Parameters:
      part - - The object for which bussiness rule needs to be evaluated
      businessRuleSetBeans - - businessRuleSetBeans
      Returns:
      - The result of bussiness rule evaluation, True if valid bussiness rule for input persistable object, else false.
      Throws:
      ESIRendererException
    • processBussinessRuleValidationResultSet

      protected boolean processBussinessRuleValidationResultSet(RuleValidationResultSet validationResultSet)
      Used to get the status for the business rules evaluation succeeded or failed from the input validationResultSet.

      Supported API: true
      Parameters:
      validationResultSet -
      Returns:
      - The boolean which indicates that the business rule evaluation succeeded or failed from the input validationResultSet.
    • processBussinessRulesWithAnd

      protected boolean processBussinessRulesWithAnd()
      Used to indicate processBussinessRuleValidationResultSet API to return true only if all business rule are successful.

      Supported API: true
      Returns:
      - The boolean which indicates processBussinessRuleValidationResultSet API to return true only if all business rule are successful.
    • getUnwantedAttributes

      protected Collection<String> getUnwantedAttributes(Object obj) throws IOException
      Provides the list for attributes not required for different objects like(WTPartStandardConfigSpec,WTPartBaselineConfigSpec, etc) from the wt.properties file

      Supported API: true
      Parameters:
      obj - - The input object for which the list of Unwanted attributes has to be fetched
      Returns:
      - The collection of attributes to be removed from the input element.
      Throws:
      IOException
    • removeAttributesNotRequired

      protected void removeAttributesNotRequired(com.infoengine.object.factory.Element element, Collection<String> unwantedAtts)
      Remove the unwanted attributes from the input Element

      Supported API: true
      Parameters:
      element - - The element to be updated.
      unwantedAtts - - List of attributes to be removed form the Element
    • mapEffectivities

      protected com.infoengine.object.factory.Element mapEffectivities(com.infoengine.object.factory.Element element, List<Eff> effList, String grpName, Collection<ESITarget> targets) throws WTException
      Invokes an appropriate method for each of the elements that figure in the passed arraylist of Effs. The method invoked will be mapDateEffectivies(), mapSerialNumberEffectivities() or mapLotNumberEffectivities(), according as the element encountered in the arraylist is of type WTDatedEffectivity, ProductSerialNumberEffectivity or ProductLotNumberEffectivity respectively.

      Supported API: true
      Parameters:
      element - The I*E Element whose date, serial number and lot number effectivity attributes are to be updated.
      effList - An arrayList of Effs to look up for date, serial number and lot number effectivity values to add to the passed I*E element.
      grpName - The logical name of the group to which the element will be added.
      targets - Collection of ESITarget objects.
      Throws:
      ESIRendererException
      WTException
    • mapLotNumberEffectivities

      protected com.infoengine.object.factory.Element mapLotNumberEffectivities(com.infoengine.object.factory.Element element, Eff lotEff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets) throws ESIRendererException
      It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end lot number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end lot number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end lot number effectivity, the method calls adjustLotNumberEffCxt() to populate the lot number effectivity context part number attribute on the passed I*E element.

      Supported API: true
      Parameters:
      element - The I*E Element whose lot number effectivity attributes are to be updated.
      effectivityElement - The Effectivity I*E Element whose lot number effectivity attributes are to be updated.
      grpName - The logical name of the group to which the element will be added.
      targets - Collection of ESITarget objects.
      eff - The Eff instance to look up for the lot number effectivity values to add to the I*E Element.
      Throws:
      ESIRendererException
    • mapDateEffectivities

      protected com.infoengine.object.factory.Element mapDateEffectivities(com.infoengine.object.factory.Element element, Eff eff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets) throws ESIRendererException
      Adds date effectivity information to an Element based on the date effectivity of an Object as specified. Uses the input effectivity object, fetches start and end date effectivity and adds it to the input element. Does the following:
      1. Reads ESI preference to find the attribute names for start and end date effectivity. These names will be used to identify the start and end date effectivity attributes in the input element. If either of those attributes are missing, or contain a value they are ignored.
      2. Obtains the appropriate effectivity format from the preference "Effectivity Format". If the value of this preference is blank, the format will be obtained from the currentTarget. Hence before invoking this API, the instance variable currentTarget should be set to the current target being processed using one of the setter APIs available in this class.
      3. Formats and adds the start date to the appropriate attribute in the input element.
      4. If the end date is present in the input effectivity object, formats it and adds it to the appropriate attribute in the input element.


      Supported API: true
      Parameters:
      element - - The I*E element to be updated.
      eff - - The Eff instance to look up for the date effectivity values to add to the I*E element.
      effectivityElement - The Effectivity I*E Element whose date effectivity attributes are to be updated.
      grpName - The logical name of the group to which the element will be added.
      targets - Collection of ESITarget objects.
      Throws:
      ESIRendererException
    • mapSerialNumberEffectivities

      protected com.infoengine.object.factory.Element mapSerialNumberEffectivities(com.infoengine.object.factory.Element element, Eff eff, com.infoengine.object.factory.Element effectivityElement, String grpName, Collection<ESITarget> targets) throws ESIRendererException
      It fetches the LeftFilledStringEffRange instance for the passed Eff instance, gets the associated start and end values and sets the attributes for start and end serial number effectivity in the passed I*E element to the fetched start and end values respectively. The relevant attribute names (for start and end serial number effectivity) are fetched from certain ESI properties. Also, the attributes are set provided they exist in the passed I*E element and are not set to any value at the time of executing the method. Besides setting the attributes for start and end serial number effectivity, the method calls adjustSerialNumberEffCxt() to populate the serial number effectivity context part number attribute on the passed I*E element.

      Supported API: true
      Parameters:
      element - The I*E Element whose serial number effectivity attributes are to be updated.
      eff - The Eff instance to look up for the serial number effectivity values to add to the I*E Element.
      effectivityElement - The Effectivity I*E Element whose serial number effectivity attributes are to be updated.
      grpName - The logical name of the group to which the element will be added.
      targets - Collection of ESITarget objects.
      Throws:
      ESIRendererException
    • adjustDateEffCxt

      protected void adjustDateEffCxt(com.infoengine.object.factory.Element element, Eff eff)
      Fetches the Effectivity Context associated with the passed Eff instance and uses the fetched information to populate the date effectivity context part number attribute on the passed I*E element. The name of the attribute is fetched from a certain ESI property.

      Supported API: true
      Parameters:
      element - The I*E Element whose date effectivity context part number attribute needs to be updated.
      effs - The Eff instance to look up for the date effectivity context - the part number associated with the fetched context is then used for setting the relevant attribute on the passed I*E element.
    • mapEffectivityAttributes

      public void mapEffectivityAttributes(com.infoengine.object.factory.Element element, com.infoengine.object.factory.Element effectivityElement, Eff eff, Collection<ESITarget> targets) throws ESIRendererException
      Fetches the Effectivity attributes associated with the passed Eff instance and uses the fetched information to populate the effectivity attributes on the passed I*E element.

      Supported API: true
      Parameters:
      element - - The I*E Element whose date effectivity context part number attribute needs to be updated.
      effectivityElement - - The Effectivity I*E Element whose effectivity attributes are to be updated.
      eff - - The Eff instance to look up for the information for setting the relevant attribute on the passed I*E element.
      targets - - Collection of ESITarget objects.
      Throws:
      ESIRendererException
    • shouldUseOldEffectivityBehaviour

      public boolean shouldUseOldEffectivityBehaviour()
      Returns the value of the ESI property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes", and this behavior will be available with all the OOTB extensions of this class by default. However, a custom extension can provide an overriding version of the method having custom logic. For example, the overriding version can return a value depending on the type of distribution target in currentTarget.

      Supported API: true
      Returns:
      Value of the ESI property "com.ptc.windchill.esi.renderEffectivityWithPartAttributes". Delegates the actual work of fetching the property value to an ESIUtility API.
    • shouldRenderEffectivityElementInPartElement

      public boolean shouldRenderEffectivityElementInPartElement()
      Returns the value of the ESI property "com.ptc.windchill.esi.renderEffectivityElementInPartElement", and this behavior will be available with all the OOTB extensions of this class by default. However, a custom extension can provide an overriding version of the method having custom logic. For example, the overriding version can return a value depending on the type of distribution target in currentTarget.

      Supported API: true
      Returns:
      Value of the ESI property "com.ptc.windchill.esi.renderEffectivityElementInPartElement". Delegates the actual work of fetching the property value to an ESIUtility API.