Skip Headers

Agile Product Lifecycle Management Web Services Guide Release 9.3.3 E39310-01 |
| Contents

Previous | Next |

# 5 Working with Tables

This chapter describes how you work with the Agile PLM Tables and provides sample code snippets.

## 5.1 About Tables

Agile data is contained in tables. In Agile Web Client, these tables are equivalent to the separate tabs in a window, such as the Manufacturer and BOM tabs.

Agile Web services does not support random access of rows to a table. This implies that you cannot retrieve a specific row by index number and update it.

## 5.2 Operations Supported on Tables

Web Services supports table operations for Agile PLM's PC and PQM solutions.

### 5.2.1 PC

Table Name | Objects | Web Services API
--- | --- | ---
Item Changes Pending Changes | Item | loadTable, isReadOnlyTable
Item Changes Change History | Item | loadTable, isReadOnlyTable
Item BOM | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Manufacturers | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Sites | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Prices | Item | loadTable, isReadOnlyTable
Item Quality | Item | loadTable, isReadOnlyTable
Item Compliance Compositions | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Compliance Substances | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Compliance Specifications | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Item Relationships | Item | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Items Where Used | Item | loadTable, isReadOnlyTable
Changes Affected Items Table | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Changes AI Redline Title Block | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Changes AI Redline BOM | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Changes AI Redline Manufacturers | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Changes AI Redline Attachments | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Changes Relationships | Changes | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfrs Relationships | Mfrs | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfrs Where Used | Mfrs | loadTable, isReadOnlyTable
Mfr Parts Prices | Mfrs | loadTable, isReadOnlyTable
Mfr Parts Compliance Compositions | Mfr Parts | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfr Parts Compliance Substances | Mfr Parts | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfr Parts Compliance Specifications | Mfr Parts | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfr Parts Suppliers | Mfr Parts | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfr Parts Relationships | Mfr Parts | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Mfr Parts Where Used | Mfr Parts | loadTable, isReadOnlyTable
Sites Relationships | Sites | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
Sites History | Sites | loadTable, isReadOnlyTable

### 5.2.2 PQM

Table name | Objects | Web Services
PSR Affected Items | PSR | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
PSR Related PSR | PSR | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
PSR Relationships | PSR | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
QCR Affected Items | QCR | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows
QCR Relationships | QCR | loadTable, copyTable, clearTable, isReadonlyTable, addRows, removeRows, updateRows

## 5.3 Loading a Table

You can use the operation loadTable to load a table from Agile PLM system. This operation takes tablesIdentifier parameter along with classIdentifier and objectIdentifier.

Tables vary for each Agile PLM dataobject. Tables for change objects are different from tables for items. Each table for a particular dataobject is identified by a constant in the constants class or by the API name for that dataobject. Item constants are contained in the ItemConstants class, change constants are contained in the ChangeConstants class, and so on.

Example: Loading the table of a part

    RequestTableType table[] = new RequestTableType[1];
    table[0] = new RequestTableType();
    table[0].setClassIdentifier("Part");
    table[0].setObjectNumber( partNumber );
    table[0].setTableIdentifier("table01");
    loadTableRequestType.setTableRequest(table);

### 5.3.1 Special Handling in the loadTable Operation

Example: Loading a table for an object version

    table[0] = new RequestTableType();
    table[0].setClassIdentifier("FileFolder");
    table[0].setObjectNumber( folderNumber );
    table[0].setTableIdentifier("Files");

PropertyType properties[] = new PropertyType[1];

properties[0] = new PropertyType();

properties[0].setPropertyName( SchemaConstants.folderVersion.getValue() );

properties[0].setPropertyValue( folderVersion );

table[0].setOptions(properties);

loadTableRequestType.setTableRequest(table);

Example: Loading a table for an object revision

    table[0] = new RequestTableType();
    table[0].setClassIdentifier( "Part" );
    table[0].setObjectNumber( partNumber );
    table[0].setTableIdentifier("TitleBlock");

PropertyType properties[] = new PropertyType[1];

properties[0] = new PropertyType();

properties[0].setPropertyName( SchemaConstants.revision.getValue() );

properties[0].setPropertyValue( partVersion );

table[0].setOptions(properties);

loadTableRequestType.setTableRequest(table);

Example: Loading a table for a redline change

    table[0] = new RequestTableType();
    table[0].setClassIdentifier( "Part" );
    table[0].setObjectNumber( partNumber );
    table[0].setTableIdentifier("TitleBlock");

