Class EditChangeItemFormProcessor

java.lang.Object
com.ptc.core.components.forms.DefaultObjectFormProcessor
com.ptc.core.components.forms.DefaultEditFormProcessor
com.ptc.windchill.enterprise.change2.forms.processors.EditChangeItemFormProcessor
All Implemented Interfaces:
ObjectFormProcessor, com.ptc.windchill.enterprise.change2.forms.processors.ChangeFormProcessor
Direct Known Subclasses:
CreateCapaReviewFormProcessor, EditCapaChangeRequestFormProcessor, EditChangeIssueFormProcessor, EditChangeNoticeFormProcessor, EditChangeRequestFormProcessor, EditChangeReviewFormProcessor, EditChangeTaskFormProcessor, EditCustomerExperienceFormProcessor, EditNCFormProcessor, EditVarianceFormProcessor

public abstract class EditChangeItemFormProcessor extends DefaultEditFormProcessor implements com.ptc.windchill.enterprise.change2.forms.processors.ChangeFormProcessor
A class for handling general change management edit wizard processing. This class implements the preProcess, doOperation, postProcess methods in order to process a transaction for different change object wizards such as Problem Reports, Variances, Change Requests, Change Notices, and Change Tasks.

Supported API: true

Extendable: true
  • Method Details

    • preProcess

      public FormResult preProcess(NmCommandBean clientData, List<ObjectBean> objectBeanList) throws WTException
      Gets and initailizes the change object from the wizard form data. This method invokes super to initialize the change objects inside each of the object beans in the ObjectBean list. This method then checks to see if the name field for the change object has been modified and stores the value in a renameNameList.

      Supported API: true
      Specified by:
      preProcess in interface ObjectFormProcessor
      Overrides:
      preProcess in class DefaultEditFormProcessor
      Parameters:
      clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
      objectBeanList - The List of object beans that have been initialized with the appropriate wizard from data for each individual ObjectBean.
      Returns:
      A form result that indicates if the operation was succesful or not.
      Throws:
      WTException - is thrown if initailizing the change object fails
      See Also:
    • doOperation

      public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeanList) throws WTException
      Saves the change object that was initialized in the preProcess() method which stored in each ObjectBean that is in the passed in object bean list.

      Supported API: true
      Specified by:
      doOperation in interface ObjectFormProcessor
      Overrides:
      doOperation in class DefaultEditFormProcessor
      Parameters:
      clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
      objectBeanList - The List of object beans that have the appropriate wizard from data for each individual ObjectBean and the initialized object for each ObjectBean from the previous call to the preProcess method.
      Returns:
      A form result that indicates if the operation was succesful or not.
      Throws:
      WTException
      See Also:
    • postProcess

      public FormResult postProcess(NmCommandBean clientData, List<ObjectBean> objectBeanList) throws WTException
      Post Process using the wizard form data per ObjectBean in the object bean list checks to see if the if the user chose to submit now.

      Supported API: true
      Specified by:
      postProcess in interface ObjectFormProcessor
      Overrides:
      postProcess in class DefaultObjectFormProcessor
      Parameters:
      clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
      objectBeanList - The List of object beans that have been saved with the appropriate wizard from data for each individual ObjectBean.
      Returns:
      A form result that indicates if the operation was succesful or not.
      Throws:
      WTException
    • setResultNextAction

      public FormResult setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException
      If the edit is launched from info page Actions drop down menu or table level action in the info page, then the whole page is refreshed. If it is a row level action, then only the row is refreshed.

      Supported API: true
      Specified by:
      setResultNextAction in interface ObjectFormProcessor
      Overrides:
      setResultNextAction in class DefaultObjectFormProcessor
      Parameters:
      result - - The FormResult to which the action info should be added. Input and output. Required.
      clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
      objectBeans - The current List of object beans.
      Returns:
      A form result that indicates if the operation was successful or not.
      Throws:
      WTException
    • getProcessorErrorMessage

      protected abstract LocalizableMessage getProcessorErrorMessage()
      Required when extending EditChangeItemFormProcessor. The purpose of this method is to handle error messaging that is unique to the change object type.
      An example implementaton would look like the following:
      private static final String RESOURCE = "com.ptc.windchill.enterprise.change2.change2ClientResource"; private static final LocalizableMessage ECN_ERROR_MSG = new WTMessage(RESOURCE, change2ClientResource.EDITCHANGENOTICE_PROCESSING_ERROR, null);
      Returns:
      LocalizableMessage
    • saveChangeItem

      protected abstract WTList saveChangeItem(WTList changeItems) throws WTException
      Required when extending EditChangeItemFormProcessor. The purpose of this method is to handle persistance for the different types change objects. All change objects in the list that is passed in are of the same type. The order of the list needs to be maintained and return in the same order as a list of persisted change objects.

      Supported API: true
      Parameters:
      changeItems - The list of change objects to be persisted.
      Returns:
      The list of change objects that have been persisted.
      Throws:
      WTException - is thrown if saving the change object fails.