Class VdbBuilderImpl

java.lang.Object
com.ptc.windchill.esi.rnd.VdbBuilderImpl
All Implemented Interfaces:
VdbBuilder

public class VdbBuilderImpl extends Object implements VdbBuilder
The default ESI VdbBuilder implementation.

Supported API: true

Extendable: true
  • Method Details

    • getPrimaryBusinessObject

      public Releasable 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:
      getPrimaryBusinessObject in interface VdbBuilder
      Returns:
      A Releasable object that represents the primary business object in the given release.
    • getTransactionNumber

      public String getTransactionNumber()
      Gets the value of the attribute: transactionNumber; The number of an ESI transaction.

      Supported API: true
      Specified by:
      getTransactionNumber in interface VdbBuilder
      Returns:
      String
    • initialize

      public void initialize(String transactionNumber)
      Make sure the object is ready for requests. Stores the argument in the transactionNumber attribute.

      Supported API: true
      Specified by:
      initialize in interface VdbBuilder
      Parameters:
      transactionNumber -
    • getGroup

      protected VdbGroup getGroup(String groupName)
      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:
      addElement in interface VdbBuilder
      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 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:
      addElement in interface VdbBuilder
      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 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:
      addElement in interface VdbBuilder
      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

      public com.infoengine.object.IeCollection asVDB() throws WTException
      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:
      asVDB in interface VdbBuilder
      Returns:
      IeCollection instance that represents the built ESI response.
      Throws:
      IOException
      ESIRendererException - , 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

      public boolean isEmpty(boolean enforceChanges) throws ESIRendererException
      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:
      isEmpty in interface VdbBuilder
      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 method update(ESITarget).

      Supported API: true
      Specified by:
      addGroupAndElement in interface VdbBuilder
      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 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:
      addElements in interface VdbBuilder
      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