PropertyType properties[] = new PropertyType[1];

properties[0] = new PropertyType();

properties[0].setPropertyName(SchemaConstants.redline_change.getValue() );

properties[0].setPropertyValue( changeNumber );

table[0].setOptions(properties);

loadTableRequestType.setTableRequest(table);

Example: Loading a table for a site object

    table[0] = new RequestTableType();
    table[0].setClassIdentifier( "Part" );
    table[0].setObjectNumber( parentPartNumber );
    table[0].setTableIdentifier("BOM" );

PropertyType properties[] = new PropertyType[1];

properties[0] = new PropertyType();

properties[0].setPropertyName( SchemaConstants.site.getValue() );

properties[0].setPropertyValue( site1 );

table[0].setOptions(properties);

loadTableRequestType.setTableRequest(table);

### 5.3.2 Working with the Readonly Tables

Several Agile PLM tables store history information or data about related objects. These tables are read-only and as such, you cannot modify these tables. When you write code to access a table, use the operation isReadOnlyTable to check if the table is read-only.

### 5.3.3 Retrieving the Metadata of a Table

You may require the metadata information of a table, which is the underlying data that describes a table's properties. This is useful when you need to identify the attributes of a particular table, its ID, or its table name without having to load a dataobject. The metadata is obtained in the form of AttributeType objects from the response.

For this, use the operation getTableMetadata specifying the tableIdentifier and classIdentifier.

Example: Retrieving metadata of a table

    agileGetTableMetadataRequestType[0].setClassIdentifier("Part");
    agileGetTableMetadataRequestType[0].setTableIdentifier( "table01");
    getTableMetadataRequestType.setRequests(agileGetTableMetadataRequestType);

## 5.4 Adding Rows to a Table

To create a table row, use the operation addRows, which creates a new row and initializes it with the data specified in the rows parameter. The rows parameter of addRows is available to pass the following data:

- a set of attributes and values for the row's cells

- an Agile PLM object (such as an Item) to add to the table

When you add a row to a table, it is not necessarily added at the end of the table.

Note You cannot add an empty row to a table.

Example: Adding rows in a BOM table

With the addRows operation, you can add a child element to a Part by adding rows to the BOM table of the parent object.

    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( parentPartNumber );
    table.setTableIdentifier( "BOMtable_API_Name");
    AgileRowType[] rows = new AgileRowType[1];
    rows[0] = new AgileRowType();

String namespaceUri = null;

MessageElement messages[] = new MessageElement[1];

rows[0].set_any(messages);

messages[0] = new MessageElement(namespaceUri, "BOM_Child_Number");

messages[0].addAttribute(namespaceUri, ""itemNumber");

messages[0].addTextNode( BOMchildPartNumber );

    agileAddRowsRequest[0].setRow(rows);
    agileAddRowsRequest[0].setObjectInfo(table);
    addRowsRequestType.setData(agileAddRowsRequest);

### 5.4.1 Special Handling in the addRows Operation

Note All additional attributes like revision, site etc should be passed as options. Site and Revision should be passed along the individual row.

#### 5.4.1.1 Adding a Site to the Sites Tab of an Item

    final String COMMONNAMESPACEURI = "http://xmlns.oracle.com/AgileObjects/Core/Common/V1";
    final String XSIPREFIX = org.apache.axis.Constants.NS_PREFIX_SCHEMA_XSI;
    final String TYPE = SchemaConstants.type.getValue();

AgileListEntryType lst03 = new AgileListEntryType();

SelectionType[] multiSelect = new SelectionType[1];

multiSelect[0] = new SelectionType();

multiSelect[0].setValue("Bangalore");

lst03.setSelection(multiSelect);

MessageElement dataCell = new MessageElement(namespaceUri, "siteName");

dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "AgileListEntryType");

dataCell.setObjectValue(lst03);

message[0] = dataCell;

row[0].set_any(message);

#### 5.4.1.2 Adding Suppliers to the Suppliers Tab of an Item

You can add suppliers to the Supplier tab of an item using the following two methods:

Method 1

    final String COMMONNAMESPACEURI = "http://xmlns.oracle.com/AgileObjects/Core/Common/V1";
    final String XSIPREFIX = org.apache.axis.Constants.NS_PREFIX_SCHEMA_XSI;
    final String TYPE = SchemaConstants.type.getValue();

ObjectReferentIdType multiSelect = new ObjectReferentIdType();

