Package com.ptc.windchill.esi.rnd
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
A repository for convenience methods which are useful in many renderers.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidadjustDateEffCxt(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 voidadjustDateEffectivities(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 voidadjustEffectivities(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 voidadjustLotNumberEffCxt(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 voidadjustLotNumberEffectivities(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 voidadjustObjectID(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 voidadjustSerialNumberEffCxt(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 voidadjustSerialNumberEffectivities(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 voidadjustTargets(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 voidAbstract method that forces subclasses to implement buildGroups.protected StringbuildUfidString(Collection objects, String completeUFIDString, Class objectType) This method will build the ufid string of Object ids for the I*E task.protected booleanevaluateBussinessRule(Persistable part, BusinessRuleSetBean[] businessRuleSetBeans) Return the result of bussiness rule evaluation
Supported API: trueprotected StringReturns the value of the attribute adapterName.protected ESIAlternateUnitOfMeasureRendererGets the value of the attribute: aumRenderer.protected StringgetAuth()Gets the value of the attribute: authentication.Gets the value of the attribute: builder.getPreviousObject(Persistable currentObject) Returns the previous object for input current object from the internal storage of a renderer instance.protected ESITargetUtilityReturns 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: trueprotected com.infoengine.object.IeCollectionThis method will call the I*E task specified by the task name.protected com.infoengine.object.IeCollectioninvokeQueryTask(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.IeCollectioninvokeQueryTask(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 booleanisGroupAvailable(String groupLogicalName) Checks whether or not a group with the input logical name exists in the ESI response meta information file.static booleanReturns true if the attribute "ESIOS_PublishAssocOptionSetsFlag" on the input target is set to true.protected com.infoengine.object.factory.ElementmapDateEffectivities(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.ElementmapEffectivities(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.voidmapEffectivityAttributes(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.ElementmapElement(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.ElementmapElement(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.ElementmapElement(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.ElementmapLotNumberEffectivities(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.ElementCalls the ESI mapper to create an Info*Engine Element using an object as input.protected com.infoengine.object.factory.ElementCalls the ESI mapper to create an Info*Engine Element using an object as input.protected com.infoengine.object.factory.ElementmapSerialNumberEffectivities(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 voidmergeElements(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 voidoverrideAttrValue(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 booleanUsed to indicate processBussinessRuleValidationResultSet API to return true only if all business rule are successful.protected booleanprocessBussinessRuleValidationResultSet(RuleValidationResultSet validationResultSet) Used to get the status for the business rules evaluation succeeded or failed from the input validationResultSet.protected ObjectDefault implementation of the API that is invoked by ESIBOMRenderer and by ESIOperationUsageLinkRenderer when no qualifying version was found for the input master object.protected voidremoveAttributesNotRequired(com.infoengine.object.factory.Element element, Collection<String> unwantedAtts) Remove the unwanted attributes from the input Element
Supported API: truevoidrender(VdbBuilder builder) This is a template method for ESI Services renderers.protected voidsetAttrValue(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 voidsetAttrValues(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.voidsetBuilder(VdbBuilder a_Builder) Sets the value of the attribute: builder.booleanshallPublishAssocOptionSet(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.booleanReturns 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.booleanReturns 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.voidstoreCurrentAndItsPreviousObject(Map<Persistable, Persistable> currentAndItsPreviousObjects) This API is intended to be used to store an object and its previous iteration.voidstoreCurrentAndItsPreviousObject(Persistable currentObject, Persistable previousObject) This API is intended to be used to store an object and its previous iteration.protected abstract voidvalidate()Force all subclasses to implement the method.
-
Method Details
-
getBuilder
Gets the value of the attribute: builder.
Supported API: true- Returns:
- VdbBuilder
-
setBuilder
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:- 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.
- 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 variablecurrentTargetshould be set to the current target being processed using one of the setter APIs available in this class. - Formats and adds the start date to the appropriate attribute in the input element.
- 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
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
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
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
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
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:
ESIRendererExceptionExceptionWTException
-
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 callobjectType- 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 ofmapElement(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
This is a template method for ESI Services renderers. It saves the argument and then calls validate() and buildGroups().
Supported API: true- Specified by:
renderin interfaceESIRenderer- Parameters:
builder- The VDB builder to use when rendering output.- Throws:
ESIRendererException
-
validate
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
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
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 ESIRendererExceptionCalls 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
Gets the value of the attribute: aumRenderer. Initializes it if its null.
Supported API: true- Returns:
- String
- Throws:
ESIRendererException
-
processNoMatchingVersionFound
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
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 APIgetPreviousObject(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 APIgetPreviousObject(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
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
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
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 targetpart- - 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
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
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 APImapObject(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 evaluatedbusinessRuleSetBeans- - 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
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:
ESIRendererExceptionWTException
-
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:- 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.
- 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 variablecurrentTargetshould be set to the current target being processed using one of the setter APIs available in this class. - Formats and adds the start date to the appropriate attribute in the input element.
- 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
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.
-