=======
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
 

17 Managing and Tracking Quality

This chapter includes the following:

<<<<<<< .mine
=======
>>>>>>> .r346

17.1 About Quality Control

The Agile PLM system provides tools that allow companies to track and manage the following quality-related items:

  • customer complaints

  • product and manufacturing quality issues

  • enhancement and corrective action requests

The corrective action process in the Agile PLM system is flexible and can be implemented in many different ways. For example, one way to customize the Agile PLM system is to use the Agile API to integrate the system with a Customer Relationship Management (CRM) system.

<<<<<<< .mine
=======
>>>>>>> .r346

17.1.1 Quality-Related API Objects

The Agile API includes the following new interfaces:

  • ICustomer - interface for the Customer class. A customer is anyone that uses a company's product(s). In some Agile PLM implementations, customers and problem reports will be imported directly from Customer Relationship Management (CRM) systems.

  • IServiceRequest - interface for the ServiceRequest class. IServiceRequest is a subinterface of IRoutable; it enables you create two types of service requests, problem reports and nonconformance reports (NCRs).

  • IQualityChangeRequest - interface for the QualityChangeRequest class, which is similar to an ECR and other types of change requests. It represents a closed loop Workflow process that addresses quality problems. Audit and CAPA (Corrective Action/Preventive Action) are subclasses of QualityChangeRequest.

<<<<<<< .mine
=======
>>>>>>> .r346

17.1.2 Quality-Related Roles and Privileges

To create, view, and modify problem reports, NCRs, CAPAs, and Audits, you must have the appropriate privileges. The Agile PLM system has two default user roles that provide users with privileges to work with these quality-related objects:

  • Quality Analyst - role for users who manage problem reports, and NCRs.

  • Quality Administrator - role for users who manage audits and CAPAs.

For more information about roles and privileges, refer to the Agile PLM Administrator Guide.

<<<<<<< .mine
=======
>>>>>>> .r346

17.2 Working with Customers

This section describes how to create, load, and save ICustomer objects.

<<<<<<< .mine
=======
>>>>>>> .r346

17.2.1 About Customers

The QualityChangeRequest object stores contact information about a customer. What role does a customer have in the Agile PLM system? Customers provide feedback on your company's products, alerting you to quality issues or problems they encounter.

This object can originate in another system, such as a CRM system. You can use the Agile API to import customer data and problem reports from CRM systems into the Agile PLM system.

<<<<<<< .mine
=======
>>>>>>> .r346

17.2.2 Creating a Customer

To create a customer, use the IAgileSession.createObject() method. At a minimum, you should specify values for the General Info.Customer Name and General Info.Customer Number attributes.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-1 Creating a customer

try {//Create a Map object to store parameters   Map params = new HashMap();

//Initialize the params object   params.put(CustomerConstants.ATT_GENERAL_INFO_CUSTOMER_NUMBER, "CUST00006");   params.put(CustomerConstants.ATT_GENERAL_INFO_CUSTOMER_NAME, 
      "Western Widgets");

//Create a new customer   ICustomer cust1 = 
      (ICustomer)m_session.createObject(CustomerConstants.CLASS_CUSTOMER, params);   } catch (APIException ex) {      System.out.println(ex);   }
<<<<<<< .mine
=======
>>>>>>> .r346

17.2.3 Loading a Customer

To load a customer, use the IAgileSession.getObject() method. To uniquely identify a customer, specify the value for the General Info | Customer Number attribute.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-2 Loading a customer

try {// Load a customer by specifying a CustomerNumber   ICustomer cust = 
      (ICustomer)m_session.getObject(ICustomer.OBJECT_TYPE, "CUST00006");} catch (APIException ex) {System.out.println(ex);
}
<<<<<<< .mine
=======
>>>>>>> .r346

17.2.4 Saving a Customer as Another Customer

To save a customer as another customer, use the IDataObject.saveAs() method, which has the following syntax:

public IAgileObject saveAs(java.lang.Object type, java.lang.Object params)

For the params parameter, specify the General Info | Customer Name and General Info | Customer Number attributes.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-3 Saving a customer as another customer

Saving a customer to another customertry {   // Load an existing customer   ICustomer cust1 = 
   (ICustomer)m_session.getObject(ICustomer.OBJECT_TYPE, "CUST00006");

//Create a Map object to store parameters   Map params = new HashMap();

//Initialize the params object   params.put
      (CustomerConstants.ATT_GENERAL_INFO_CUSTOMER_NUMBER, "CUST00007");   params.put(
      CustomerConstants.ATT_GENERAL_INFO_CUSTOMER_NAME, "Wang Widgets");

// Save the customer   ICustomer cust2 = 
      (ICustomer)cust1.saveAs(CustomerConstants.CLASS_CUSTOMER, params);} catch (APIException ex) {      System.out.println(ex);}