multiSelect.setClassIdentifier("Broker");

multiSelect.setObjectIdentifier("SAP0265");

MessageElement dataCell = new MessageElement(namespaceUri, "supplier01");

dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "ObjectReferentIdType");

dataCell.setObjectValue(multiSelect);

message[0] = dataCell;

row[0].set_any(message);

Method 2

    final String COMMONNAMESPACEURI = "http://xmlns.oracle.com/AgileObjects/Core/Common/V1";
    final String XSIPREFIX = org.apache.axis.Constants.NS_PREFIX_SCHEMA_XSI;
    final String TYPE = SchemaConstants.type.getValue();

AgileObjectListEntryType multilist01 = new AgileObjectListEntryType();

ObjectReferentIdType[] obj = new ObjectReferentIdType[1];

obj[0] = new ObjectReferentIdType();

obj[0].setClassIdentifier("Broker");

obj[0].setObjectIdentifier("SAP0265");

multilist01.setSelection(obj);

MessageElement dataCell = new MessageElement(namespaceUri, "supplier");

dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "AgileObjectListEntryType");

dataCell.setObjectValue(multilist01);

message[0] = dataCell;

row[0].set_any(message);

#### 5.4.1.3 Adding Suppliers to a Manufacturer Part

    final String COMMONNAMESPACEURI = "http://xmlns.oracle.com/AgileObjects/Core/Common/V1";
    final String XSIPREFIX = org.apache.axis.Constants.NS_PREFIX_SCHEMA_XSI;
    final String TYPE = SchemaConstants.type.getValue();

RequestTableType objectInfo = new RequestTableType();

objectInfo.setClassIdentifier(subclassId);

objectInfo.setObjectNumber(objectNumber);

objectInfo.setTableIdentifier("tableId");

agileAddRowsRequests[0].setObjectInfo(objectInfo);

PropertyType[] options = new PropertyType[1];

options[0] = new PropertyType();

options[0].setPropertyName(SchemaConstants.manufacturer_name.getValue());

options[0].setPropertyValue("Cisco");

agileAddRowsRequests[0].setOptions(options);

AgileAddRowsRequest[] agileAddRowsRequests = new AgileAddRowsRequest[1];

agileAddRowsRequests[0] = new AgileAddRowsRequest();

AgileRowType[] row = new AgileRowType[1];

row[0] = new AgileRowType();

agileAddRowsRequest.setRow(row);

String namespaceUri = null;

MessageElement[] message = new MessageElement[1];

AgileObjectListEntryType multilist01 = new AgileObjectListEntryType();

ObjectReferentIdType[] obj = new ObjectReferentIdType[1];

obj[0] = new ObjectReferentIdType();

obj[0].setClassIdentifier("Broker");

obj[0].setObjectIdentifier("SAP0265");

multilist01.setSelection(obj);

MessageElement dataCell = new MessageElement(namespaceUri, "supplier");

dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "AgileObjectListEntryType");

dataCell.setObjectValue(multilist01);

message[0] = dataCell;

row[0].set_any(message);

#### 5.4.1.4 Adding Manufacturer Part to AML of an Item

You can add a Manufacturer Part to the AML of an Item using the following two methods:

Method 1

    MessageElement[] message = new MessageElement[2];
    MessageElement dataCell = new MessageElement(namespaceUri, "mfrPartNumber");
    dataCell.setObjectValue("bosco");
    message[0] = dataCell;
    MessageElement dataCell = new MessageElement(namespaceUri, "mfrName");
    dataCell.setObjectValue("cisco");
    message[1] = dataCell;
    row[0].set_any(message);

Method 2

    MessageElement[] message = new MessageElement[1];
    ObjectReferentIdType obj = new ObjectReferentIdType();
    obj.setClassIdentifier("ManufacturerPart");
    obj.setObjectIdentifier("MfrP_01");
    PropertyType[] options = new PropertyType[1];
    options[0] = new  PropertyType();
    options[0].setPropertyName(SchemaConstants.manufacturer_name.getValue());
    options[0].setPropertyValue("Manu_4570");
    obj.setOptions(options);
    MessageElement dataCell = new MessageElement(namespaceUri, "mfrPartNumber");
    dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "ObjectReferentIdType");
    dataCell.setObjectValue(obj);
    message[0] = dataCell;
    row[0].set_any(message);

