=======
Go to primary content
Agile Product Lifecycle Management SDK Developer Guide - Using APIs
Release 9.3.6
E71152-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

7 Working with Design Change Order Objects

This chapter includes the following:

7.1 About Design Change Orders Objects and Design Objects

A Design Change Orders (DCO) object also called a Design File Change Orders (DFCO) object is a subclass of the Change Orders class and is available when the affected File Tab is enabled and provides access to all Agile PLM Workflow functions.

A Design Object is a subclass of the Design Class. The relationship of a DCO to a Design Object is similar to that of an Engineering Change Order and Item. A Design object is another type of a file container object and is used with Agile PLM's Engineering Collaboration (EC) tool, EC provides data and process integration between Computer Assisted Design (CAD) applications and Agile PLM. This integration enables managing tasks related to the creation, modification, and maintenance of CAD data model structures associated with Agile Design objects.

7.1.1 Integration of Agile PLM and Engineering Collaboration

The integration of Agile PLM's Engineering Collaboration (EC) and Agile PLM enables accessing the Change order objects' Affected Files table and the Design/File Folder objects' Changes table. SDK also supports Affected Files enable, but you must disable the DFCO.Affected Items table when you are enabling the DFCO.Affected files table via SDK.

To enable the DFCO Affected Files tables, see Example 7-1, "Enabling the AFCO Affected Files tables" and to view actions supported by the SDK see "Change Order File Folders Actions Supported by SDK."


Note:

Similar to other tables, the SDK supports all table-related tasks listed in Chapter 4, "Working with Tables."

Example 7-1 Enabling the AFCO Affected Files tables

//enable DFCO AF table   INode afTab = session.getAdminInstance().getNode("DFCO.AffectedFiles");   IProperty visibleAF =afTab.getProperty(PropertyConstants.PROP_VISIBLE);   visibleAF.setValue("Yes");

//disable DFCO AI table   INode aiTab = session.getAdminInstance().getNode("DFCO.AffectedItems");   IProperty visibleAI = aiTab.getProperty(PropertyConstants.PROP_VISIBLE);   visibleAI.setValue("No");

Note:

SDK also supports enabling the Affected Files table. However, you must disable the DFCO.Affected Items table when enabling the DFCO.Affected files table using the SDK.

7.2 Change Order File Folders Actions Supported by SDK

SDK supports Web Client actions on the following Change Order file folders:

  • Change Order Affected Files TabRedline/Markups Folders in Affected Files Lower TableAffected Files TitleblockFile Folder and Design Objects


    Note:

    For information on these Change Order File Folders, refer to Working with Design File Change Orders (DFCOs) in Agile PLM's Getting Started Guide.

7.2.1 Actions Supported on the Change Order Affected Files Tab

Actions, relevant APIs, and code samples appear below.

  • Supported Action: Get Files

  • API: IAFRow.GetFile()

  • Code Sample: See Example 7-2.

Example 7-2 Get Files

public static void getFile(IAgileSession m_session, IChange dfco) throws 
     Exception {              ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);                    Iterator iterator = afTable.iterator();                IRow selectedRow = (IRow) iterator.next();                     InputStream inputStream = ((IAFRow) selectedRow).getFile();      }
  • Supported Action: Check In

  • API: IAFRow.checkIn()

  • Code Sample: See Example 7-3.

Example 7-3 Check In

public static void checkIn(IAgileSession m_session, IChange dfco) 
throws Exception {       ITable afTable =dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);                      Iterator iterator = afTable.iterator();                 IRow selectedRow = (IRow) iterator.next();                      ((IAFRow) selectedRow).checkIn();
  • Supported Action: Check Out

  • API: IAFRow.checkOutEx()

  • Code Sample: See Example 7-4.

Example 7-4 Check Out

public static void checkOut(IAgileSession m_session, IChange dfco) 
throws Exception {           ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);                       Iterator iterator = afTable.iterator();                   IRow selectedRow = (IRow) iterator.next();                        ((IAFRow) selectedRow).checkOutEx();             }
  • Supported Action: Cancel Checkout

  • API: IAFRow.cancelCheckout()

  • Code Sample: See Example 7-5.

Example 7-5 Cancel Checkout

public static void cancelCheckOut(IAgileSession m_session, IChange dfco) 
throws Exception {   ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);         Iterator iterator = afTable.iterator();         IRow selectedRow = (IRow) iterator.next();         If (((IAFRow) selectedRow). isCheckedOut ()) {
            ((IAFRow) selectedRow).cancelCheckout();
         }
}
  • Supported Action: Add Files to Change

  • API: ITable.createRow(Object param)

  • Code Sample: See Example 7-6.

Example 7-6 Add Files to Change

public static void addToChangeOrder(IAgileSession m_session, 
       IChange dfco, String filePath) throws Exception {               ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);                       afTable.createRow(filePath);
         }
  • Supported Action: Add Files to File Folder

  • API: ITableAF.createRow(IRow selectedRow, Object param)

  • Code Sample: See Example 7-7.

Example 7-7 Add Files to File Folder

public static void addToSelectedFileFolder(IAgileSession m_session, 
         IChange dfco, String filePath)                  throws Exception {
        ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);
                        Iterator iterator = afTable.iterator();
                        IRow selectedRow = (IRow) iterator.next();
                        ((IAFRow) selectedRow).checkOutEx();
                        ((ITableAF) afTable).createRow(selectedRow, filePath);
                        ((IAFRow) selectedRow).checkIn();
        }
  • Supported Action: Add by search

  • API: ITable.createRow(Object param)

  • Code Sample: See Example 7-8.

