Class ReconciliationContext

java.lang.Object
com.ptc.windchill.associativity.reconciliation.AbstractReconciliationContext
com.ptc.windchill.associativity.reconciliation.ReconciliationContext

public class ReconciliationContext extends AbstractReconciliationContext
Bean to store common information required to find/verify/resolve discrepancies

Supported API: true

Extendable: true
  • Method Details

    • getChangeContext

      public Associative getChangeContext()
      Returns the specified change context. This is usually the common parent under which all reconciliation needs to happen. Ideally should be nearest common parent for performance reasons.

      Supported API: true
      Returns:
      - ideally should never return null as this is mandatory.
    • setChangeContext

      public void setChangeContext(Associative changeContext)
      Allows to specify the change context. This is usually the common parent under which all reconciliation needs to happen. Ideally should be nearest common parent for performance reasons.

      Supported API: true
    • getDownstreamContext

      public Associative getDownstreamContext()
      Returns the specified downstream change context. This is usually the downstream equivalent of the getChangeContext(). This is optional and if not provided, system tries to populate this using equivalence link.

      Supported API: true
      Returns:
      - can return null as this is not mandatory.
    • setDownstreamContext

      public void setDownstreamContext(Associative downstreamContext)
      Allows to specified downstream change context. This is usually the downstream equivalent of the getChangeContext(). This is optional and if not provided, system tries to populate this using equivalence link. Ideally in case of multiple-downstream equivalent it may make sense to provide this and call the reconciliation for different downstream context in a loop.

      Supported API: true
    • getChangeItems

      public Collection<Associative> getChangeItems()
      Returns the specified change items. This is the collection of parts which have changed under the getChangeContext(). This should never be empty.

      Supported API: true
      Returns:
      - should never return null as this is mandatory.
    • getChangeables

      public Collection<Persistable> getChangeables()
      Returns the specified change items. This is the collection of changeables which have changed.This should never be empty.

      Supported API: true
      Returns:
      - should never return null as this is mandatory.
    • setChangeItems

      public void setChangeItems(Collection<Associative> changeItems)
      Allows to specify the change items. This is the collection of parts which have changed under the getChangeContext(). This should never be empty.

      Supported API: true

      Supported API: true
    • getEquivalentContexts

      public Collection<AssociativePair> getEquivalentContexts()
      Returns the specified equivalent contexts in which reconciliation is going to work.

      Supported API: true
      Returns:
      - should never return null, but can be empty as is optional
    • setEquivalentContexts

      public void setEquivalentContexts(Collection<AssociativePair> equivalentContexts)
      Allows to specify the equivalent context in which to limit the resolution for multi-equivalent use cases. This is optional and needed for specific use cases where we wish to handle such use cases one by one.

      Supported API: true
    • setChangeables

      public void setChangeables(Collection<Persistable> changeables)
      Allows to specify the change items. This is the collection of Changeables which have changed This should never be empty.

      Supported API: true
    • getChangeItemPaths

      public Collection<AssociativePath> getChangeItemPaths()
      Get the specified path for getChangeItems() under the getChangeContext(). this is usually provided when action is invoked from UI where we have path information. Helps in performance to not do a where-used to find the path. If not provided system calculates this information as this is needed to find the accountable paths for reconciliation.
      Returns:
      - can return empty as this is optional, and usually is populated by service at point of need.

      Supported API: true
    • setChangeItemPaths

      public void setChangeItemPaths(Collection<AssociativePath> changeItemPaths)
      Allows to specify path for getChangeItems() under the getChangeContext(). this is usually provided when action is invoked from UI where we have path information. Helps in performance to not do a where-used to find the path. If not provided system calculates this information as this is needed to find the accountable paths for reconciliation.

      Supported API: true If path information is available, its desirable to provide that.
    • getUpNavCriteria

      public NavigationCriteria getUpNavCriteria()
      The NavigationCriteria to be used to navigate the upstream structure for reconciliation. This is optional, but desirable to be provided. If not provided we try to populate this from the default navigation criteria delegate service.

      Supported API: true
      Returns:
      - should never return null as this is populated at the start of service if not provided.
    • setUpNavCriteria

      public void setUpNavCriteria(NavigationCriteria upNavCriteria)
      The NavigationCriteria to be used to navigate the upstream structure for reconciliation. This is optional, but desirable to be provided. If not provided we try to populate this from the default navigation criteria delegate service.

      Supported API: true
    • getDnNavCriteria

      public NavigationCriteria getDnNavCriteria()
      The NavigationCriteria to be used to navigate the downstream structure for reconciliation. This is optional, but desirable to be provided. If not provided we try to populate this from the default navigation criteria delegate service.

      Supported API: true
    • setDnNavCriteria

      public void setDnNavCriteria(NavigationCriteria dnNavCriteria)
      The NavigationCriteria to be used to navigate the downstream structure for reconciliation. This is optional, but desirable to be provided. If not provided we try to populate this from the default navigation criteria delegate service.

      Supported API: true
    • getChangeCriteria

      public String getChangeCriteria()
      This is string criteria coming from the client. This is optional and if provided we call the ReconciliationDelegate.populateChangeItemsFromChange(ReconciliationContext). OOTB this is number for WTChangeOrder2 or WTChangeActivity2. But can be anything and handled in the delegate. Allows the service to derive the populate getChangeItems() from a change notice.

      Supported API: true
      Returns:
      - a string representation of criteria, can return null as this is optional.
    • setChangeCriteria

      public void setChangeCriteria(String changeCriteria)
      This is string criteria coming from the client. This is optional and if provided we call the ReconciliationDelegate.populateChangeItemsFromChange(ReconciliationContext). OOTB this is number for WTChangeOrder2 or WTChangeActivity2. But can be anything and handled in the delegate. Allows the service to derive the populate getChangeItems() from a change notice.

      Supported API: true
    • getCriteria

      public AbstractCriteria getCriteria() throws WTException
      Return the configured criteria to be used to build structure to compare with input. This is again optional and OOTB we try to get the default criteria configured in the configuration. If none found, the last fall back is on OutOfDateCriteria

      Supported API: true
      Returns:
      - Configured criteria or default Out of date criteria
      Throws:
      WTException
    • setCriteria

      public void setCriteria(AbstractCriteria criteria) throws WTException
      Allows specifying the criteria to be used. This is optional. refer getCriteria() for more.

      Supported API: true
      Parameters:
      criteria -
      Throws:
      WTException
    • getMode

      public ReconciliationContext.Mode getMode()
      Mostly for internal use, but this tells if the service call is for detection or for resolution. This is typically needed for building the JSON for discrepancies found based on the phase of service call.

      Supported API: true
      Returns:
      - should never return null
    • setMode

      public void setMode(ReconciliationContext.Mode mode)
      Refer getMode()

      Supported API: true
    • isCompareDownstream

      public boolean isCompareDownstream()
      Tells if the reconciliation should work between given upstream and downstream structure. By default Reconciliation works by tracking changes on upstream side only. Setting this flag to true means we will compare with downstream if structure are in sync or not

      Supported API: true

      Overrides:
      isCompareDownstream in class AbstractReconciliationContext
      Returns:
    • setCompareMode

      public void setCompareMode(DiscrepancyDelegate.CompareMode compMode)


      Supported API: true

    • getTargetPaths

      public List<AssociativePath> getTargetPaths()


      Supported API: true
      Returns:
    • setTargetPaths

      public void setTargetPaths(List<AssociativePath> list)


      Supported API: true
      Parameters:
      list -
    • isOccurenceMode

      public boolean isOccurenceMode()


      Supported API: true
      Returns:
    • setOccurenceMode

      public void setOccurenceMode(boolean isOccurenceMode)


      Supported API: true
      Parameters:
      isOccurenceMode -
    • getActionType

      public String getActionType()


      Supported API: true
      Returns:
      the actionType
    • setActionType

      public void setActionType(String actionType)


      Supported API: true
      Parameters:
      actionType - the actionType to set
    • isRuleMatching

      public boolean isRuleMatching()


      Supported API: true
      Returns:
    • setRuleMatching

      public void setRuleMatching(boolean isRuleMatching)


      Supported API: true
      Parameters:
      isRuleMatching -