#### 5.4.1.5 Adding Manufacturer Part to the Relationships Tab

    ObjectReferentIdType obj = new ObjectReferentIdType();
    obj.setClassIdentifier("ManufacturerPart");
    obj.setObjectIdentifier("m12444");
    PropertyType[] options = new PropertyType[1];
    options[0] = new  PropertyType();
    options[0].setPropertyName(SchemaConstants.manufacturer_name.getValue());
    options[0].setPropertyValue("Cisco");
    obj.setOptions(options);
    MessageElement dataCell = new MessageElement(namespaceUri, "name");
    dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "ObjectReferentIdType");
    dataCell.setObjectValue(obj);
    message[0] = dataCell;
    row[0].set_any(message);

#### 5.4.1.6 Adding Affected Item to a Change

    MessageElement dataCell1 = new MessageElement(namespaceUri, "itemNumber");
    dataCell1.setObjectValue("P00400");
    message[0] = dataCell1;

    MessageElement dataCell2 = new MessageElement(namespaceUri, "effectiveDate");
    dataCell2.setObjectValue(new Date());
    dataCell2.addAttribute(XSIPREFIX, Constants.URI_DEFAULT_SCHEMA_XSD, "type", "dateTime");
    message[1] = dataCell2;

    MessageElement dataCell3 = new MessageElement(namespaceUri, "newRev");
    dataCell3.setObjectValue("Item_01");
    dataCell3.addAttribute(XSIPREFIX, Constants.URI_DEFAULT_SCHEMA_XSD, TYPE, "string");
    message[2] = dataCell3;

    row[0].set_any(message);

#### 5.4.1.7 Adding Site Specific Item to the BOM Tab

To add a child object to a specific site, we can utilize either the setOptions feature on the table object, or use the setAdditionalRowInfo method on the row object. Using setOptions on the table object will add all new rows to a particular site. On the other hand, setAdditionalRowInfo may be used to specify a site for each individual row, meaning that if several rows are to be added with a web service call, each row may be added to a different site.

Adding site specific item to the BOM tab

In this example, setAdditionalRowInfo is used to add a given row to a specific site of a Part using the operation addRows.

    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( parentPartNumber );
    table.setTableIdentifier( "BOM" );
    AgileRowType[] rows = new AgileRowType[1];
    rows[0] = new AgileRowType();
    String namespaceUri = null;
    MessageElement messages[] = new MessageElement[1];

rows[0].set_any(messages);

messages[0] = new MessageElement(namespaceUri, "itemNumber");

messages[0].addTextNode( childPartNumber );

AdditionalInfoType additionalInfoType = new AdditionalInfoType();

additionalInfoType.setSite(site1);

rows[0].setAdditionalRowInfo(additionalInfoType);

agileAddRowsRequest[0].setRow(rows);

agileAddRowsRequest[0].setObjectInfo(table);

addRowsRequestType.setData(agileAddRowsRequest);

#### 5.4.1.8 Adding Site Specific AML to the Manufacturers Tab

For adding a Manufacturer to a Part at a specific site, use the setOptions feature by providing a name-value pair using which a particular site is identified. Subsequently, the web service adds the manufacturer to the site as specified in the options.

A manufacturer part is specified through a MessageElement in the operation addRows, the message element cannot be specified in the usual manner. In this case, the message element for the manufacturer part must be of type ObjectReferentIdType. Consequently, an object identifier type object is created and appropriate class and object identifier values are set, using the manufacturer part class and its number, respectively.

    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( partNumber );
    table.setTableIdentifier( "Manufacturers" );
    PropertyType[] properties = new PropertyType[1];
    properties[0] = new PropertyType();
    properties[0].setPropertyName( SchemaConstants.site.getValue() );
    properties[0].setPropertyValue( site1 );
    table.setOptions(properties);
    AgileRowType[] rows = new AgileRowType[1];
    rows[0] = new AgileRowType();

    String namespaceUri = null;
    MessageElement messages[] = new MessageElement[1];
    messages[0] = new MessageElement(namespaceUri, "mfrPartNumber");
    ObjectReferentIdType objRefId = new ObjectReferentIdType();
    objRefId.setClassIdentifier( "ManufacturerPart" );
    objRefId.setObjectIdentifier( manufPartNumber );
    messages[0].addAttribute(Constants.NS_PREFIX_SCHEMA_XSI, COMMONNAMESPACEURI, "type", "ObjectReferentIdType");
    PropertyType[] properties_manufName = new PropertyType[1];
    properties_manufName[0] = new PropertyType();
    properties_manufName[0].setPropertyName( SchemaConstants.manufacturer_name.getValue() );
    properties_manufName[0].setPropertyValue( manufName );
    objRefId.setOptions(properties_manufName);
    messages[0].setObjectValue(objRefId);

    rows[0].set_any(messages);
    agileAddRowsRequest[0].setRow(rows);
    agileAddRowsRequest[0].setObjectInfo(table);
    addRowsRequestType.setData(agileAddRowsRequest);

