Class MPMLUtility
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns the value of the property "com.ptc.windchill.esi.AbortTransactionWhenNestedSquencesFound".static HashMapcompareMPMOperation(MPMOperation currentIteration, MPMOperation previousIteration, VdbBuilder builder) Compares two iterations of an operation.static HashMapcompareMPMOperation(MPMOperation currentIteration, MPMOperation previousIteration, VdbBuilder builder, Set links) Compares two iterations of an operation.static HashMapcompareMPMProcessPlan(MPMProcessPlan currentIteration, MPMProcessPlan previousIteration) Compares two iterations of a process plan.static HashMapcompareMPMProcessPlan(MPMProcessPlan currentIteration, MPMProcessPlan previousIteration, Set linksToCompute) Compares two iterations of a process plan.compareMPMResource(MPMResource currentObj, MPMResource previousObj) Compares two iterations of anMPMResource.static HashMapcompareMPMSequence(MPMSequence currentIteration, MPMSequence previousIteration) Compares two iterations of a sequence.static HashMapcompareMPMStandardCC(MPMControlCharacteristic currentIteration, MPMControlCharacteristic previousIteration) Compares two iterations of a standard CC.static HashMapcompareProductionVersion(wt.mpm.routing.WCRoutingPlan currentIteration, wt.mpm.routing.WCRoutingPlan previousIteration) Compares two iterations of a production version.static HashMapcompareWTPartsForCCLinks(Persistable currentObj, Persistable previousObj) Compares two iterations of a WTPart.static HashMapcompareWTPartsForSCCLinks(Persistable currentObj, Persistable previousObj, VdbBuilder builder) Compares two iterations of a WTPart.static ConfigSpecgetConfigSpec(Persistable wtContained, ViewReference defaultView, Persistable root) Returns the ConfigSpec instance given a master, view and the root object.static CollectiongetIterationFromMaster(Collection masters, ViewReference defaultView, Persistable root) Returns a collection of iterations give a collection of masters, view and the root object.static WTObjectgetIterationFromMaster(Mastered master, ViewReference defaultView, Persistable root) Returns an iteration (as a WTObject) given a master, view and a root object.static StringgetPublishClass(Persistable persistable) Returns the release class based on the type of object being passed as input.static booleanFetches the value of the property "com.ptc.windchill.esi.mpml.useCompIdForMappingOperationToPartLinks" from the file esi.properties and returns its boolean value to the caller.
-
Method Details
-
compareMPMProcessPlan
public static HashMap compareMPMProcessPlan(MPMProcessPlan currentIteration, MPMProcessPlan previousIteration) throws WTException Compares two iterations of a process plan. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of a process plan.previousIteration- Previous iteration of a process plan.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception during iterations compare.
-
compareMPMProcessPlan
public static HashMap compareMPMProcessPlan(MPMProcessPlan currentIteration, MPMProcessPlan previousIteration, Set linksToCompute) throws WTException Compares two iterations of a process plan. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of a process plan.previousIteration- Previous iteration of a process plan.linksToCompute- Links to compute- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception during iterations compare.
-
compareProductionVersion
public static HashMap compareProductionVersion(wt.mpm.routing.WCRoutingPlan currentIteration, wt.mpm.routing.WCRoutingPlan previousIteration) throws WTException Compares two iterations of a production version. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of a production version.previousIteration- Previous iteration of a production version.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the link
differences in Hashset.
1. Key "LinksDifferenceList" is mapped to the hash set object which holds the link differences.
2. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
In other words,
1. get("LinksDifferenceList") on the output hash map object returns hash set which holds link differences. 2. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences - Throws:
WTException- if any of the invoked methods throws this exception during iterations compare.
-
compareMPMOperation
public static HashMap compareMPMOperation(MPMOperation currentIteration, MPMOperation previousIteration, VdbBuilder builder) throws WTException Compares two iterations of an operation. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of an operation .previousIteration- Previous iteration of an operation.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareMPMOperation
public static HashMap compareMPMOperation(MPMOperation currentIteration, MPMOperation previousIteration, VdbBuilder builder, Set links) throws WTException Compares two iterations of an operation. This method internally invokes the object comparison frame work. It will compare only those links which are passed in argument other links will be ignored.
Supported API: true- Parameters:
currentIteration- Current iteration of an operation .previousIteration- Previous iteration of an operation.builder- VdbBuilderlinks- Link to be compared- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareMPMStandardCC
public static HashMap compareMPMStandardCC(MPMControlCharacteristic currentIteration, MPMControlCharacteristic previousIteration) throws WTException Compares two iterations of a standard CC. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of SCC .previousIteration- Previous iteration of SCC.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareMPMSequence
public static HashMap compareMPMSequence(MPMSequence currentIteration, MPMSequence previousIteration) throws WTException Compares two iterations of a sequence. This method internally invokes the object comparison frame work.
Supported API: true- Parameters:
currentIteration- Current iteration of a sequence.previousIteration- Previous iteration of a sequence.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to the hash map object which holds the link differences.
In other words,
1. get("AttributeDifferenceList")on the output hash map object returns another hash map which holds the attribute differences
2. get("LinksDifferenceList") on the output hash map object returns another hash map which holds link differences. - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareWTPartsForCCLinks
public static HashMap compareWTPartsForCCLinks(Persistable currentObj, Persistable previousObj) throws WTException Compares two iterations of a WTPart. This method internally invokes the object comparison frame work.
Supported API: true
- Parameters:
currentObj- - Current iteration of a WTPart.previousObj- - Previous iteration of a WTPart.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to an array of HashSet objects which holds the link differences.
In other words,
1. get("AttributeDifferenceList") on the output hash map object returns another hash map which holds the attribute differences. Key of the value map is fully qualified name of the link and the value is a HashMap with key as <Role B object master identifier>_<attribute name> and the value is the old value of the attribute. Check the methodESIObjectComparisonUtility.computeAttrDifferences(ComparisonResult)for more information.2. get("LinksDifferenceList") on the output hash map object returns an array of HashSet objects.
HashSet at index 0 holds all the addedMPMPartQualityLinkobjects.
Index-1 : deletedMPMPartQualityLinkobjects,
Index-2: changedMPMPartQualityLinkobjects,
Index-3: UnchangedMPMPartQualityLinkobjects - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareWTPartsForSCCLinks
public static HashMap compareWTPartsForSCCLinks(Persistable currentObj, Persistable previousObj, VdbBuilder builder) throws WTException Compares two iterations of a WTPart. This method internally invokes the object comparison frame work.
Supported API: true
- Parameters:
currentObj- - Current iteration of a WTPart.previousObj- - Previous iteration of a WTPart.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to an array of HashSet objects which holds the link differences.
In other words,
1. get("AttributeDifferenceList") on the output hash map object returns another hash map which holds the attribute differences. Key of the value map is fully qualified name of the link and the value is a HashMap with key as <Role B object master identifier>_<attribute name> and the value is the old value of the attribute. Check the methodESIObjectComparisonUtility.computeAttrDifferences(ComparisonResult)for more information.2. get("LinksDifferenceList") on the output hash map object returns an array of HashSet objects.
HashSet at index 0 holds all the addedMPMPartQualityLinkobjects.
Index-1 : deletedMPMPartQualityLinkobjects,
Index-2: changedMPMPartQualityLinkobjects,
Index-3: UnchangedMPMPartQualityLinkobjects - Throws:
WTException- if any of the invoked methods throws this exception.
-
compareMPMResource
public static Map<String,Object> compareMPMResource(MPMResource currentObj, MPMResource previousObj) throws WTException Compares two iterations of anMPMResource. This method internally invokes the object comparison frame work.
Supported API: true
- Parameters:
currentObj- - Current iteration of a resource.previousObj- - Previous iteration of a resource.- Returns:
- Returns the comparison result in a java.util.HashMap. This HashMap object holds the attribute and link
differences in two separate hash maps.
1. Key "AttributeDifferenceList" is mapped to the hash map object which holds the attribute differences.
2. Key "LinksDifferenceList" is mapped to an array of HashSet objects which holds the link differences.
In other words,
1. get("AttributeDifferenceList") on the output hash map object returns another hash map which holds the attribute differences. Key of the value map is fully qualified name of the link and the value is a HashMap with key as <Role B object master identifier>_<attribute name> and the value is the old value of the attribute. Check the methodESIObjectComparisonUtility.computeAttrDifferences(ComparisonResult)for more information.2. get("LinksDifferenceList") on the output hash map object returns an array of HashSet objects.
HashSet at index 0 holds all the addedWTPartUsageLinkobjects.
Index-1 : deletedWTPartUsageLinkobjects,
Index-2: changedWTPartUsageLinkobjects,
Index-3: UnchangedWTPartUsageLinkobjects - Throws:
WTException- if any of the invoked methods throws this exception.
-
getPublishClass
Returns the release class based on the type of object being passed as input.
Supported API: true- Parameters:
persistable- Object for which release class needs to be determined.- Returns:
- Name of the release class for the input object.
-
getIterationFromMaster
public static Collection getIterationFromMaster(Collection masters, ViewReference defaultView, Persistable root) throws WTException Returns a collection of iterations give a collection of masters, view and the root object. The method uses configuration specification specified as a value for the preference "Configuration Specification Class".
Supported API: true- Parameters:
masters- the collection of masters whose iterations are to be calculated.defaultView- the view of the root object.root- it could be the root object of the transaction or the parent of the masters whose iteration is to be determined.- Returns:
- the collection of the iteration for each part master.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
getIterationFromMaster
public static WTObject getIterationFromMaster(Mastered master, ViewReference defaultView, Persistable root) throws WTException Returns an iteration (as a WTObject) given a master, view and a root object. The method uses configuration specification specified as a value for the preference "Configuration Specification Class".
Supported API: true- Parameters:
master- the master whose iteration is to be calculated.defaultView- the view of the root object.root- it could be the root object of the transaction or the parent of the masters whose iteration is to be determined.- Returns:
- the collection of the iteration for each part master.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
getConfigSpec
public static ConfigSpec getConfigSpec(Persistable wtContained, ViewReference defaultView, Persistable root) throws WTException Returns the ConfigSpec instance given a master, view and the root object. The method creates an instance of the configuration specification class specified as a value for the preference "Configuration Specification Class" and initializes it with appropraite values.
Supported API: true- Parameters:
wtContained- Th WTContained object. This is used for fetching the value of an organization specific preference.defaultView- the view of the root object.root- it could be the root object of the transaction or the parent of the master whose iteration is to be determined.- Returns:
- the ConfigSpec instance.
- Throws:
WTException- if any of the invoked methods throws this exception.
-
abortTransactionWhenNestedSquencesFound
public static boolean abortTransactionWhenNestedSquencesFound()Returns the value of the property "com.ptc.windchill.esi.AbortTransactionWhenNestedSquencesFound". If this property is not available in esi.properties file, A true will be assumed as the value. Out-of-the-box, this property is not available in esi.properties file.
Supported API: true- Returns:
- the value of the property "com.ptc.windchill.esi.AbortTransactionWhenNestedSquencesFound".
-
useCompIdForMappingOperationToPartLinks
public static boolean useCompIdForMappingOperationToPartLinks()Fetches the value of the property "com.ptc.windchill.esi.mpml.useCompIdForMappingOperationToPartLinks" from the file esi.properties and returns its boolean value to the caller. A false is returned if the said property is not found set in esi.properties.
Supported API: true- Returns:
- The boolean value of the property "com.ptc.windchill.esi.mpml.useCompIdForMappingOperationToPartLinks" corresponding to the setting in esi.properties.
-