Package com.ptc.windchill.esi.rnd
Class VdbBuilderImpl
java.lang.Object
com.ptc.windchill.esi.rnd.VdbBuilderImpl
- All Implemented Interfaces:
VdbBuilder
The default ESI VdbBuilder implementation.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Persistable[] dependents, Collection targets) Creates a VdbElement containing an I*E Element and a Persistable.voidaddElement(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Persistable[] dependents, Map<MPMPartMgmtLink, String> linksToSnapshot, Collection targets) Creates a VdbElement containing an I*E Element and a Persistable.voidaddElement(String groupName, Persistable persistable, com.infoengine.object.factory.Element element, Map<MPMPartMgmtLink, String> linksToSnapshot, Collection targets) Creates a VdbElement containing an I*E Element and a Persistable.voidaddElements(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Map<Persistable, Optional<String>> dependentsInfo, Collection targets) Creates a VdbElement containing an I*E Element and a Persistable.voidaddGroupAndElement(String groupName, boolean isUnchanged, String elementName, ESITarget target) Checks if a group with the given name already exists in the current VDB builder instance.com.infoengine.object.IeCollectionasVDB()Create the VDB from the contents of the VdbGroups that were built.protected VdbGroupReturns the VdbGroup identified by the groupName attribute.Gets the value of the attribute primaryBusinessObject.Gets the value of the attribute: transactionNumber; The number of an ESI transaction.voidinitialize(String transactionNumber) Make sure the object is ready for requests.booleanisEmpty(boolean enforceChanges) Lets the caller know whether or not all the groups in the associated VdbContainer are empty.
-
Method Details
-
getPrimaryBusinessObject
Gets the value of the attribute primaryBusinessObject. This is the object that was released by the user, or the Change Notice that was automatically associated to the released object when the preference "Automatically Generate Change Notice" has a value "Yes".
Supported API: true- Specified by:
getPrimaryBusinessObjectin interfaceVdbBuilder- Returns:
- A Releasable object that represents the primary business object in the given release.
-
getTransactionNumber
Gets the value of the attribute: transactionNumber; The number of an ESI transaction.
Supported API: true- Specified by:
getTransactionNumberin interfaceVdbBuilder- Returns:
- String
-
initialize
Make sure the object is ready for requests. Stores the argument in the transactionNumber attribute.
Supported API: true- Specified by:
initializein interfaceVdbBuilder- Parameters:
transactionNumber-
-
getGroup
Returns the VdbGroup identified by the groupName attribute. Obtains the result from the associated VdbContainer.
Supported API: true- Parameters:
groupName-- Returns:
- VdbGroup
-
addElement
public void addElement(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Persistable[] dependents, Collection targets) throws ESIRendererException Creates a VdbElement containing an I*E Element and a Persistable. Adds the VdbElement to a VdbGroup. The VdbGroup is logically identified by the groupName argument and by the currently processed ESITarget object.
Supported API: true- Specified by:
addElementin interfaceVdbBuilder- Parameters:
groupName- The logical group to which the element argument is to be added.element- The I*E element that is to be added to the group.persistable- The persistable, of which the element is a representation. May be null.dependents- Dependent persistables, also of which the element is a representation. May be null.targets- Collection of ESITarget objects. This will be a singleton collection containing the currently processed target.- Throws:
ESIRendererException
-
addElement
public void addElement(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Persistable[] dependents, Map<MPMPartMgmtLink, String> linksToSnapshot, Collection targets) throws ESIRendererExceptionCreates a VdbElement containing an I*E Element and a Persistable. Adds the VdbElement to a VdbGroup. The VdbGroup is logically identified by the groupName argument and by the currently processed ESITarget object.
Supported API: true- Specified by:
addElementin interfaceVdbBuilder- Parameters:
groupName- The logical group to which the element argument is to be added.element- The I*E element that is to be added to the group.persistable- The persistable, of which the element is a representation.dependents- Dependent persistables, also of which the element is a representation.linksToSnapshot- - Dependent links for which snapshot object is to be created and release class, of which the element is a representation.targets- Collection of ESITarget objects. This will be a singleton collection containing the currently processed target.- Throws:
ESIRendererException
-
addElement
public void addElement(String groupName, Persistable persistable, com.infoengine.object.factory.Element element, Map<MPMPartMgmtLink, String> linksToSnapshot, Collection targets) throws ESIRendererExceptionCreates a VdbElement containing an I*E Element and a Persistable. Adds the VdbElement to a VdbGroup. The VdbGroup is logically identified by the groupName argument and by the currently processed ESITarget object.
Supported API: true- Specified by:
addElementin interfaceVdbBuilder- Parameters:
groupName- - The logical group to which the element argument is to be added.persistable- - The persistable, of which the element is a representation.element- - The I*E element that is to be added to the group.linksToSnapshot- - Dependent links for which snapshot object is to be created and release class, of which the element is a representation.targets- - Collection of ESITarget objects.- Throws:
ESIRendererException
-
asVDB
Create the VDB from the contents of the VdbGroups that were built. Before the VDB is built, it removes all the empty groups from the VdbContainer if the preference com.ptc.windchill.esi.RemoveEmptyGroups is set to "Yes". Return the result of VdbContainer.asVDB().
Supported API: true- Specified by:
asVDBin interfaceVdbBuilder- Returns:
- IeCollection instance that represents the built ESI response.
- Throws:
IOExceptionESIRendererException- , if the isEmpty() API returns a true and the preference "Enforce Changes" has a value "Yes"; WTException, if any of the invoked methods throws this exception.WTException
-
isEmpty
Lets the caller know whether or not all the groups in the associated VdbContainer are empty. This overloaded version differs from the other version in that it takes into account the value of the input argument while performing the check. For example, the VdbContainer is considered to be empty if it has only groups that hold unchanged objects, and a true is passed in for enforceChanges; the method has the same behavior as the other version when a false is passed in for the argument.
Supported API: true- Specified by:
isEmptyin interfaceVdbBuilder- Parameters:
enforceChanges- Specifies whether or not changes are to be enforced; this is typically the value of the preference "Enforce Changes".- Returns:
- boolean true, if all the groups in the associated VdbContainer are empty; false, otherwise.
- Throws:
ESIRendererException
-
addGroupAndElement
public void addGroupAndElement(String groupName, boolean isUnchanged, String elementName, ESITarget target) throws MissingParameterException Checks if a group with the given name already exists in the current VDB builder instance. If one doesn't exist, the method creates a new group with the given name and adds it to the current VDB builder instance. Additionally, it checks if an element with the given name exists in the group indicated by the given group name. If one doesn't exist, it creates a new element with the given name and adds it to the group. This method should be invoked only after the VDB builder instance is updated for a target using the methodupdate(ESITarget).
Supported API: true- Specified by:
addGroupAndElementin interfaceVdbBuilder- Parameters:
groupName- - Name of the group to be created and added to the VDB builder instance. This argument should not be null or empty.isUnchanged- - Specifies whether or not the input group would hold unchanged objects in the ESI response.elementName- - Name of the element to be added to the group indicated by the input argument "groupName".target- - ESITarget object for which the group and the element need to be added.- Throws:
MissingParameterException- If the input group name is either null or empty.
-
addElements
public void addElements(String groupName, com.infoengine.object.factory.Element element, Persistable persistable, Map<Persistable, Optional<String>> dependentsInfo, Collection targets) throws ESIRendererExceptionCreates a VdbElement containing an I*E Element and a Persistable. Adds the VdbElement to a VdbGroup. The VdbGroup is logically identified by the groupName argument and by the currently processed ESITarget object.
Supported API: true- Specified by:
addElementsin interfaceVdbBuilder- Parameters:
groupName- - The logical group to which the element argument is to be added.element- - The I*E element that is to be added to the group.persistable- - The persistable, of which the element is a representation. May be null.dependentsInfo- - Dependent objects information Map containing persistables as key and Optional release class key, of which the element is a representation. May be null.targets- - Collection of ESITarget objects. This will be a singleton collection containing the currently processed target.- Throws:
ESIRendererException
-