<<<<<<< .mine
=======
>>>>>>> .r346

17.3 Working with Product Service Requests

This section describes how to work with the two classes of Product Service Requests: Problem Reports and Nonconformance Reports

<<<<<<< .mine
=======
>>>>>>> .r346

17.3.1 About Problem Reports

A problem report describes a problem or an issue that occurred with a product from the customer's perspective. A problem report can be submitted by a customer, sales representative, or customer service representative.

Because a problem report usually originates with a customer, it may not accurately describe the actual cause of the problem. To understand the root cause of a problem, a Quality Analyst must investigate the problem.

Problem reports can be routed for investigation. The investigating team, consisting of Quality Analysts, determines the root cause of the problem and decides whether to escalate the problem into an issue.

<<<<<<< .mine
=======
>>>>>>> .r346

17.3.2 About Nonconformance Reports

A nonconformance report (NCR) is used to report material damages, failure modes, or defects in a product received by a customer or supplier. An NCR is typically identified when a product shipment is inspected after receipt from a supplier. A product is nonconforming if it does not meet customer requirements or specifications. Such products are generally rejected or segregated to await disposition. A nonconformance report may require that a Quality Analyst investigate the problem and determine whether corrective action is required.

NCRs can be routed for review. Typically, the review is used for additional information gathering rather than approval and rejection.

<<<<<<< .mine
=======
>>>>>>> .r346

17.3.3 Creating a Product Service Request

To create a problem report or nonconformance report, use the IAgileSession.createObject() method. The only required attribute value you must specify is the object's number. The following example shows how to create problem reports and NCRs.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-4 Creating a problem report or NCR

public IServiceRequest createPR(String strNum) throws APIException {   IServiceRequest pr = (IServiceRequest)m_session.createObject(   ServiceRequestConstants.CLASS_PROBLEM_REPORT, strNum); 
   return pr;}public IServiceRequest createNCR(String strNum) throws APIException {   IServiceRequest ncr = (IServiceRequest)m_session.createObject(   ServiceRequestConstants.CLASS_NCR, strNum);   return ncr;}
<<<<<<< .mine
=======
>>>>>>> .r346

17.3.4 Assigning a Product Service Request to a Quality Analyst

To assign a problem report or NCR to a Quality Analyst, set the value for the Cover Page | Quality Analyst field, which is a list field. The available values for the list field consists of Agile PLM users. The following example shows how to set the value for the Cover Page.Quality Analyst field for a problem report or NCR.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-5 Assigning a problem report or nonconformance report

