Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to get primary attachment file in the CheckinObjectFormProcessor?


How to get primary attachment file in the CheckinObjectFormProcessor?


I need to customize CheckinObjectFormProcessor. I need to get primary attached file that user insert in the checkin wizard. I've created my own CIObjectFormprocessor that extended OOTB CheckinObjectFormProcessor:

public class CIObjectFormProcessor extends CheckinObjectFormProcessor


  public FormResult doOperation(NmCommandBean paramNmCommandBean, List<ObjectBean> paramList) throws WTException


     FormResult localFormResult = new FormResult();



      // Need there to get new primary attachment file

     localFormResult = super.doOperation(paramNmCommandBean, paramList);

     return localFormResult;



localObjectBean.getParameterMap() can give me the Map with a lot of properties. But I can't to get the file I need. Please help.


Hi M Bagryanov‌,

you can try something like this:

/* (non-Javadoc)

  * @see com.ptc.windchill.enterprise.doc.forms.CreateDocFormProcessor#doOperation(com.ptc.netmarkets.util.beans.NmCommandBean, java.util.List)



  public FormResult doOperation(NmCommandBean arg0, List<ObjectBean> arg1) throws WTException {

       System.out.println("*** I am in doOperation method");

       HashMap map=getFormData(arg0);

       java.util.Set setOfKeys = map.keySet();

       java.util.Iterator iterator = setOfKeys.iterator();

       while (iterator.hasNext()) {

            String key = (String);

            Object value = (Object)map.get(key);

            System.out.println("\nKey: "+ key+", Value: "+ value);


            if (key.startsWith("PRIMARY_FILE_wt.content.ApplicationData") && key.endsWith("_filePath")) {

                 String valueoffile = value.toString();

                 System.out.println("\t *** File is --- " +valueoffile);

                 File file = new File(valueoffile);

                 System.out.println("\t *** File Name - "+file.getName());



       return super.doOperation(arg0, arg1);



  protected static HashMap getFormData( NmCommandBean clientData ) throws WTException {

       HashMap formData = new HashMap();

       Map comboBoxData = null;

       Map radioData = null;

       Map textData = null;

       Map textAreaData = null;

       comboBoxData = clientData.getComboBox();

       radioData = clientData.getRadio();

       textData = clientData.getText();

       textAreaData = clientData.getTextArea();

       Map checkedData = clientData.getChecked();

       Map uncheckedData = clientData.getUnChecked();

       if (checkedData != null) {

            Iterator itChecked = checkedData.keySet().iterator();

            while (itChecked.hasNext()) {

                 formData.put(, Boolean.TRUE.toString());


       } // end if checkedData

       if (uncheckedData != null) {

            Iterator itUnchecked = uncheckedData.keySet().iterator();

            while (itUnchecked.hasNext()) {

                 formData.put(, Boolean.FALSE.toString());


       } // end if uncheckedData

       if(comboBoxData != null) {

            System.out.println("Prniting the comboBoxData::::" +comboBoxData);



       if(radioData != null) {

            System.out.println("Prniting the radioData::::" +radioData);



       if(textData != null) {

            System.out.println("Prniting the textdata::::" +textData);



       if(textAreaData != null) {

            System.out.println("Prniting the textAreaData::::" +textAreaData);




       return formData;


It will give you an file name which user selects in wizard.

I hope this helps you.



Top Tags