#### 5.4.1.9 Adding Material to Item Table

You are required to add the Substance type (or Class) also in the addRows operation request. If you do not specify a type, the application assumes you are trying to add an 'object' of type Substance. Since the object being added is of the type 'Material', the server will reuse it as Substance. Hence, you are required to specify the type of the object you are adding. The valid values are Substance and Substance Group.

    public static class AddRowsDataToIPC17521DeclarationItemComposition {
    public static String methodName = "runPositive" ;
        public static String [] paramsOrder = {"classIds", "objectNumbers", "tableIds", "attrsSet"} ;

        public static Integer [] classIds = {2000005975};
        public static String [] objectNumbers = {"IPC17521DEC_ANY"} ;
        public static Integer [] tableIds = {2000002780} ;
        public static Object [][][][] attrsSet = {
         {
               {
               {"substanceName",2000002745,"MATERIAL_ANY","STANDARD"},
                    {"itemNumber",2000002974,"TEST_PART_ANY","STANDARD"},
               }
         }
      };
    }

#### 5.4.1.10 Adding Rows to the Relationship Table of a Reference Object

To add rows to the relationship table of a reference object using the AddRowsReferenceObject operation. The request object contains specifications of the class identifier and table identifier attributes.

Example: Adding a reference object to a relationship table

    AddRowsRequestType addRowsRequestType = new AddRowsRequestType();
    AgileAddRowsRequest agileAddRowsRequest[] = new AgileAddRowsRequest[1];
    agileAddRowsRequest[0] = new AgileAddRowsRequest();
    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( parentName );
    table.setTableIdentifier( ServiceRequestConstants.TABLE_RELATIONSHIPS.toString() );
    AgileRowType[] rows = new AgileRowType[1];
    rows[0] = new AgileRowType();
    String namespaceUri = "http://xmlns.oracle.com/AgileObjects/Core/Common/V1";
    MessageElement messages[] = new MessageElement[1];
    rows[0].set_any(messages);
    messages[0] = new MessageElement(namespaceUri, "number");
    messages[0].addAttribute(Constants.NS_PREFIX_SCHEMA_XSI, namespaceUri, "type", "ObjectReferentIdType");
    ObjectReferentIdType objRefId = new ObjectReferentIdType();
    objRefId.setClassIdentifier(refSubclassName);
    objRefId.setObjectIdentifier(refObjName);
    objRefId.setReferencedObjKey(refObjPubKey);
    messages[0].setObjectValue(objRefId);
    agileAddRowsRequest[0].setRow(rows);
    agileAddRowsRequest[0].setObjectInfo(table);
    addRowsRequestType.setData(agileAddRowsRequest);
    AddRowsResponseType addRowsResponseType = tableStub.addRows(addRowsRequestType);

## 5.5 Updating Rows in a Table

Rows in a table are updated using the operation updateRows.

In the following example, the rowID is set after performing the operation loadTable and getting the rowID from the response.

Example: Updating rows in a table row

    UpdateRowsRequestType updateRowsRequestType = new UpdateRowsRequestType();
    AgileUpdateRowsRequest agileUpdateRowsRequest[] = new AgileUpdateRowsRequest[1];
    agileUpdateRowsRequest[0] = new AgileUpdateRowsRequest();
    RequestTableType table = new RequestTableType();
    table.setClassIdentifier( "ECO" );
    table.setObjectNumber( changeNumber );
    table.setTableIdentifier("AffectedItems" );

AgileUpdateRow updateRow[] = new AgileUpdateRow[1];

updateRow[0] = new AgileUpdateRow();

updateRow[0].setRowId(getRowID("ECO", changeNumber, "AffectedItems", partNumber ) );

AgileRowType row = new AgileRowType();

String namespaceUri = null;

MessageElement messages[] = new MessageElement[1];

Date date = new Date();

date.setTime( date.getTime() );

messages[0] = new MessageElement(namespaceUri, "effectiveDate");

