Class WorkflowProcessHelper
java.lang.Object
com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper
This class contains static methods to support the PDMLink Workflow processes
These methods are intended to be called by routing expressions and synchronization robot expressions.
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: truestatic final StringString constant
Supported API: true -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapplyImpacts(VersionableChangeItem changeItem) Apply the impact of a change activity, and all the change activities of a change order, on associatedImpactedobjects.static booleanapplyImpacts(WTCollection changeItems) Apply the impact of change activities, and all the change activities of change orders, on associatedImpactedobjects.static voidapplyPendingEffectivities(ChangeOrderIfc changeNotice) Processes pending effectivities on a change notice, creating active product effectivities.static voidapproveHangingChanges(WTChangeOrder2 cOrder) Set the UnIncorporatedChange status to APPROVED or INCORPORATED depending on the current state of the unincorporated changes.static booleanchangeNoticeExists(Object changeItem) Return true if a change notice exists for the given change request.static StringcheckActivitiesFinished(ChangeOrder2 changeOrder) This method checks if the state of all of the associated Change Tasks of the change order: - If there are associated Change Tasks and at least one of the Change Tasks are in the LCM_RESOLVED_STATE and the rest are either in the LCM_RESOLVED_STATE or the LCM_CANCELLED_STATE then return RESOLVED.static StringcheckImplementation(WTChangeOrder2 cOrder) Deprecated.- Use cOrder.getState().toString()static StringcheckOrdersFinished(ChangeRequest2 cRequest) This method checks if the state of all of the associated ECNs of the cRequest: - If at least on of the ECNs are in the LCM_RESOLVED_STATE and the rest are either in the LCM_RESOLVED_STATE or the LCM_CANCELLED_STATE then return RESOLVED.static voidcloseChangeChildren(Object changeItem, Map<Class, State> stateMap) Given a change item, and a map of class types to states, this API will look up the children of the given change item and will close the children with the given states.static voidcloseChangeParents(Object changeItem, Map<Class, State> stateMap) Given a change item, and a map of class types to states, this API will look up the parents of the given change item and will close the parents with the given states.static WTChangeOrder2
Supported API: true This finds the associated Change Order for a Change Activity.getActivityParticipants(VersionableChangeItem changeItem, String activityName) Get participants of a completed work activity for a change item.getChangeItemParticipants(VersionableChangeItem changeItem) Get all participants of a change item team.static ChangeNoticeComplexitygetComplexity(WTChangeOrder2 changeOrder)
Supported API: true This method returns the complexity of an ECN, as opposed to the complexity of an associated ECR.static StategetECNPendingImplementationState(ChangeOrder2 changeOrder) Will return the LifeCycleState value from the "Pending Implementation State" property on Change Notice type.static WTCollectionDeprecated.This method hardcodes unpromotable check to Change transition.static voidEmits the CHANGE IMPLEMENTATION event for all the associated Change Activities for the given Change Order.static booleanChecks if the given Change Activity is ready to execute the work flow or not.static BooleanisComplex(WTChangeOrder2 changeOrder) This method returns true if the complexity of any Change Request associated to the changeOrder is COMPLEX.static booleanisRelatedChildrenInStates(Object changeItem, String[] states) Given a ChangeItem and an array of states, look up the related child objects and determine if each one is in one of the given states.static booleanisRelatedChildrenInStates(Object changeItem, String[] states, String[] filterByChangeTypeIds) Given a ChangeItem and an array of states, look up the related child objects that match specified change filter types and determine if each one is in one of the given states.static booleanisRelatedParentsInStates(Object changeItem, String[] states) Given a ChangeItem and an array of states, look up the related parent objects and determine if each one is in one of the given states.static booleanisRelatedParentsInStates(Object changeItem, String[] states, String[] filterByChangeTypeIds) Given a ChangeItem and an array of states, look up the related parent objects that match specified change filter types and determine if each one is in one of the given states.static booleanisStateValidForLifeCycleTemplate(LifeCycleManaged object, State state) Verify that the passed state is valid for the LifeCycleTemplate of the passed LifeCycleManaged object.static UIValidationResultSetperformChangeWorkflowValidation(VersionableChangeItem changeItem, String selector) Deprecated.- Replace the caller procedure to use wt.businessRules.BusinessRulesHelper.engine.execute(String ruleSetKey, RuleValidationCriteria criteria)
See com.ptc.core.businessRules.engine.BusinessRulesEngine# executestatic voidprocessBusinessDecision(ChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String comments) This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: truestatic voidprocessBusinessDecision(WTChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String track, String comments) This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: trueprotected static voidprocessBusinessDecisionImpl(ChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String comments) This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: truestatic voidprocessConfirmation(WTChangeIssue changeIssue, ConfirmationCategory a_ConfirmationCategory) This method processes the confirmation of a Problem Report: - Persist the ConfirmationCategory on the Problem Report - Persist the ConfirmationAudit on the Problem Report
Supported API: truestatic voidDeprecated.static voidpromoteChangeables(ChangeOrder2 cOrder) Deprecated.static voidReject the unincorporated changes for the change notice that is being rejected by the CIB review.static voidGiven the versionableChangeItem, this method will release the changeables based on the persisted TargetTransition on the ChangeRecord2.static voidrescheduleChangeItem(VersionableChangeItem changeItem) Reschedule a change plan activity for a change item.static voidsetChangeItemParticipants(VersionableChangeItem changeItem, Role role, WTCollection participants) Set the participants for a role of a change item team.static voidsetChangeRedlineState(WTChangeOrder2 changeNotice, State changeVersionState, ChangeVersionState changeVersionLinkStateToUpdate, Set<ChangeVersionState> changeVersionLinkStates, boolean undoCheckoutRedlines) Set the state for all change versions in the passed change notice.static voidsetCRResolutionDate(ChangeRequest2 changeRequest) Deprecated.- Use WorkflowProcessHelper.setResolutionDate(changeItem)static voidsetECNActualStartDate(ChangeOrder2 changeOrder) This method sets the actual start date of a Change Notice
Supported API: truestatic voidsetECNResolutionDate(ChangeOrder2 changeOrder) Deprecated.useWorkflowProcessHelper.closeChangeChildren(changeItem)instead.static voidsetECNResolutionDate(ChangeOrder2 changeOrder, String changeTaskState) Deprecated.useWorkflowProcessHelper.closeChangeChildren(changeItem)instead.static voidsetPRResolutionDate(ChangeIssue changeIssue) Deprecated.- Use WorkflowProcessHelper.setResolutionDate(changeItem)static voidsetResolutionDate(Object changeItem) This method sets the resolution date of a Change Item.static voidsetRolesToECN(ChangeOrder2 changeOrder, String... roles)
Supported API: true Obtains the principles assigned to the given roles on all parent Change Requests and copies those principles to the same role on the passed Change Order.static voidsetRoleToECN(ChangeOrder2 changeOrder, String sRole) Obtains the principles assigned to the given role on all parent Change Requests and copies those principles to the same role on the passed Change Order.static voidsetRoleToECR(ChangeRequest2 request, String sRole) Obtains the principles assigned to the given role on all associated Change Issues and copies those principles to the same role on the passed Change Request.static voidsetSubmitterRole(VersionableChangeItem chg, String sRole) Assigns the original creator of the change item to the specified role
Supported API: truestatic voidsetTrack(WTChangeRequest2 changeRequest, String track) This method sets the complexity (track) of a change request
Supported API: truestatic voidsetVarianceAuthorRole(WTVariance variance, String sRole) setVarianceAuthorRole
Supported API: true Sets the variance owner principal to the Variance Author role.static voidChanges the state of a ChangeOrder2's associated ChangeActivity2's to be the same state as the ChangeOrder2.
-
Field Details
-
CRITICAL
String constant
Supported API: true- See Also:
-
CONFIRMED
String constant
Supported API: true- See Also:
-
NON_CRITICAL
String constant
Supported API: true- See Also:
-
RESOLVED
String constant
Supported API: true- See Also:
-
CANCELLED
String constant
Supported API: true- See Also:
-
RELEASED
String constant
Supported API: true- See Also:
-
NOT_ASSOCIATED
String constant
Supported API: true- See Also:
-
NOT_FINISHED
String constant
Supported API: true- See Also:
-
NO_SUBORDINATES
String constant
Supported API: true- See Also:
-
NOT_SUBMITTED
String constant
Supported API: true- See Also:
-
SIMPLE
String constant
Supported API: true- See Also:
-
COMPLEX
String constant
Supported API: true- See Also:
-
PR_AUTHOR
String constant
Supported API: true- See Also:
-
IMPLEMENTATION
String constant
Supported API: true- See Also:
-
-
Method Details
-
processConfirmation
public static void processConfirmation(WTChangeIssue changeIssue, ConfirmationCategory a_ConfirmationCategory) throws WTPropertyVetoException, WTException This method processes the confirmation of a Problem Report: - Persist the ConfirmationCategory on the Problem Report - Persist the ConfirmationAudit on the Problem Report
Supported API: true- Parameters:
changeIssue-a_ConfirmationCategory-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
setECNResolutionDate
@Deprecated public static void setECNResolutionDate(ChangeOrder2 changeOrder, String changeTaskState) throws WTException Deprecated.useWorkflowProcessHelper.closeChangeChildren(changeItem)instead.This method sets the resolution date of a Change Notice and sets the state of the associated Change Tasks.
Supported API: true- Parameters:
changeOrder- the change order to set the resolution date on and whose related change tasks state will be setchangeTaskState- the state the change tasks related to the change order will be set to- Throws:
WTException- See Also:
-
setECNResolutionDate
Deprecated.useWorkflowProcessHelper.closeChangeChildren(changeItem)instead.This method sets the resolution date of a Change Notice. This method also sets the state of the associated Change Tasks to the CA_RESOLVED_STATE
Supported API: true- Parameters:
changeOrder-- Throws:
WTException- See Also:
-
setECNActualStartDate
public static void setECNActualStartDate(ChangeOrder2 changeOrder) throws WTException, WTPropertyVetoException This method sets the actual start date of a Change Notice
Supported API: true- Parameters:
changeOrder-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
isStateValidForLifeCycleTemplate
public static boolean isStateValidForLifeCycleTemplate(LifeCycleManaged object, State state) throws WTException Verify that the passed state is valid for the LifeCycleTemplate of the passed LifeCycleManaged object.
Supported API: true- Parameters:
object- The LifeCycleManaged objectstate- The state to verify.- Returns:
- boolean
- Throws:
WTException
-
getECNPendingImplementationState
Will return the LifeCycleState value from the "Pending Implementation State" property on Change Notice type. Will only supportWTChangeOrder2object. Will return null for other objects.
Supported API: true- Parameters:
changeItem- - A Change Notice object. OnlyWTChangeOrder2object is handled.- Returns:
- Throws:
WTException
-
setResolutionDate
This method sets the resolution date of a Change Item. It returns the new version.
Supported API: true- Parameters:
changeItem-- Throws:
WTException
-
setPRResolutionDate
Deprecated.- Use WorkflowProcessHelper.setResolutionDate(changeItem)
Supported API: true This method sets the resolution date of a Problem Report.- Parameters:
changeIssue-- Throws:
WTException- See Also:
-
setCRResolutionDate
Deprecated.- Use WorkflowProcessHelper.setResolutionDate(changeItem)This method sets the resolutionDate field of a ChangeRequest and saves it in the database. The resolutionDate is calculated via System.currentTimeMillis(); This method is intended to be executed inside a workflow. This method does not update any other Change objects.
Supported API: true- Parameters:
changeRequest-- Throws:
WTException
-
getUnpromotableChangeables
@Deprecated public static WTCollection getUnpromotableChangeables(ChangeOrder2 cOrder) throws WTException Deprecated.This method hardcodes unpromotable check to Change transition. But we dont limit customers to check for CHANGE Transition. They can validate for any transition and hence this method is deprecated and will be removed in future releases.Return the changeable2 objects associated through the ChangeRecord2 link that have no CHANGE transition.
Supported API: true- Parameters:
cOrder-- Returns:
- WTCollection
- Throws:
WTException- See Also:
-
promoteChangeables
Deprecated.All the changeables of a ChangeOrder are automatically promoted to state defined by the CHANGE transition. In Addition, If any of the changeables have a live workflow, it is terminated. Deprecation notice - this should no longer be called from the workflow! Instead, you should be calling the api: releaseChangeables(versionableChangeItem).
Supported API: true- Parameters:
cOrder-- Throws:
WTException
-
promoteChangeables
Deprecated.All the changeables of a ChangeActivity are automatically promoted to the state defined by the CHANGE transition. If any of the changeables have a running workflow, it is terminated prior to the transition occuring. Deprecation notice - this should no longer be called from the workflow! Instead, you should be calling the api: releaseChangeables(versionableChangeItem).
Supported API: true- Parameters:
ca- The change activity for which the change records will be promoted.- Throws:
WTException
-
releaseChangeables
Given the versionableChangeItem, this method will release the changeables based on the persisted TargetTransition on the ChangeRecord2. This method also calls sync API to update the Affected objects to latest released in eligible Change Tasks and also triggers the sync for open and eligible Redlines.
Supported API: true- Parameters:
changeOrder-- Throws:
WTException
-
processBusinessDecision
public static void processBusinessDecision(WTChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String track, String comments) throws WTPropertyVetoException, WTException This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: true- Parameters:
changeRequest-a_BusinessDecision-track-comments-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
processBusinessDecision
public static void processBusinessDecision(ChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String comments) throws WTPropertyVetoException, WTException This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: true- Parameters:
changeRequest-a_BusinessDecision-comments-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
processBusinessDecisionImpl
protected static void processBusinessDecisionImpl(ChangeRequest2 changeRequest, BusinessDecisionCategory a_BusinessDecision, String comments) throws WTPropertyVetoException, WTException This method processes the business decision of a Change Request: - Persist the BusinessDecisionSummary on the Change Request - Persist the BusinessDecisionAudit on the Change Request
Supported API: true- Parameters:
changeRequest-a_BusinessDecision-comments-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
setTrack
public static void setTrack(WTChangeRequest2 changeRequest, String track) throws WTPropertyVetoException, WTException This method sets the complexity (track) of a change request
Supported API: true- Parameters:
changeRequest-track-- Throws:
WTExceptionWTPropertyVetoException- See Also:
-
checkOrdersFinished
This method checks if the state of all of the associated ECNs of the cRequest: - If at least on of the ECNs are in the LCM_RESOLVED_STATE and the rest are either in the LCM_RESOLVED_STATE or the LCM_CANCELLED_STATE then return RESOLVED. - If all of the ECNs are in the LCM_CANCELLED_STATE then return CANCELLED. - If there are no associated Change Notices then return NO_SUBORDINATES. - If any are in some other state then return NOT_FINISHED.
Supported API: true- Parameters:
cRequest-- Returns:
- String
- Throws:
WTException
-
checkActivitiesFinished
This method checks if the state of all of the associated Change Tasks of the change order: - If there are associated Change Tasks and at least one of the Change Tasks are in the LCM_RESOLVED_STATE and the rest are either in the LCM_RESOLVED_STATE or the LCM_CANCELLED_STATE then return RESOLVED. - If all of the Change Tasks are in the LCM_CANCELLED_STATE then return CANCELLED. - If any Change Tasks are in some other state then return NOT_FINISHED.
Supported API: true- Parameters:
changeOrder-- Returns:
- String
- Throws:
WTExceptionChangeException2
-
rescheduleChangeItem
Reschedule a change plan activity for a change item. Has no effect if the change item has no change plan activity.
Supported API: true- Parameters:
changeItem- Change item that owns a change plan activity.
-
checkImplementation
Deprecated.- Use cOrder.getState().toString()
Supported API: true Return the State of the Change Order.- Parameters:
cOrder-- Returns:
- String
-
findChangeOrder
public static WTChangeOrder2 findChangeOrder(WTChangeActivity2 ca) throws ChangeException2, WTException
Supported API: true This finds the associated Change Order for a Change Activity.- Parameters:
ca-- Returns:
- WTChangeOrder2
- Throws:
WTExceptionChangeException2
-
setRolesToECN
Supported API: true Obtains the principles assigned to the given roles on all parent Change Requests and copies those principles to the same role on the passed Change Order.- Parameters:
changeOrder-roles-- Throws:
WTException
-
setRoleToECN
Obtains the principles assigned to the given role on all parent Change Requests and copies those principles to the same role on the passed Change Order.
Supported API: true- Parameters:
changeOrder-sRole-- Throws:
WTException
-
setRoleToECR
Obtains the principles assigned to the given role on all associated Change Issues and copies those principles to the same role on the passed Change Request.
Supported API: true- Parameters:
request-sRole-- Throws:
WTException
-
getComplexity
Supported API: true This method returns the complexity of an ECN, as opposed to the complexity of an associated ECR.- Parameters:
changeOrder- The change order (ECN) whose complexity will be evaluated.- Returns:
- Complexity The complexity of the passed change order (ECN).
- See Also:
-
isComplex
This method returns true if the complexity of any Change Request associated to the changeOrder is COMPLEX.
Supported API: true- Parameters:
changeOrder-- Returns:
- Boolean
- See Also:
-
setVarianceAuthorRole
setVarianceAuthorRole
Supported API: true Sets the variance owner principal to the Variance Author role.- Parameters:
variance-sRole-- Throws:
WTException
-
setSubmitterRole
Assigns the original creator of the change item to the specified role
Supported API: true- Parameters:
chg-sRole-- Throws:
WTException
-
applyPendingEffectivities
Processes pending effectivities on a change notice, creating active product effectivities. This method directly defers to the effectivity service for processing.
Supported API: true- Parameters:
changeNotice- change notice participating in workflow- Throws:
WTException- surfaced from call to effectivity service method
-
approveHangingChanges
Set the UnIncorporatedChange status to APPROVED or INCORPORATED depending on the current state of the unincorporated changes.
Supported API: true- Parameters:
cOrder- change notice participating in workflow- Throws:
WTException- Caused by an issue in processing the unincorporated changes.
-
rejectUnincorporatedChanges
public static void rejectUnincorporatedChanges(WTChangeOrder2 cOrder) throws WTException, WTPropertyVetoException Reject the unincorporated changes for the change notice that is being rejected by the CIB review. For unincorporated changes for the rejected change notice; Will delete all unincorporated changes of statusPENDING_HANGING. Will set any unincorporated changes of statusPENDING_INCORPORATIONto statusAPPROVED_HANGING. Will set any unincorporated changes of statusPENDING_INCORPORATIONto incorpChange of null.
invalid input: '<'Supported API: true- Parameters:
cOrder- The change notice that is being rejected.- Throws:
WTException- Thrown if an error occurs processing the hanging change links.WTPropertyVetoException- If setting the incorpStatus or incorpChange is not allowed a veto exception is thrown and no work is done for the reject.
-
performChangeWorkflowValidation
@Deprecated public static UIValidationResultSet performChangeWorkflowValidation(VersionableChangeItem changeItem, String selector) throws WTException Deprecated.- Replace the caller procedure to use wt.businessRules.BusinessRulesHelper.engine.execute(String ruleSetKey, RuleValidationCriteria criteria)
See com.ptc.core.businessRules.engine.BusinessRulesEngine# executeCalls the registered validator for the given selector to validate that the change object can move to the phase in the work flow process. The performFullPreValidation is invoked and a validation result set is return with a validation result with the status set to PERMITTED or DENIED. A localized feed back message may be used to communicate why the status was set to DENIED.
Supported API: true- Parameters:
changeItem- The primary business object in the change object work flow.selector- Key for validation- Returns:
- validation result set with the status as PERMITTED or DENIED.
- Throws:
WTException
-
syncChangeActivityState
Changes the state of a ChangeOrder2's associated ChangeActivity2's to be the same state as the ChangeOrder2.
Supported API: true- Parameters:
co-- Throws:
WTException
-
implementChange
Emits the CHANGE IMPLEMENTATION event for all the associated Change Activities for the given Change Order.
Supported API: true- Parameters:
co- - Change Order- Throws:
WTException
-
isChangeActivityReady
Checks if the given Change Activity is ready to execute the work flow or not.
Supported API: true- Parameters:
ca- - Change Activity- Returns:
- boolean - if the given Change Activity is ready or not to execute the workflow.
-
getActivityParticipants
public static Map<Role,WTSet> getActivityParticipants(VersionableChangeItem changeItem, String activityName) throws WTException Get participants of a completed work activity for a change item. If the work activity was executed multiple times (e.g., a rework activity was run several times), then only the participants from the latest completed execution are returned.
Supported API: true- Parameters:
changeItem- Work flow primary business object.activityName- Work flow activity name.- Returns:
- Map of activity roles to the participants for that role, or null if an activity with the specified name has not been executed for the change item.
- Throws:
WTException
-
getChangeItemParticipants
public static Map<Role,WTSet> getChangeItemParticipants(VersionableChangeItem changeItem) throws WTException Get all participants of a change item team.
Supported API: true- Parameters:
changeItem- Change item object.- Returns:
- Map of change item roles to the participants for that role.
- Throws:
WTException
-
setChangeItemParticipants
public static void setChangeItemParticipants(VersionableChangeItem changeItem, Role role, WTCollection participants) throws WTException Set the participants for a role of a change item team. The old participants of the role, if any, will be replaced with the new participants.
Supported API: true- Parameters:
changeItem- Work flow primary business object.role- Change item team role to be set.participants- Collection of new participants for the role. Pass an empty set to remove all participants from the role. Pass null to remove the entire role.- Throws:
WTException
-
isRelatedParentsInStates
public static boolean isRelatedParentsInStates(Object changeItem, String[] states) throws WTException Given a ChangeItem and an array of states, look up the related parent objects and determine if each one is in one of the given states. If each parent object is in one of the given states, then this will return true. Otherwise, it will return false. If there are no parent objects found, then it will also return false.
Supported API: true- Parameters:
changeItem-states-- Throws:
WTException
-
isRelatedParentsInStates
public static boolean isRelatedParentsInStates(Object changeItem, String[] states, String[] filterByChangeTypeIds) throws WTException Given a ChangeItem and an array of states, look up the related parent objects that match specified change filter types and determine if each one is in one of the given states. If each parent object is in one of the given states, then this will return true. Otherwise, it will return false. If there are no parent objects found, then it will also return false.
Supported API: true- Parameters:
changeItem-states-filterByChangeTypeIds- Change type identifiers to filter by- Throws:
WTException
-
isRelatedChildrenInStates
public static boolean isRelatedChildrenInStates(Object changeItem, String[] states) throws WTException Given a ChangeItem and an array of states, look up the related child objects and determine if each one is in one of the given states. If each child object is in one of the given states, then this will return true. Otherwise, it will return false. If there are no child objects found, then it will also return false.
Supported API: true- Parameters:
changeItem-states-- Throws:
WTException
-
isRelatedChildrenInStates
public static boolean isRelatedChildrenInStates(Object changeItem, String[] states, String[] filterByChangeTypeIds) throws WTException Given a ChangeItem and an array of states, look up the related child objects that match specified change filter types and determine if each one is in one of the given states. If each child object is in one of the given states, then this will return true. Otherwise, it will return false. If there are no child objects found, then it will also return false.
Supported API: true- Parameters:
changeItem-states-filterByChangeTypeIds- Change type identifiers to filter by- Throws:
WTException
-
closeChangeChildren
public static void closeChangeChildren(Object changeItem, Map<Class, State> stateMap) throws WTExceptionGiven a change item, and a map of class types to states, this API will look up the children of the given change item and will close the children with the given states. This method supports both legacy or flexible change objects. For legacy change items, the objects will close according to the traditional child role. For flexible change items, the child members of the ChangeProcessLink will be closed. When a change item is closed, the following changes occur to the object:- The resolution date is set
- The state is set
- The workflow is terminated
Supported API: true- Parameters:
changeItem- the change object forcing its children to closestateMap- map a change class to a particular state to resolve to- Throws:
WTException
-
closeChangeParents
public static void closeChangeParents(Object changeItem, Map<Class, State> stateMap) throws WTExceptionGiven a change item, and a map of class types to states, this API will look up the parents of the given change item and will close the parents with the given states. This method supports both legacy or flexible change objects. For legacy change items, the objects will close according to the traditional parent role. For flexible change items, the parent members of the ChangeProcessLink will be closed. When a change item is closed, the following changes occur to the object:- The resolution date is set
- The state is set
- The workflow is terminated
Supported API: true- Parameters:
changeItem- the change object forcing its parents to closestateMap- map a change class to a particular state to resolve to- Throws:
WTException
-
changeNoticeExists
Return true if a change notice exists for the given change request. This supports flexible or legacy change requests. If input parameter is not instanceOf FlexibleChangeItem this returns false.
Supported API: true- Parameters:
changeItem-- Throws:
WTExceptionChangeException2
-
applyImpacts
Apply the impact of a change activity, and all the change activities of a change order, on associatedImpactedobjects.
Supported API: true- Parameters:
changeItem- ChangeActivity2 or ChangeOrder2 object, other types ignored.- Returns:
- True if an associated Impacted object was updated. False if none were updated or none are associated.
- Throws:
WTException
-
applyImpacts
Apply the impact of change activities, and all the change activities of change orders, on associatedImpactedobjects.
Supported API: true- Parameters:
changeItems- Collection of ChangeActivity2 or ChangeOrder2 objects, other types ignored.- Returns:
- True if an associated Impacted object was updated. False if none were updated or none are associated.
- Throws:
WTException
-
setChangeRedlineState
public static void setChangeRedlineState(WTChangeOrder2 changeNotice, State changeVersionState, ChangeVersionState changeVersionLinkStateToUpdate, Set<ChangeVersionState> changeVersionLinkStates, boolean undoCheckoutRedlines) throws WTException, WTPropertyVetoException Set the state for all change versions in the passed change notice.
Supported API: true- Parameters:
changeNotice-changeVersionState- - The state to set for change version(BOM Redline).changeVersionLinkStateToUpdate- - If not null then will set the state for ChangeVersionLink.changeVersionLinkStates- - If null then will fetch Open ChangeVersionLinks only to set Change version or ChangeVersionLink state. If not null then will fetch ChangeVersionLinks of all passed states and will set Change version or ChangeVersionLink state.undoCheckoutRedlines- - If true then undo checkout change version(BOM Redline) before setting state.- Throws:
WTExceptionWTPropertyVetoException
-