Class ESIPlantAssignmentLinkRenderer

java.lang.Object
com.ptc.windchill.esi.rnd.BasicESIRenderer
com.ptc.windchill.esi.mpml.processplan.ESIPlantAssignmentLinkRenderer
All Implemented Interfaces:
ESIRenderer

public class ESIPlantAssignmentLinkRenderer extends BasicESIRenderer
Renders the output of MPMPlantAssignmentLink (i.e. <PlantAssignmentLink> </PlantAssignmentLink>) in ESI DataResponse.

Supported API: true

Extendable: true
  • Method Details

    • buildGroups

      protected void buildGroups() throws ESIRendererException
      Renders MPMPlantAssignmentLink objects as added, deleted, changed and unchanged objects appropriately. Invokes the API getPlantAndAssignmentLinks(MPMPlantOwned) to fetch the plants associated with the input MPMPlantOwned object, in case the array of collections passed in as input to the setData(MPMPlantOwned, Collection[], Collection, String, String) API is empty.

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

      protected com.infoengine.object.factory.Element adjustElement(com.infoengine.object.factory.Element elem, String groupName, MPMPlantAssignmentLink plantAssignmentLink, MPMPlant plant, MPMPlantOwned mpmPlantOwned, Collection<ESITarget> targets)
      Allow subclasses to fix the contents of an element before it's added to the output group(s). Default behavior is to return the argument.

      Supported API: true
      Parameters:
      elem - - The element to be updated.
      groupName - - The logical name of the group to which the element will be added.
      plantAssignmentLink - - link between plant owned(process plan/part) and plant.
      plant - - plant which is the roleB iteration of the input plant assignment link.
      mpmPlantOwned - - process plan/part to which the input plant is associated.
      targets - - Collection targets.
      Returns:
      Updated element.
    • validate

      protected void validate() throws ESIRendererException
      Ensures that the data needed to execute this renderer is set appropriately using setData(MPMPlantOwned, Collection[], Collection, String, String) API.

      Supported API: true
      Specified by:
      validate in class BasicESIRenderer
      Throws:
      ESIRendererException
      See Also:
    • setData

      public void setData(MPMPlantOwned plantOwnedObj, Collection<MPMPlantAssignmentLink>[] plantAssignmentLinks, Collection<ESITargetAssociation> tgtAssociations, String auth, String adapter) throws ESIRendererException
      Set this renderer's member variables that are necessary for rendering plant assignment links i.e. MPMPlantAssignmentLink.

      Supported API: true
      Parameters:
      plantOwnedObj - - Object to which the plants are assigned. part/process plan etc.
      plantAssignmentLinks - - Collection of plant assignment links i.e. MPMPlantAssignmentLink objects. The collection at index-0 is expected to contain the links which are newly added to the input plant owned object , index-1 deleted links, index-2 changed links and index-3 unchanged links. If all these collections are empty, then this renderer queries the database to find the links and associated plants.
      tgtAssociations - - Collection of target assignments with the plant owned.
      auth - - Info*Engine authentication information to be used when invoking a query task.
      adapter - - Windchill adapter instance name to be used when executing a info*engine webject.
      Throws:
      ESIRendererException - if any exception thrown by an ESIRenderer.
    • getPlantOwnedObj

      public MPMPlantOwned getPlantOwnedObj()
      Returns the plant owned (process plan/part) object.

      Supported API: true
      Returns:
      the plant owned (process plan/part) object.
    • getAssignmentLinks

      public Collection<MPMPlantAssignmentLink>[] getAssignmentLinks()
      Returns an array of plant assignment links.

      Supported API: true
      Returns:
      an array of plant assignment links.
    • getTgtAssociations

      public Collection<ESITargetAssociation> getTgtAssociations()
      Returns collection of target associations.

      Supported API: true
      Returns:
      collection of target associations.
    • getPlantsToBeRendered

      public Collection<MPMPlant> getPlantsToBeRendered()
      Returns collection of plants.

      Supported API: true
      Returns:
      collection of plants.
    • addToPlantsToBeRendered

      public void addToPlantsToBeRendered(MPMPlant plant)
      Adds the input plant to a collection which can be fetched using the API getPlantsToBeRendered()

      Supported API: true
      Parameters:
      plant - - plant