messages[0].addAttribute("date_px", Constants.URI_DEFAULT_SCHEMA_XSD, "type", "dateTime");

messages[0].setObjectValue(date);

row.set_any(messages);

updateRow[0].setRow(row);

agileUpdateRowsRequest[0].setRow(updateRow);

agileUpdateRowsRequest[0].setObjectInfo(table);

updateRowsRequestType.setData(agileUpdateRowsRequest);

## 5.6 Removing Rows from a Table

To remove a row from a table, use the removeRows operation, which requires tableIdentifier, rowID, besides objectIdentifier, objectNumber, and objectInfo.

If a table is read-only, you cannot remove rows from it. To check the read/write status of tables, see Working with ReadOnly Tables on page 39.

If you are working with a released revision of an item, you cannot remove a row from the item's table until you create a change order for a new revision.

Example: Removing a table row

    RemoveRowsRequestType removeRowsRequestType = new RemoveRowsRequestType();
    AgileRemoveRowsRequest agileRemoveRowsRequest[] = new AgileRemoveRowsRequest[1];
    agileRemoveRowsRequest[0] = new AgileRemoveRowsRequest();
    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( parentPartNumber );
    table.setTableIdentifier( ItemConstants.TABLE_BOM.toString() );
    agileRemoveRowsRequest[0].setObjectInfo(table);
    agileRemoveRowsRequest[0].setRowId( new Integer[] {getRowID("Part", parentPartNumber, "BOM", childPartNumber)} );
    removeRowsRequestType.setRows(agileRemoveRowsRequest);

## 5.7 Clearing a Table

You can clear the entire table by removing all the rows. This can be done by setting the tableIdentifier in the operation clearTable.

Example: Clearing a table

    RequestTableType table1 = new RequestTableType();
    table1.setClassIdentifier("Part");
    table1.setObjectNumber( partNumber );
    table1.setTableIdentifier( "tableAPIName" );
    agileClearTableRequestType[0].setAgileTable(table1);
    clearTableRequestType.setClearTable(agileClearTableRequestType);

## 5.8 Copying Tables

You can copy all the rows of a table in an Agile object to another table by using the operation copyTable. This operation requires classIdentifier, objectNumber and tableIdentifier, and setting of the SourceTable and TargetTable values.

Example: Copying a table

    agileCopyTableRequestType[0] = new AgileCopyTableRequestType();
    RequestTableType table1 = new RequestTableType();
    RequestTableType table2 = new RequestTableType();

table1.setClassIdentifier("Part");

table1.setObjectNumber( partNumber1 );

table1.setTableIdentifier("Compositions");

table2.setClassIdentifier("Part");

table2.setObjectNumber( partNumber2 );

table2.setTableIdentifier( "Compositions" );

    agileCopyTableRequestType[0].setSourceTable(table1);
    agileCopyTableRequestType[0].setTargetTable(table2);
    copyTableRequestType.setCopyTable(agileCopyTableRequestType);

## 5.9 Redlining a Table

When you issue a change for a released item or a price agreement, the Agile Web Services lets you redline certain tables affected by the change. In the Agile PLM clients, redline tables visually identify values that have been modified from the previous revision. Red underlined text - thus the term "redline", indicates values that have been added, and red strikeout text indicates values that have been deleted. Those responsible for approving the change can review the redline data.

The Agile PLM system provides the following Redline tables:

- Redline BOM

- Redline Manufacturers (AML)

- Redline Price Lines

- Redline Title Block

Example: Adding a Redlined BOM

    RequestTableType table = new RequestTableType();
    table.setClassIdentifier("Part");
    table.setObjectNumber( parentPartNumber );
    table.setTableIdentifier( "-803" );
    ObjectReferentIdType multiSelect = new ObjectReferentIdType();
    multiSelect.setClassIdentifier("Part");
    multiSelect.setObjectIdentifier("P00407");
    MessageElement dataCell = new MessageElement(namespaceUri, "itemNumber");
    dataCell.addAttribute(XSIPREFIX, COMMONNAMESPACEURI, TYPE, "ObjectReferentIdType");
    dataCell.setObjectValue(multiSelect);
    message[0] = dataCell;
    row[0].set_any(message);
    PropertyType[] options = new PropertyType[1];
    options[0] = new  PropertyType();
    options[0].setPropertyName(SchemaConstants.redline_change.getValue());
    options[0].setPropertyValue("C00644");
    row[0].setOptions(options);
    agileAddRowsRequest[0].setObjectInfo(table);