void assignServiceRequest(IServiceRequest sr) throws APIException {   Integer attrID;

//Set attrID equal to the Quality Analyst attribute ID   attrID = ServiceRequestConstants.ATT_COVER_PAGE_QUALITY_ANALYST;

//Get the Cover Page.Quality Analyst cell   ICell cell = sr.getCell(attrID);

//Get available list values for the list   IAgileList values = cell.getAvailableValues();

//Set the value to the current user   IUser user = m_session.getCurrentUser();   values.setSelection(new Object[] { user });   cell.setValue(values);}
<<<<<<< .mine
=======
>>>>>>> .r346

17.3.5 Adding Affected Items to a Product Service Request

To associate a problem report or nonconformance report with one or more items, you add items to the Affected Items table. Each Product Service Request can be associated with many items.


Note:

If Product Service Requests have been added to the Related PSR table, the Affected Items table cannot be modified.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-6 Adding an affected item to a Product Service Request

void addAffectedItem(IServiceRequest sr, String strItemNum) throws APIException {

//Get the class   IAgileClass cls = sr.getAgileClass();

//Attribute variable   IAttribute attr = null;

//Get the Affected Items table   ITable affItems = sr.getTable(ServiceRequestConstants.TABLE_AFFECTEDITEMS);

//Create a HashMap to store parameters   HashMap params = new HashMap();

//Set the Latest Change value   attr = cls.getAttribute
      (ServiceRequestConstants.ATT_AFFECTED_ITEMS_LATEST_CHANGE);   IAgileList listvalues = attr.getAvailableValues();   listvalues.setSelection(new Object[] { 
   new Integer(0)});   params.put(ServiceRequest
      Constants.ATT_AFFECTED_ITEMS_LATEST_CHANGE, listvalues);

//Set the Affected Site value   attr = cls.getAttribute
      (ServiceRequestConstants.ATT_AFFECTED_ITEMS_AFFECTED_SITE);   IAgileList listvalues = attr.getAvailableValues();   listvalues.setSelection((new Object[] { "Hong Kong" });   params.put(ServiceRequestConstants.
      ATT_AFFECTED_ITEMS_AFFECTED_SITE, listvalues);//Create a new row in the Affected Items table   IRow row = affItems.createRow(params);}
<<<<<<< .mine
=======
>>>>>>> .r346

17.3.6 Adding Related PSRs to a Product Service Request

A Product Service Request can be used to aggregate multiple problem reports or NCRs into one master. To do this, create a new Product Service Request and don't add items to the Affected Items table. Instead, select the Related PSR table and add a row for each related Product Service Request. The single PSR you create is the Parent PSR. All the added PSRs on the Related PSR tab are child PSRs.


Note:

SmartRules settings control whether a PSR can be associated with both affected items and related PSRs, or only affected items or related PSRs. Depending on enabling/disabling the ”PSR contains Items and Related PSRs” SmartRule setting, you can enable/disable the Affected Items tab after you add Related PSRs. For information on SmartRules and PSRs, refer to Agile PLM Product Quality Management User Guide and Agile PLM Administrator Guide. The following example assumes SmartRules are set properly.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-7 Adding related PSRs to a Product Service Request

void addRelatedPSRs(IServiceRequest sr, String[] psrNum) throws APIException {

//Get the Related PSR table   ITable relPSR = sr.getTable(ServiceRequestConstants.TABLE_RELATEDPSR);

//Create a HashMap to store parameters   HashMap params = new HashMap();

//Add PSRs to the Related PSR table   for (int i = 0; i < psrNum.length; i++) {

   //Set the PSR Number value   params.put(ServiceRequestConstants.ATT_RELATED_PSR_PSR_NUMBER, psrNum[i]);

   //Create a new row in the Related PSR table

   IRow row = relPSR.createRow(params);   //Reset parameters   params = null;   }}
<<<<<<< .mine
=======
>>>>>>> .r346

17.4 Working with Quality Change Requests

A Quality Change Request, or QCR, allows a Quality Analyst to manage quality records that contain aggregated problems related to products, documents, suppliers, and customers. You can route the QCR for review and approval, driving the issue(s) to closure using a corrective or preventive action (CAPA). This may result in changes to a product, process, or supplier by initiating an ECO or MCO. QCRs also provide an audit trail between problems, corrective and preventive actions, and engineering changes.

Agile PLM provides two classes of Quality Change Requests:

  • CAPA - Stands for Corrective Action/Preventive Action, which addresses defects that (generally) surfaced from problem reports. By the time a problem reaches the CAPA stage, the team has figured out which specific items must be fixed. Consequently, the affected item for a CAPA may be different from the affected item of its related problem report. For example, say a customer reported a problem with a DVD-ROM drive. A CAPA is initiated and the root-cause is identified to be a defect in the IDE controller. Therefore, the CAPA and its related problem report have different affected items.

  • Audit - Systematic, independent and documented processes for obtaining evidence and evaluating it objectively to determine the extent to which criteria are fulfilled. Audits can be initiated against items for which no problems have been reported.

<<<<<<< .mine
=======
>>>>>>> .r346

17.4.1 Creating a Quality Change Request

To create a QCR, use the IAgileSession.createObject() method. The only required attribute value you must specify is the object's number. The example below shows how to create both CAPA and Audit QCRs.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-8 Creating a QCR

public IQualityChangeRequest createCAPA(String strNum) throws APIException {   IQualityChangeRequest capa = 
      IQualityChangeRequest)
         m_session.createObject(QualityChangeRequestConstants.CLASS_CAPA, strNum);
   return capa;}public IQualityChangeRequest createAudit(String strNum) throws APIException {   IQualityChangeRequest audit = 
      IQualityChangeRequest)
        m_session.createObject(QualityChangeRequestConstants.CLASS_AUDIT, strNum);   return audit;}
<<<<<<< .mine
=======
>>>>>>> .r346

17.4.2 Assigning a Quality Change Request to a Quality Administrator

To assign a QCR to a Quality Administrator, you set the value for the Cover Page | Quality Administrator field. This process is similar to the way you assign a Product Service Request to a Quality Analyst.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-9 Assigning a QCR

void assignQCR(IQualityChangeRequest qcr) throws APIException {   Integer attrID;

//Set attrID equal to the Quality Administrator attribute ID   attrID = QualityChangeRequestConstants.ATT_COVER_PAGE_QUALITY_ADMINISTRATOR;

//Get the Cover Page.Quality Administrator cell   ICell cell = qcr.getCell(attrID);

//Get available list values for the list   IAgileList values = cell.getAvailableValues();

//Set the value to the current user   IUser user = m_session.getCurrentUser();   values.setSelection(new Object[] { user });   cell.setValue(values);}
<<<<<<< .mine
=======
>>>>>>> .r346

17.4.3 Saving a Quality Change Request as a Change

You can use the IDataObject.saveAs() method to save a QCR as another QCR or as an ECO (or another type of change order). When you save a QCR as an ECO, the items affected by the QCR are not automatically transferred to the Affected Items tab of the ECO. If you want to transfer affected items from the QCR to the ECO, you must write the code in your program to provide that functionality. Workflow is a required input parameter for using saveAs() on QCRs.


Note:

If you try to save a QCR to an object that is not a subclass of either the Quality Change Request or Change superclasses, the Agile API throws an exception.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-10

public IChange saveQCRasECO(IAgileSession session, IQualityChangeRequest qcr)    throws APIException {

// Get the ECO class   IAgileClass cls = m_admin.getAgileClass(ChangeConstants.CLASS_ECO);

// Get autonumber sources for the ECO class   IAutoNumber[] numbers = cls.getAutoNumberSources();

// Get Workflow for the ECO class   IWorkflow ecoWf =((IRoutableDesc)session.getAdminInstance().getAgileClass
      (ChangeConstants.CLASS_ECO)).getWorkflows()[0];

// Save the QCR as an ECO   HashMap map = new HashMap();      map.put(ChangeConstants.ATT_COVER_PAGE_NUMBER, numbers[0]);      map.put(ChangeConstants.ATT_COVER_PAGE_WORKFLOW, ecoWf);      IChange eco = (IChange)qcr.saveAs(ChangeConstants.CLASS_ECO, map);

// Add code here to copy affected items from the QCR to the ECO   return eco;}
<<<<<<< .mine
=======
>>>>>>> .r346

17.5 Using Workflow Features with PSRs and QCRs

PSRs and QCRs derive all Workflow functionality from the IRoutable interface. The following table lists the Workflow commands you can use to manage product quality objects.

Feature Equivalent API(s)
Audit a PSR or QCR IRoutable.audit()
Change the status of a PSR or QCR IRoutable.changeStatus()
Send a PSR or QCR to another user IDataObject.send()
Approve a PSR or QCR IRoutable.approve()
Reject a PSR or QCR IRoutable.reject()
Comment on a PSR or QCR IRoutable.comment()
Add or remove approvers for a PSR or QCR IRoutable.addApprovers() IRoutable.removeApprovers()

<<<<<<< .mine
=======
>>>>>>> .r346

17.5.1 Selecting Workflows for PSRs and QCRs

When you create a new Product Service Request or a Quality Change Request, you must select a workflow. Your Agile PLM system can have multiple workflows defined for each type of Product Service Request and Quality Change Request. To retrieve the valid workflows for an object, use IRoutable.getWorkflows(). If a Workflow has not been assigned yet, you can use IRoutable.getWorkflows() to select a workflow, as shown in the following example.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-11 Selecting a workflow

public static IServiceRequest createPSR() throws APIException {

// Create a problem report   IAgileClass prClass = 
      admin.getAgileClass(ServiceRequestConstants.CLASS_PROBLEM_REPORT);   IAutoNumber[] numbers = 
      prClass.getAutoNumberSources();
   IServiceRequest pr = 
      (IServiceRequest)m_session.createObject(prClass, numbers[0]);

*/ 
*  Get the current Workflow which is a null object
* because  the Workflow has not been set yet)
/*
IWorkflow wf = pr.getWorkflow();

// Get all available workflowsIWorkflow[] wfs = pr.getWorkflows();

// Set the problem report to use the first workflowpr.setWorkflow(wfs[0]);return pr;}

You can also set the Workflow for a Product Service Request or a Quality Change Request by selecting a value for the Cover Page.Workflow field, as shown in the following example.

<<<<<<< .mine
=======
>>>>>>> .r346

Example 17-12 Selecting a Workflow by setting the value of Cover Page.Workflow

void selectWorkflow(IServiceRequest psr) 
      throws APIException {   int nAttrID;

//Set nAttrID equal to the Workflow attribute IDnAttrID = ServiceRequestConstants.ATT_COVER_PAGE_WORKFLOW;

//Get the Workflow cellICell cell = psr.getCell(nAttrID);

//Get available list values for the list

IAgileList values = cell.getAvailableValues();//Select the first workflowvalues.setSelection(new Object[] {new Integer(0));cell.setValue(values