Example 7-8 Add by Search

public static void addToChangeOrder
        (IAgileSession m_session, IChange dfco, IFileFolder fileFolder)
               throws Exception {    ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);       afTable.createRow(fileFolder); }
  • Supported Action: Update Affected Files

  • API: IRow.setValue(Object cellId, Object value)

  • Code Sample: See Example 7-9.

Example 7-9 Update Affected Files

public static void updateAffectedFiles(
      IAgileSession m_session, IChange dfco) throws Exception {
ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);
       Iterator iterator = afTable.iterator();
       selectedRow = (IRow) iterator.next();
selectedRow.setValue
     (ChangeConstants.ATT_AFFECTED_FILES_FILE_DESCRIPTION, "new value");
       }
  • Supported Action: Remove Files from Change

  • API: ITable.removeRow(IRow row)

  • Code Sample: See Example 7-10.

Example 7-10 Remove Files from Change

public static void removeFromChangeOrder
        (IAgileSession m_session, IChange dfco) throws Exception {
ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES)
              Iterator iterator = afTable.iterator();              IRow  selectedRow = (IRow) iterator.next();              afTable.removeRow(selectedRow);
}
  • Supported Action: Remove Files from File Folder

  • API: ITableAF.removeRow(IRow row, boolean isFromFileFolder)

  • Code Sample: See Example 7-11.

    Example 7-11 Remove Files from File Folder

    public static void removeFromSelectedFileFolder
                (IAgileSession m_session, IChange dfco) throws Exception {   ITableAF afTable = 
               (ITableAF) dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);   Iterator  it = afTable.getTableIterator();   List rowList = new ArrayList();       while(it.hasNext()){   IRow row=(IRow)it.next();   rowList.add(row);       }   afTable.removeRow((IRow) rowList.get(0), true);}
    
  • Supported Action: Incorporate/ Unincorporate Affected Files Folders (New)

  • API: IAFRow.setIncorporated(boolean incorporated)

  • Code Sample: See Example 7-12.

Example 7-12 Incorporate/ Unincorporate Affected Files Folders

public static void Incorporate
     (IAgileSession m_session, IChange dfco) throws Exception {
ITable afTable = dfco.getTable(ChangeConstants.TABLE_AFFECTEDFILES);
                 Iterator iterator = afTable.iterator();
                 IRow selectedRow = (IRow) iterator.next();
                 ((IAFRow) selectedRow).setIncorporated(true);
                 ((IAFRow) selectedRow).setIncorporated(false); }

7.2.2 Actions Supported for Redline/Markups Folders in Affected Files Lower Table

Supported actions, relevant APIs, and code samples appear below.

Example 7-13 Add Redline/Markups

public static void addMarkup(IAFRow afRow) throws Exception {
    File file1 = new File("c:/test2.mkd");     IMarkupTable tableMF = afRow.getMarkupTable();     IRow rowMF = tableMF.createRow(row, file1);
}
  • Supported Action: Update Redline/MarkupsAPI: IRow.setValue(Object cellId, Object value) Code Sample: See Example 7-14.

Example 7-14 Update Redline/Markups

public static void updateMarkup(IAFRow afRow, String desc) throws Exception {    IMarkupTable tableMF = ((IAFRow) row).getMarkupTable();    Iterator it2 = tableMF.getTableIterator();    If(it2.hasNext()){       IRow rowMF = (IRow) it2.next();       rowMF.setValue(ChangeConstants.ATT_MARKUP_FILES_MARKUP_DESCRIPTION, desc);    }}
  • Supported Action: Remove Redline/Markups

  • API: ITable.removeRow(IRow row)

  • Code Sample: See Example 7-15.

Example 7-15 Remove Redline/Markup Files

public static void updateMarkup(IAFRow afRow) throws Exception{    IMarkupTable tableMF = ((IAFRow) row).getMarkupTable();    Iterator it2 = tableMF.getTableIterator();    If(it2.hasNext()){         IRow rowMF = (IRow) it2.next();         tableMF.removeRow(rowMF);    }
}

7.2.3 Actions Supported on the Affected Files Titleblock Folder

SDK supports the following Web Client actions on Affected Files Titleblock file folders:

  • Supported Action: RedlineTitleblock

  • APIs:

    • ICell.setValue(Object value) //set redline value

    • ICell.getOldValue()//get previous value

  • Code Sample: See Example 7-16.

Example 7-16 RedlineTitleblock

public static void redlineFileFolderAttr
   (IAgileSession m_session,IFileFolder fileFolder,String dfcoNumber,int                       String dfcoNumber,int redlineAtt,String redlineValue) 
                        throws Exception {
              fileFolder.setRevision(dfcoNumber);              ITable redlineP2Table =                   fileFolder.getTable(FileFolderConstants.TABLE_REDLINEPAGETWO);
              IRow redlineP2Row = (IRow) redlineP2Table.iterator().next();
              ICell cell = redlineP2Row.getCell(redlineAtt);
              cell.setValue(redlineValue);
              }

7.2.4 Actions that Support File Folder and Design Objects

SDK supports the following Web Client actions for File Folder Design Objects.

  • Supported Action: Load Table

  • API: IDataObject.getTable(Object tableId)

  • Code Sample: See Example 7-17.

    Example 7-17 Load Table

    public static void loadPendingChangesTable(IFileFolder fileFolder) 
               throws Exception {
            ITable tablePendingChanges = 
                 fileFolder.getTable(FileFolderConstants.TABLE_PENDINGCHANGES);
            Iterator iterator = tablePendingChanges.iterator();
    }