Go to primary content
Agile Product Lifecycle Management Web Services Guide
Release 9.3.6
E71166-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

5 Working with Tables

This chapter describes how you can work with 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 Product Collaboration

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 Product Quality Management

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 must 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.

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.


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();
Element element = createMessageElement("itemNumber");
element.setTextContent(BOMchildPartNumber);
rows[0].getAny().add(element);
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 and so on must be passed as options. Site and Revision must be passed along the individual row.

5.4.1.1 Adding a Site to the Sites Tab of an Item

AgileListEntryType lst03 = new AgileListEntryType();
SelectionType[] multiSelect = new SelectionType[1];
multiSelect[0] = new SelectionType();
multiSelect[0].setValue("Bangalore");
lst03.setSelection(multiSelect);
Element element = createMessageElement("siteName");
JAXBContext jc = JAXBContext.newInstance(AgileListEntryType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<AgileListEntryType> jaxbEl = new JAXBElement<AgileListEntryType>(new QName("",element.getNodeName()),
    AgileListEntryType.class, lst03);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "AgileListEntryType");
row[0].getAny().add(element)

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

ObjectReferentIdType multiSelect = new ObjectReferentIdType();
multiSelect.setClassIdentifier("Broker");
multiSelect.setObjectIdentifier("SAP0265");
Element element = createMessageElement(”supplier01”);
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
        ObjectReferentIdType.class, multiSelect);
marshaller.marshal(jaxbEl, element);
element = (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);

Method 2

AgileObjectListEntryType multilist01 = new AgileObjectListEntryType();
ObjectReferentIdType[] obj = new ObjectReferentIdType[1];
obj[0] = new ObjectReferentIdType();
obj[0].setClassIdentifier("Broker");
obj[0].setObjectIdentifier("SAP0265");
multilist01.setSelection(obj);
Element element = createMessageElement("supplier");
JAXBContext jc = JAXBContext.newInstance(AgileObjectListEntryType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<AgileObjectListEntryType> jaxbEl = new JAXBElement<AgileObjectListEntryType>(new QName("",element.getNodeName()),
    AgileObjectListEntryType.class, multilist01);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "AgileObjectListEntryType");
row[0].getAny().add(element);

5.4.1.3 Adding Suppliers to a Manufacturer Part

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;
AgileObjectListEntryType multilist01 = new AgileObjectListEntryType();
ObjectReferentIdType[] obj = new ObjectReferentIdType[1];
obj[0] = new ObjectReferentIdType();
obj[0].setClassIdentifier("Broker");
obj[0].setObjectIdentifier("SAP0265");
multilist01.setSelection(obj);
Element element = createMessageElement("supplier");
JAXBContext jc = JAXBContext.newInstance(AgileObjectListEntryType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<AgileObjectListEntryType> jaxbEl = new JAXBElement<AgileObjectListEntryType>(new QName("",element.getNodeName()),
    AgileObjectListEntryType.class, multilist01);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "AgileObjectListEntryType");
row[0].getAny().add(element);

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

Element mfrPartnumber = createMessageElement("mfrPartNumber");
mfrPartnumber.setTextContent("bosco");
rows.getAny().add(mfrPartnumber);
Element mfrName = createMessageElement("mfrName");
mfrName.setTextContent("ciscod");
rows.getAny().add(mfrName);

Method 2

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);
Element element = createMessageElement("mfrPartObj");
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
    ObjectReferentIdType.class, obj);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);

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);        
Element element = createMessageElement("name");
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
     ObjectReferentIdType.class, obj);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);

5.4.1.6 Adding Affected Item to a Change

Element itemNumber = createMessageElement("itemNumber");
itemNumber.setTextContent("P00400");
row.getAny().add(itemNumber)

Element effectiveDate = createMessageElement("effectiveDate");
JAXBContext jc = JAXBContext.newInstance(Date.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<Date> jaxbEl = new JAXBElement<Date>(new QName("",element.getNodeName()),
          Date.class, new Date();
marshaller.marshal(jaxbEl, effectiveDate);
effectiveDate = (Element) effectiveDate.getFirstChild();
effectiveDate.setAttribute("attributeId", ItemConstants.ATT_PAGE_TWO_DATE01.toString());
effectiveDate.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema");
effectiveDate.setAttribute("xsi:type", "date");
row.getAny().add(effectiveDate);
Element newRev = createMessageElement("newRev");
newRev.setTextContent("Item_01");
row.getAny().add(newRev);

5.4.1.7 Adding Site Specific Item to the BOM Tab

To add a child object to a specific site, use 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, use the setAdditionalRowInfo 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;
Element itemNumber = createMessageElement("itemNumber");
itemNumber.setTextContent(childPartNumber);
rows[0].getAny().add(itemNumber);
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. Here, 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 );
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);
Element element = createMessageElement("mfrPartNumber");             
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
    ObjectReferentIdType.class, objRefId);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);
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 use 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();         
ObjectReferentIdType objRefId = new ObjectReferentIdType();           
objRefId.setClassIdentifier(refSubclassName);
objRefId.setObjectIdentifier(refObjName);
objRefId.setReferencedObjKey(refObjPubKey);
Element element = createMessageElement("number");
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
                               ObjectReferentIdType.class, objRefId);
marshaller.marshal(jaxbEl, element);
element = (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);
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();
Element effectiveDate = createMessageElement("effectiveDate");             
JAXBContext jc = JAXBContext.newInstance(Date.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<Date> jaxbEl = new JAXBElement<Date>(new QName("",element.getNodeName()),
        Date.class, new Date();
marshaller.marshal(jaxbEl, effectiveDate);
effectiveDate =  (Element) effectiveDate.getFirstChild();
effectiveDate.setAttribute("attributeId", ItemConstants.ATT_PAGE_TWO_DATE01.toString());
effectiveDate.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema");
effectiveDate.setAttribute("xsi:type", "date");
row.getAny().add(effectiveDate);
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 the Readonly Tables."

While 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");
Element element = createMessageElement("itemNumber");             
JAXBContext jc = JAXBContext.newInstance(ObjectReferentIdType.class);
Marshaller marshaller = jc.createMarshaller();
JAXBElement<ObjectReferentIdType> jaxbEl = new JAXBElement<ObjectReferentIdType>(new QName("",element.getNodeName()),
                            ObjectReferentIdType.class, multiSelect);
marshaller.marshal(jaxbEl, element);
element =  (Element) element.getFirstChild();
element.setAttribute("xmlns:xsi","http://xmlns.oracle.com/AgileObjects/Core/Common/V1");
element.setAttribute("xsi:type", "ObjectReferentIdType");
row[0].getAny().add(element);
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);