Agile Product Lifecycle Management SDK Developer Guide - Using APIs Release 9.3.3 E39307-02 |
|
![]() Previous |
![]() Next |
This chapter includes the following:
About Agile Product Governance & Compliance
Agile PG&C Interfaces and Classes
Agile PG&C Roles
Creating Declarations, Specifications, and Substances
Creating Substances
Adding Items, Manufacturer Parts, and Part Groups to Declarations
Adding Substances to Declarations
Adding Substances to a Specification
Adding Specifications to a Declaration
Routing Declarations
Completing a Declaration
Submitting Declarations to Compliance Managers
Adding Substance Compositions for Manufacturer Parts
Rolling Up Compliance Data
Agile Product Governance & Compliance (PG&C) addresses the growing number of environmental regulations and corporate environmental policies that impact product definition and the import, export, and disposal of restricted substances. Agile PG&C is designed to help OEM manufacturers audit the amount of regulated substances used in their products, and show that they responsibly dispose of, recycle or reuse electronics containing those substances.Agile PG&C enables PLM users to cost-effectively comply with environmental regulations. they can use Agile PG&C to obtain compliance data for parts from their suppliers. This enables PLM installations to:
Meet substance restrictions
Satisfy reporting requirements for regulations
Design recyclable products
Minimize compliance costs
Eliminate noncompliance on future products
Agile PG&C is a communication vehicle between the Compliance Manager and suppliers. The Compliance Manager ensures that the installation's products adhere to government regulations and company policy. As the Material Provider, the supplier completes and signs off on material declarations, thereby disclosing which hazardous substances are contained within the components and subassemblies it provides. For a more detailed overview of Agile PG&C features, refer to the Product Governance & Compliance User Guide
The following table lists Agile PG&C-related interfaces and classes:
Object | Interface | Constants Class |
---|---|---|
Declaration | IDeclaration | DeclarationConstants |
Specification | ISpecification | SpecficationConstants |
Substance | ISubstance | SubstanceConstants |
Part Groups | ICommodity | PartGroupConstants |
Items, Manufacturer Parts, and Part Groups are objects that are also related to Agile PG&C. They have Specifications, Compositions, and Substances tables that are populated with data when declarations are released. For Manufacturer Parts, you can edit the Compositions and Substances tables directly without submitting a declaration.
Note: The terms ”part group” and ”commodity” are used interchangeably in this guide to refer to any ICommodityobject where ICommodity represents the Part Group base class, which includes the Commodity and Part Family subclasses. |
Of course, other common Agile API interfaces, such as ITable, IDataObject, and ICell, are also used to work with Agile PG&C objects.
Agile PLM provides two out-of-the-box roles designed for Agile PG&C users:
Compliance Manager - This provides privileges needed to create and manage Agile PG&C objects, such as Declarations, Substances, and Specifications, and run Agile PG&C reports. Compliance Managers are responsible for routing material declarations to suppliers.
(Restricted) Material Provider - This provides privileges needed to create and modify declarations, as well as read all other types of Agile PG&C objects. This role is typically assigned to supplier users, who have restricted access to the Agile PLM system. Material Providers are responsible for completing and signing off on material declarations.
To use Agile PG&C APIs mentioned in this chapter, make sure you log in as a user assigned either the Compliance Manager role, or the (Restricted) Material Provider role. For more information about Agile PLM roles, refer to the Agile PLM Administrator Guide.
Note: The Discover Change privilege mask is not included in the Compliance Manager role. If you only have the Compliance Manager role, then you do not have sufficient privileges to use the API to set the calculated compliance of a part in a Declaration, and pass the Change Number to the SDK call. To pass the Change Number in the SDK call, you must have the Discover Change privilege mask for that object in the Change Orders class. For more information, see Setting Values in the Calculated Compliance Field for Declaration Objects. |
The following paragraphs provide definitions and procedures to define and manage these PG&C classes.
A Declaration object is the main record of Agile PG&C. It tracks the substances and materials that are used for items, manufacturer parts, and part groups. When you release a declaration, the information gathered from it is published to the product record, thereby updating the Composition data contained within the items, manufacturer parts, and part groups listed by the declaration.
There are seven declaration subclasses provided with Agile PLM:
Homogeneous Material Declaration - A homogeneous material composition declaration that uses material-level specifications.
IPC 1752-1 Declaration - A material composition declaration for electronic products that conforms to IPC standards and uses only one part-level specification.
IPC 1752-2 Declaration - A homogeneous material composition declaration for electronic products that conforms to IPC standards and uses only one material-level specification.
JGPSSI Declaration - A material composition declaration that follows the Japanese Green Procurement (JGP) standard and uses part-level specifications.
Part Declaration - A material composition declaration that uses part-level or material-level specifications.
Substance Declaration - A material composition declaration for each substance within part-level specifications.
Supplier Declaration of Conformance - A questionnaire to assess supplier compliance with specifications from customers and government agencies. The survey addresses compliance at a general company level. Can be used for CSR type declarations.
The procedure for creating a declaration is the same for all declaration subclasses. You must specify the declaration subclass as well as values for the Cover Page.Name and Cover Page.Supplier attributes. Other declaration attributes are optional.
By default, the Cover Page.Name field uses an Autonumber format with the prefix ”MD” (for ”Material Declaration”). Although the Autonumber format is not required, it is a good practice to use the same prefix for all declarations to make it easier to search for them.
Note: The case required for the Cover Page.Name field depends on the selected character set for the field. For more information about defining and modifying character sets, Refer to the Agile PLM Administrator Guide. |
Supplier users with the (Restricted) Material Provider role can also create declarations. However, in this case, only the Cover Page.Name attribute is required to create the object. The CoverPage.Supplier attribute is filled in automatically with the user's supplier organization.
The following example shows how to create a JGPSSI declaration.
Example 20-1 Creating a JGPSSI Declaration
public void CreateJGPSSIDeclaration(String num, ISupplier supplier) throws Exception { // Create a Map object to store parameters Map params = new HashMap(); // Initialize the params object params.put(DeclarationConstants.ATT_COVER_PAGE_NAME, num); params.put(DeclarationConstants.ATT_COVER_PAGE_SUPPLIER, supplier); // Get the JGPSSI Declaration subclass IAgileClass declClass = m_session.getAdminInstance().getAgileClass( DeclarationConstants.CLASS_JGPSSI_DECLARATION); // Create a new JGPSSI declaration IDeclaration object = ( IDeclaration)m_session.createObject(declClass, params);}
Specifications are used to state the criteria that a product is expected to meet or exceed. They are generally used to limit the amount of restricted substances contained in a product. Specifications can be internal documents issued by a company or industry, or, more commonly, they are regulations issued by a governing body. Here are some examples of government regulations:
Restrictions on the Use of Certain Hazardous Substances in Electrical and Electronic Equipment (RoHS) Directive, issued by the European Union
Waste Electrical and Electronic Equipment (WEEE) Directive, issued by the European Union
Food Allergen Labeling and Consumer Protection Act (FALCPA), issued by the U.S.A. Food and Drug Administration (FDA)
A specification defines a list of substances, the parts-per-million (PPM) threshold for each substance, and whether a particular substance is restricted. Compliance Managers can use specifications to pre-populate material declarations with appropriate substances to ensure compliance.
The only required attribute you must specify when you create a specification is General Info.Name. The name must be unique. The name is case-insensitive, which means ”ROHS” is treated the same as "Rohs".
The General Info.Validation Type attribute is important because it determines whether the specification is Part Level (the default) or Homogeneous Material Level, which affects the types of declarations that can be used with the specification. Another optional attribute is General Info.Lifecycle Phase. When you create a specification, the default lifecycle phase is Active. To make the specification obsolete, change the value of its lifecycle phase attribute to Obsolete.
There are four substance subclasses provided with Agile PLM:
Subpart - a subunit of a component manufacturer part. The Composition table of a subpart can have other subparts, materials, substance groups, and substances.
Material - a compound consisting of several substances. The Composition table of a material can have substance groups or substances.
Substance Group - a group of substances. The Composition table of a substance group can have only substances.
Substance - a single element, such as lead, chromium, or cadmium. Substances do not have a Composition table.
These substance subclasses comprise the hierarchy of objects that can appear on a Composition table, also known as the Bill of Substances.
Like material objects, the only attribute you need to specify to create a substance is the General Info.Name attribute, which is equivalent to the substance number. You can also specify other optional attributes, such as General Info.CAS Number.
Example 20-3 Creating a substance
public void createSubstance(String num, String casNumber) throws Exception { // Create a Map object to store parameters and initlize the params object. Map params = new HashMap(); params.put(SubstanceConstants.ATT_GENERAL_INFO_NAME, num); params.put(SubstanceConstants.ATT_GENERAL_INFO_CAS_NUMBER, casNumber); // Get the Substance subclass IAgileClass subsClass = m_session.getAdminInstance().getAgileClass (SubstanceConstants.CLASS_SUBSTANCE); // Create a new substance ISubstance substance = (ISubstance)m_session.createObject(subsClass, params);}
A substance group object is a group of multiple substances tracked in Agile PLM that have a common base substance. Every substance within the group has a conversion factor used to convert the weight of the base substance of the group.
Example 20-4 Creating a substance group
public void createSubstanceGroup(String num, ISubstance sub) throws Exception {// Create a Map object to store parameters Map params = new HashMap(); // Initialize the map object params.put(SubstanceConstants.ATT_GENERAL_INFO_NAME, num); params.put(SubstanceConstants.ATT_GENERAL_INFO_BASE_SUBSTANCE, sub); // Get the Substance Group subclass IAgileClass subsClass = m_session.getAdminInstance(). getAgileClass(SubstanceConstants.CLASS_SUBSTANCE_GROUP); // Create a new Substance Group ISubstance sub = (ISubstance)m_session.createObject(subsClass, params);}
When you create a material object, the only attribute you need to specify is the General Info.Name attribute, which is equivalent to the substance number. After you create a material object, you can add substances to its Composition table.
public void createMaterial(String num, ISubstance[] substances) throws Exception { // Create a Map object to store parameters Map params = new HashMap(); // Initialize the params object params.put(SubstanceConstants.ATT_GENERAL_INFO_NAME, num); // Create a new material ISubstance material = (ISubstance)m_session. createObject(SubstanceConstants.CLASS_MATERIAL, params ); // Get the Composition table ITable composition = material.getTable(SubstanceConstants.TABLE_COMPOSITION); // Add substances to the Composition table for (int i = 0; i < substances.length; ++i) { IRow row = composition.createRow(substances[i]); }}
A subpart object is a subunit of a component that is tracked in Agile PLM. Subparts are parts without a part number that are used to create a bill of material of manufacturer parts or parts within a composition.
Example 20-6 Creating a subpart
public void createSubpart(String num) throws Exception { // Create a Map object to store parameters Map params = new HashMap(); // Initialize the map object params.put(SubstanceConstants.ATT_GENERAL_INFO_NAME, num); // Get the Subpart subclass IAgileClass subsClass = m_session.getAdminInstance() .getAgileClass(SubstanceConstants.CLASS_SUBPART); // Create a new Subpart ISubstance sub = (ISubstance)m_session.createObject(class, params); }
Each declaration has separate tables for items, manufacturer parts, and part groups. Each of these also has an associated composition table: Item Composition, Manufacturer Part Composition, and Part Group Composition.
When you add an item to the Items table of a declaration, the latest released revision of the item is used. If the item does not have a released revision, the Introductory revision is used.
The following example shows how to add items, manufacturer parts, and part groups to a declaration.
Example 20-7 Adding items, manufacturer parts, and part groups to a declaration
public void addDecObjects(IDeclaration dec) throws APIException {try { HashMap params = new HashMap(); //Add an Item to the Items table ITable tblItems = dec.getTable(DeclarationConstants.TABLE_ITEMS); params.clear(); params.put(DeclarationConstants. ATT_ITEMS_ITEM_NUMBER, "1000-02"); IRow rowItems = tblItems.createRow(params); //Add a Manufacturer Part to the Manufacturer Parts table ITable tblMfrParts = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTS); params.clear(); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_PART_NUMBER, "Widget103"); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_NAME, "ACME"); IRow rowMfrParts = tblMfrParts.createRow(params); //Add a Commodity to the Part Groups table ITable tblPartGroups = dec.getTable(DeclarationConstants.TABLE_PARTGROUPS); params.clear(); params.put(DeclarationConstants.ATT_PART_GROUPS_NAME, "RES"); IRow rowPartGroups = tblPartGroups.createRow(params); } catch (APIException ex) { System.out.println(ex); } }
You can add substances to the Item Composition, Manufacturer Part Composition, and Part Group Composition tables contained within a declaration. To publish substances into items, manufacturer parts, and part groups, you release the declaration. When the declaration is released, the substances get added automatically to the Substances tables of the corresponding items, manufacturer parts, and part groups.
To add a row to the composition tables of a declaration, use the ITable.createRow() method. Because the composition tables are mapping tables, you cannot pass an ISubstance object to create the row. Instead, specify a Map object containing attribute-value pairs.
Important: The Substances and Composition tables for items and part groups are read-only. They get populated with data only when declarations are released |
To add a substance to one of the Composition tables of a declaration:
Add an item, manufacturer part, or part group to the Items, Manufacturer Parts, or Part Groups tables of a declaration, respectively.
Add a substance row to the Composition table that references the parent row on the Items, Manufacturer Parts, or Part Groups table. Use the virtual attribute DeclarationConstants.ATT_PARENT_ROW to specify the parent row. When you add a substance, specify the substance name and substance type.
Important: For the Agile SDK, Composition tables for declarations list all parent objects contained in the Items, Manufacturer Parts, and Part Groups tables. Agile Web Client represents Composition tables differently. It shows a separate Composition table for each parent object. |
When you create a row in the Composition tables, you pass a Map object containing attribute-value pairs. The following table lists the attributes the Map object must contain:
Composition Table | Required Attributes | Declaration Constants |
---|---|---|
Item Composition | Item Row Substance Name | ATT_PARENT_ROW
ATT_ITEM_COMPOSITION_SUBSTANCE_NAME |
Manufacturer Part Composition | Manufacturer Part Row Substance Name | ATT_PARENT_ROW
ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME |
Part Group Composition | Part Group Row Substance Name | ATT_PARENT_ROW
ATT_PART_GROUP_COMPOSITION_SUBSTANCE_NAME |
When you add substances to the Composition tables of a declaration, you can structure them in multiple levels. The number of levels you can use depends on the type of declaration.
Homogeneous Materials Declaration - You can create a multilevel Bill of Substances with subparts, materials, substance groups, and substances. The composition must contain either a subpart or a material as a direct child. It can also include substances and substance groups, but they must be attached to a subpart or material.
Substance Declaration/JGPSSI Declaration - Users can add substances or substance groups to the Composition tables.
Part Declaration/Supplier Declaration of Conformance - These declarations do not have Composition tables.
Follow these rules when adding substances to a Composition table:
Parent objects must be added before their children.
Subparts can have the following children: other Subparts, Materials, Substance Groups, or Substances.
A Subpart cannot contain Subparts, Materials, Substance Groups, and Substances all at the same level.
A Subpart can contain other Subparts and Material at the same level.
A Subpart can contain Substance Groups and Substances at the same level.
Material can have the following children: Substance Groups or Substances.
Substance Groups can have the following children: Substances only.
When you add substances to a Composition table of a declaration, you can specify ”dummy” subparts and materials that do not exist in the Agile PLM system. Such subparts and materials will be visible only within the Composition table. When you add ”dummy” subparts and materials to the Composition table, you must specify the Substance Type attribute:
ATT_ITEM_COMPOSITION_SUBSTANCE_TYPE
ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_TYPE
ATT_PART_GROUP_COMPOSITION_SUBSTANCE_TYPE
The following example shows how to add a dummy subpart or material to the Manufacturer Part Composition table. Because the Substance Type field is a list field, the value passed for it is an IAgileList.
Example 20-8 Adding dummy subpart/material to Manufacturer Part Composition
public IRow addDummy (IDeclaration dec, IRow parentRow, String dummyName, IAgileList subtype) throws APIException { try { HashMap params = new HashMap(); ITable tblMfrPartComp = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTCOMPOSITION); params.put(DeclarationConstants. ATT_PARENT_ROW, parentRow); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, dummyName); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_TYPE, subtype); IRow dummyRow = tblMfrPartComp.createRow(params); return dummyRow; } catch (APIException ex) { System.out.println(ex); } }
The following examples show how to add:
Substances to the Manufacturer Part Composition Table of a Homogeneous Material Declaration
Substances to the Manufacturer Part Composition Table of a Substance Declaration
The following example shows how to add substances to a Manufacturer Part Composition table of a Homogeneous Material Declaration. The table has four levels: subparts, materials, substance groups, and substances. When you add a substance row to the table, we recommend that you pass a substance object (ISubstance) instead of a substance name (String) as the input parameter.
Example 20-9 Adding Homogeneous Material Level substances to Manufacturer Part Composition table
public void addHomogeneousMaterialComp(IAgileSession m_session) throws APIException { try { HashMap params = new HashMap();// Create a Declaration String num = "MDTEST001"; ISupplier supplier = (ISupplier)m_session.getObject(ISupplier.OBJECT_TYPE, "DISTRIBUTOR00007"); params.put(DeclarationConstants.ATT_COVER_PAGE_NAME, num); params.put(DeclarationConstants.ATT_COVER_PAGE_SUPPLIER, supplier); IAgileClass declClass = m_session.getAdminInstance().getAgileClass(DeclarationConstants. CLASS_HOMOGENEOUS_MATERIAL_DECLARATION); IDeclaration dec = (IDeclaration)m_session.createObject(declClass, params); // Add a Homogeneous Material Level spec to the Specifications table ITable tblSpec = dec.getTable(DeclarationConstants.TABLE_SPECIFICATION); params.clear(); ISpecification spec = (ISpecification)m_session.getObject(ISpecification. OBJECT_TYPE, "Lead Homogeneneous Material Level"); IRow rowSpec = tblSpec.createRow(spec); // Add a Manufacturer Part to the Manufacturer Parts table ITable tblMfrParts = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTS); params.clear(); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_PART_NUMBER, "Widget103"); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_NAME, "ACME"); IManufacturerPart mfrPart = (IManufacturerPart) m_session. getObject (IManufacturerPart.OBJECT_TYPE, params); IRow rowMfrParts = tblMfrParts.createRow(mfrPart); // Add a subpart to the Composition table ITable tblMfrPartComp = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTCOMPOSITION); ISubstance subpart = (ISubstance)m_session.getObject(SubstanceConstants. CLASS_SUBPART, "Steel Casing"); params.clear(); params.put(DeclarationConstants. ATT_PARENT_ROW, rowMfrParts); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, subpart); IRow rowSubpart = tblMfrPartComp.createRow(params); // Add a material ISubstance material = (ISubstance)m_session.getObject(SubstanceConstants. CLASS_MATERIAL, "Steel"); params.clear(); params.put(DeclarationConstants.ATT_PARENT_ROW, rowSubpart); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, material); IRow rowMaterial = tblMfrPartComp.createRow(params); // Add a substance group ISubstance sg = (ISubstance)m_session.getObject(SubstanceConstants. CLASS_SUBSTANCE_GROUP,"Lead Compounds"); params.clear(); params.put(DeclarationConstants.ATT_PARENT_ROW, rowMaterial); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, sg); IRow rowSubGroup = tblMfrPartComp.createRow(params);// Add a substance ISubstance sub = (ISubstance)m_session.getObject(SubstanceConstants.CLASS_SUBSTANCE,"Lead"); params.clear(); params.put(DeclarationConstants.ATT_PARENT_ROW, rowSubGroup); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, sub); IRow rowSubs = tblMfrPartComp.createRow(params); } catch (APIException ex) { System.out.println(ex); }}
The following example shows how to add substances to a Manufacturer Part Composition table of a Substance Declaration. The table has two levels: substance groups and substances.
Example 20-10 Adding Part Level substances to Manufacturer Part Composition table
public void addSubstanceComp(IAgileSession m_session) throws APIException { try { HashMap params = new HashMap(); //Create a Declaration String num = "MDTEST001"; ISupplier supplier = (ISupplier)m_session.getObject(ISupplier.OBJECT_TYPE, "DISTRIBUTOR00007"); params.put(DeclarationConstants.ATT_COVER_PAGE_NAME, num); params.put(DeclarationConstants.ATT_COVER_PAGE_SUPPLIER, supplier); IAgileClass declClass = m_session.getAdminInstance(). getAgileClass(DeclarationConstants.CLASS_SUBSTANCE_DECLARATION); IDeclaration dec = (IDeclaration)m_session.createObject(declClass, params); //Add a Specification to the Specifications table ITable tblSpec = dec.getTable(DeclarationConstants.TABLE_SPECIFICATION); params.clear(); // Part Level ISpecification spec = (ISpecification)m_session. getObject(ISpecification.OBJECT_TYPE, "Lead Part Level"); IRow rowSpec = tblSpec.createRow(spec); //Add a Manufacturer Part to the Manufacturer Parts table ITable tblMfrParts = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTS); params.clear(); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_PART_NUMBER, "Widget103"); params.put(DeclarationConstants. ATT_MANUFACTURER_PARTS_MFR_NAME, "ACME"); IManufacturerPart mfrPart = (IManufacturerPart) m_session.getObject(IManufacturerPart.OBJECT_TYPE, params); IRow rowMfrParts = tblMfrParts.createRow(mfrPart); //Add a substance group ITable tblMfrPartComp = dec.getTable(DeclarationConstants.TABLE_MANUFACTURERPARTCOMPOSITION); ISubstance sg = (ISubstance)m_session. getObject(SubstanceConstants.CLASS_SUBSTANCE_GROUP,"Lead Compounds"); params.clear(); params.put(DeclarationConstants.ATT_PARENT_ROW, rowMfrParts); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, sg); IRow rowSubGroup = tblMfrPartComp.createRow(params); //Add a substance ISubstance sub = (ISubstance)m_session.getObject(SubstanceConstants.CLASS_SUBSTANCE,"Lead"); params.clear(); params.put(DeclarationConstants. ATT_PARENT_ROW, rowSubGroup); params.put(DeclarationConstants. ATT_MANUFACTURER_PART_COMPOSITION_SUBSTANCE_NAME, sub); IRow rowSubs = tblMfrPartComp.createRow(params); } catch (APIException ex) { System.out.println(ex); }}
The Substances table of a specification is important to Agile PG&C because it identifies which substances are restricted and their threshold mass parts per million (PPM). Only substances and substance groups can be added to the Substances table of a Specification. To add a substance to the Substances table, use the ITable.createRow() method. You can pass an ISubstance or a Map object to create the new row.
Example 20-11 Adding a substance to a specification
public void addSubstanceToSpec(ISpecification spec, ISubstance substance) throws Exception { IRow row = null;//Add a substance to the Substances table ITable tableSub = spec.getTable(SpecificationConstants.TABLE_SUBSTANCES); row = tableSub.createRow(substance); if (row!=null){ //Set value of Restricted ICell cell = row.getCell(SpecificationConstants.ATT_SUBSTANCES_RESTRICTED); IAgileList list = (IAgileList)cell.getAvailableValues(); list.setSelection(new Object[] {"Yes"}); cell.setValue(list); //Set value of Threshold Mass PPM row.setValue(SpecificationConstants. ATT_SUBSTANCES_THRESHOLD_MASS_PPM, new Integer(10)); }}
The Specifications table of a declaration lists specifications related to the items, manufacturer parts, and part groups contained in the declaration. The purpose of a declaration is to the ensure that suppliers comply with any restrictions stated in the specifications.RU
Specifications are optional for declarations. If you submit a declaration without a specification, it means you intend to collect raw data (mass or PPM) at the substance level. The supplier must provide information on all materials and substances.
If you add a specification to a declaration, note that declaration classes support different types of specifications. The following table lists the specification requirements for each type of declaration:
Declaration Type | Supported Specification Validation Types |
---|---|
Homogeneous Material Declaration | Homogeneous Material Level |
IPC 1752-1 Declaration | Part Level |
IPC 1752-2 Declaration | Homogeneous Material Level |
JGPSSI Declaration | Part Level |
Part Declaration | Part Level and Homogeneous Material Level |
Substance Declaration | Part Level |
Supplier Declaration of Conformance | Part Level and Homogeneous Material Level |
Specifications may concern many substances, including those not used by the parts contained in the declaration. When the declaration is opened to the supplier, any relevant substances from the specifications are automatically added to the Item Composition, Manufacturer Part Composition, and Part Group Composition tables. This ensures that you are properly tracking any restricted substances contained in parts listed in the declaration.
Example 20-12 Adding specifications to the Specification table
private void addSpecifications(IDeclaration dec, ISpecification[] specs) throws Exception { ITable tableSpecs = dec.getTable(DeclarationConstants.TABLE_SPECIFICATION); for (int i = 0; i < specs.length; ++i) { ISpecification spec = specs[i]; IRow row = tableSpecs.createRow(spec); }}
The Default Declarations Workflow follows a straightforward process flow, as shown in the following figure.
The following table describes each status in the Default Declarations workflow.
Status | Description |
---|---|
Pending | The Compliance Manager creates a new declaration, adding new items, manufacturer parts, or part groups. He also adds specifications to the declaration. |
Open To Supplier | The Compliance Manager opens the declaration to the supplier, asking him to confirm whether parts comply with specifications.
When the Workflow status of a declaration is changed from ”Pending” to ”Open To Supplier,” the Agile PLM server automatically populates the declaration's Substances tables with any substances listed on its specifications. |
Submit to Manager | The supplier electronically ”signs” and submits the declaration back to the Compliance Manager. |
Review | The Compliance Manager and other reviewers verify and approve the contents of the declaration. |
Released | The Compliance Manager releases the declaration, thereby publishing the materials into the product record. |
Implemented | Once the parts are manufactured and disseminated in the field, the Compliance Manager implements the declaration, thereby completing the workflow. |
Before you can route a declaration, you should set values for the following three Cover Page fields:
Cover Page.Compliance Manager
Cover Page.Workflow
Cover Page.Due Date
Technically, only the Compliance Manager and Workflow fields are required to route the declaration. The Due Date field is optional but should be specified for tracking purposes. The following example shows how to set values for these three fields.
Example 20-13 Setting values for Compliance Manager, Workflow, and Due Date fields
public void setFieldsNeededForRouting(IDeclaration dec) throws Exception { //Set the Compliance Manager field IUser user = m_session.getCurrentUser(); dec.setValue(DeclarationConstants.ATT_COVER_PAGE_COMPLIANCE_MANAGER, user); //Set the Workflow field IWorkflow workflow = dec.getWorkflows()[0]; dec.setWorkflow(workflow);//Set the Due Date field DateFormat df = new SimpleDateFormat("MM/dd/yy"); dec.setValue(DeclarationConstants. ATT_COVER_PAGE_DUE_DATE, df.parse("05/01/05"));}
To change the status of a declaration, use the IRoutable.changeStatus() method. Once a declaration is opened to a supplier, only the supplier's contact users can edit it. For other users, including the Compliance Manager, the declaration becomes read-only. The following example shows how the Compliance Manager can change the status of a declaration to ”Open To Supplier.”
Example 20-14 Opening a declaration to a supplier
public void openToSupplier(IDeclaration dec) throws Exception { IStatus status = null; // Get the Open to Supplier status type IStatus[] stats = dec.getNextStatuses(); for (int i = 0; i < stats.length; i++) { if (stats[i].toString().equals("Open To Supplier")) { status = stats[i]; break; }} // Change from Open to Supplier status dec.changeStatus(status, false, null, false, false, null, null, null, false);}
For more information about Agile APIs that support Workflow processes, see Chapter 15, "Managing Workflow."
When a declaration is opened to a supplier, the supplier is responsible for completing the declaration and disclosing if any restricted substances are contained in the components and subassemblies it provides and whether those substances comply with specifications. To complete and sign off on declarations, one or more contact users for the supplier must be assigned the (Restricted) Material Provider role.
The Material Provider user should do the following to complete a declaration:
Fill in the Mass and Declared PPM fields or the Declared Compliance field for every substance listed on the Item Composition, Manufacturer Part Composition, and Part Group Composition tables, particularly for substances that are restricted by specifications.
Complete other flex fields on the Composition tables as necessary.
Add or remove substances from the declaration.
When the declaration is complete, the Material Provider user can sign off and submit the declaration to the Compliance Manager, described below.
When the supplier changes the status of the declaration from ”Open to Supplier” to ”Submit to Manager,” he must sign-off on the declaration. Therefore, he must use the changeStatus() method that has an additional password parameter:
changeStatus(IStatus newStatus, boolean auditRelease, String comment, boolean notifyOriginator, boolean notifyCCB, Object[] notifyList, Object[] approvers, Object[] observers, boolean urgent, String password)
The following example shows how the supplier can sign off and submit the declaration to the Compliance Manager.
Example 20-15 Signing off and submitting declarations to Compliance Manager
public void submitToCM(IDeclaration dec) throws Exception {IStatus status = null; // Get the Submit to Manager status type IStatus[] stats = dec.getNextStatuses(); for (int i = 0; i < stats.length; i++) { if (stats[i].toString().equals("Submit To Manager")) { status = stats[i]; break; }}// Change to the Submit to Manager status (signoff password is "agile") dec.changeStatus(status, false, null, false, false, null, null, null, false, "agile");}
The Agile API does not provide a method to publish a material declaration to the product record. Instead, a declaration is automatically published when it is released. Therefore, as far as the API is concerned, the substances table for an item, manufacturer part, or part group always reflects the last released declarations. However, Agile Web Client allows you to select an later declaration and publish it, thereby updating the substances information in the product record.
Unit of Measure fields in Agile PLM support mass (weight) values for Agile PG&C objects. The Unit of Measure datatype is a compound datatype, that includes a numeric value and a unit, for example, grams or ounces.
You can configure and manage weight fields using the following interfaces:
IMeasure
IUnit
IUnitOfMeasure
IUnitOfMeasureManager
This conversion is explained with the aid of the following example which converts an object's weight from Kilograms to Grams. You can use this example to convert the unit of measure that measured the volume of the object, or its height.
Note: This example converts the unit of measure in the source object from 1234.21 Kilograms to its equivalent weight in Grams. Thus, convert From is the source number you want to convert, Kilogram is source unit of measure, and Gram is that target unit of measure which are all randomly selected for this example. |
Example 20-16 Converting the Unit of Measure from Kilogram to Gram
try { double convertFrom = 1234.21; com.agile.api.IUnitOfMeasureManager uomManager = (IUnitOfMeasureManager) session.getManager(IUnitOfMeasureManager.class); IUnitOfMeasure fromUOM = uomManager.createUOM(0, "Kilogram"); IUnitOfMeasure toUOM = uomManager.createUOM(0, "Gram"); IUnit fromUnit = fromUOM.getUnit(); IUnit toUnit = toUOM.getUnit(); double conversionFactor = fromUnit.getConversionFactor() toUnit.getConversionFactor(); // This example returns 1000/1 = 1000 double convertedValue = convertFrom*conversionFactor; } catch (APIException ex) { System.out.println(ex);}
Although the Agile PLM administrator can define new measures from the UOM node in Agile Java Client, the Agile API supports only the Weight measure for Agile PG&C objects. You cannot use the Agile API to define new measures.
Note: In Agile 9.2.1, the Title Block.Weight field for items was changed to Title Block.Mass. However, the Agile API constant for the field is still ItemConstants.TITLE_BLOCK_WEIGHT. |
The following example shows how to get and set values for the Title Title Block.Mass field of an item.
Example 20-17 Getting and setting the mass (weight) value for an item
private IUnitOfMeasure getMassValue(IItem item) throws APIException { IUnitOfMeasure uom = (IUnitOfMeasure)item.getValue(ItemConstants.ATT_TITLE_BLOCK_WEIGHT); System.out.println("Value: " + uom.getValue()); System.out.println("Unit: " + uom.getUnit().toString()); return uom;}private void setMassValue(IItem item, double value, String unit) throws APIException { IUnitOfMeasure uom = null; IUnitOfMeasureManager uomm = (IUnitOfMeasureManager)m_session.getManager(IUnitOfMeasureManager.class); uom = uomm.createUOM(value, unit); item.setValue(ItemConstants.ATT_TITLE_BLOCK_WEIGHT, uom); System.out.println("Value: " + uom.getValue()); System.out.println("Unit: " + uom.getUnit().toString()); }
If you create a query to search for items by mass, only the numeric value is searched, not the unit. The server converts mass values to the standard unit before returning query results. For example, the following query returns all items whose mass value is between1.0 and 2.0 grams (the default standard unit). Items with a mass between 1000 and 2000 milligrams would also be included in the search results.
With appropriate privileges, you can modify the Specifications, Compositions, and Substances tables of a manufacturer part directly without submitting a declaration. This feature is useful for manufacturing partners that want to specify composition information for their parts. To add a row to the Specifications, Compositions, and Substances tables, use the ITable.createRow(Object) method.
Note: Once a row has been added to the Compositions and Substances tables of a Manufacturer Part, you cannot update or remove it. |
The procedure for adding rows to the Substances table of a Manufacturer Part is similar to the way you add rows to the composition tables for a declaration. Follow these steps to add substance compositions into a manufacturer part:
To add rows to Substances table of a Manufacturer Part:
Optionally, add a specification to the Specifications table.
Add a row to the Compositions table. You must specify a value for the ManufacturerPartConstants.ATT_COMPOSITIONS_COMPOSITION_TYPE attribute.
Add one or more rows to the Substances table. Each row must reference the parent row from the Compositions table. Use the virtual attribute ManufacturerPartConstants.ATT_PARENT_ROW to specify the parent row. When you add a substance, specify the substance name and substance type.
For additional rules about adding substances to the Substances table, see "Rules for Adding Substances.".
The Composition Type attribute for the parent row determines the types of substances you can add to the Substances table. There are three possible Composition Type values:
Homogeneous Material Composition - You can create a multilevel Bill of Substances with subparts, materials, substance groups, and substances. The composition must contain either a subpart or a material as a direct child. It can also include substances and substance groups, but they can only be attached to a subpart or material.
Substance Composition - The Substances table can contain only substance groups and substances.
Part Composition - You can't add rows to the Substances table.
Specifications that you reference in a row in the Compositions table must match the Composition Type attribute for that row. For example, if the Composition Type for the row is Homogeneous Material Composition, the validation type for a specification referenced in that row must be Homogeneous Material Level.
The following example shows how to define a Homogeneous Material composition for a manufacturer part. The Substances table has four levels: subparts, materials, substance groups, and substances.
Example 20-19 Adding specifications, compositions, and substances to Manufacturer Part TOHERE
public void addMfrPartSubs(IAgileSession m_session) throws APIException { // Create a Manufacturer Part try { HashMap params = new HashMap(); params.put(ManufacturerPartConstants. ATT_GENERAL_INFO_MANUFACTURER_PART_NUMBER,"Widget"); params.put(ManufacturerPartConstants. ATT_GENERAL_INFO_MANUFACTURER_NAME, "ACME"); IManufacturerPart mfrPart = (IManufacturerPart) m_session.createObject (ManufacturerPartConstants.CLASS_MANUFACTURER_PART, params); // Add a Specification to the Specifications table ITable tblSpec = mfrPart.getTable(ManufacturerPartConstants.TABLE_SPECIFICATIONS); ISpecification spec = (ISpecification)m_session.getObject(ISpecification.OBJECT_TYPE,"Lead Spec"); // Add Spec IRow rowSpec = tblSpec.createRow(spec); // Get the Compositions table and Set as Homogeneous Material Level ITable tblComp = mfrPart.getTable(ManufacturerPartConstants.TABLE_COMPOSITIONS); // Add a row to the Compositions table that references the specification params.clear(); params.put(ManufacturerPartConstants. ATT_COMPOSITIONS_SPECIFICATION, spec.getName()); params.put(ManufacturerPartConstants. ATT_COMPOSITIONS_COMPOSITION_TYPE, "Homogeneous Material Composition"); IRow rowComp = tblComp.createRow(params); // Get the Substances table ITable tblSubs = mfrPart.getTable(ManufacturerPartConstants.TABLE_SUBSTANCES); // Add a subpart ISubstance subpart = (ISubstance)m_session. getObject(SubstanceConstants.CLASS_SUBPART, "Steel Casing"); params.clear(); params.put(ManufacturerPartConstants.ATT_PARENT_ROW, rowComp); params.put(ManufacturerPartConstants. ATT_SUBSTANCES_SUBSTANCE_NAME, subpart); IRow rowSubpart = tblSubs.createRow(params); // Add a material ISubstance material = (ISubstance)m_session.getObject (SubstanceConstants.CLASS_MATERIAL, "Steel"); params.clear(); params.put(ManufacturerPartConstants.ATT_PARENT_ROW, rowSubpart); params.put(ManufacturerPartConstants. ATT_SUBSTANCES_SUBSTANCE_NAME, material); IRow rowMaterial = tblSubs.createRow(params); // Add a substance group ISubstance sg = (ISubstance)m_session. getObject(SubstanceConstants.CLASS_SUBSTANCE_GROUP, "Lead Compounds"); params.clear(); params.put(ManufacturerPartConstants.ATT_PARENT_ROW, rowMaterial); params.put(ManufacturerPartConstants.ATT_SUBSTANCES_SUBSTANCE_NAME, sg); IRow rowSubGroup = tblSubs.createRow(params); // Add a substance ISubstance sub = (ISubstance)m_session. getObject(SubstanceConstants.CLASS_SUBSTANCE,"Lead"); params.clear(); params.put(ManufacturerPartConstants.ATT_PARENT_ROW, rowSubGroup); params.put(ManufacturerPartConstants.ATT_SUBSTANCES_SUBSTANCE_NAME, sub); IRow rowSubs = tblSubs.createRow(params); } catch (APIException ex) { System.out.println(ex); }}
After gathering compliance data for items, manufacturer parts, and part groups, compliance managers review the completed declarations to determine if the data is ready for publication into the product record. Once declarations are published with the data written through to parts and part groups on BOMs, compliance managers must examine and test BOMs to ensure the assemblies and products are compliant. This process is called compliance validation and is fulfilled through compliance rollups. Rollups are built into the system. They are easy to use and rollup results are available on the UI. For more information on rolling up compliance data and the business logic behind this process, refer to the Agile Product Governance & Compliance User Guide.
The SDK supports calling the PG&C Rollup function on the server side. This is the same rollup function that is called by the UI. The IPGCRollup interface supports this feature.
The IPGCRollup interface provides the following methods to support rolling up compliance data:
rollup()
rollup(Date)
One of these methods has no parameters and the other has Date as a parameter. The Date parameter in the rollup API is used by the system to set the timestamp for the rollup, when it is done.
Example 20-20 IPGCRollup methods
public interface IPGCRollup { public void rollup() throws APIException; public void rollup(Date rollupDate) throws APIException;}
Note: After invoking rollup(Date), it is necessary to call IDataObject.refresh() to make sure the rollup function has taken effect. Otherwise, the system will display the results obtained in the previous rollup if the timestamp of the recent rollup is the same as the Date parameter. |
If you do not pass the date, the system will use the current time provided by the system. When a rollup is performed on a set of items, if the timestamp of the recent rollup on an item is the same as the passed Date parameter, the system will not repeat the rollup process on that item. Instead, it will display the results obtained in the previous rollup. You may want to use this date feature if there is a large number of items to rollup and you want to use the SDK to call all of them. In this case, you will get the current date first, and then the pass that date for the subsequent SDK Rollup(Date) call. For example, you want to use the SDK to roll up data for Assembly 1 and Assembly 2. In this case, the SDK is called twice. The first instance, to roll up data for Assembly 1, and the second instance, to rollup data for Assembly 2. With the date parameter already inside the rollup when performing the rollup on Assembly 2, the system will reuse the previous rollup data obtained for Item1.
Assembly 1 Item1 Iitem2 Assembly 2 Item1 Item3
The following examples roll up the assembled data on Items and Manufacturer Parts:
Item (latest released ECO or MCO)
MPN (latest released ECO or MCO)
This example calls an API using the SDK to identify the top level parent of a given Item (its latest released ECO or MCO). Next, it will call the rollup API on the top level parent returned by the previous API to ensure the assemblies and products are compliant.
Example 20-21 Identifying the top level parent for an Item
public void itemRollup(String itemStr) throws Exception{ try { IItem item =(IItem)m_session.getObject(IItem.OBJECT_TYPE, itemStr); IQuery query = (IQuery)m_session.createObject (IQuery.OBJECT_TYPE, ItemConstants.CLASS_ITEM_BASE_CLASS); //IQuery query = (IQuery) m_session.createObject(IQuery.OBJECT_TYPE, ItemConstants.CLASS_PART); query.setSearchType(QueryConstants.WHERE_USED_TOP_LEVEL); query.setCriteria("[1001] Equal To '"+item.getName()+"'"); // query.setCriteria("["+SDKWrapper.getString("TITLE_BLOCK") +"."+SDKWrapper .getString("IQuery_Number")+"] Equal To '"+item.getName()+"'"); ITable results=query.execute(); if (results.size() > 0) { Iterator it = results.getReferentIterator(); if (it.hasNext()) { IItem obj = (IItem)it.next(); IItem tlaItem = (IItem)m_session.getObject (IItem.OBJECT_TYPE, obj.getName()); tlaItem.rollup(); } } else { item.rollup(); } } catch (APIException e) { throw e; } return;}
This example calls an API using the SDK to identify the top level parent of a given MPN (its latest released ECO or MCO). Next, it will call the rollup API on the top level parent returned by the previous API to ensure the assemblies and products are compliant.
public void testMfrPartRollup() throws Exception { IManufacturerPart mfrp =(IManufacturerPart) m_session. getObject(IManufacturerPart.OBJECT_TYPE, "HARRIS::IS82C55A96"); ITable whereused = mfrp.getTable(ManufacturerPartConstants.TABLE_WHEREUSED); Iterator it = whereused.iterator(); while(it.hasNext()) { IRow r = (IRow)it.next(); // read item number String itemStr = r.getValue(ManufacturerPartConstants. ATT_WHERE_USED_ITEM_NUMBER).toString(); try { itemRollup(itemStr); } catch (APIException e) { int error =((Integer)e.getErrorCode()).intValue(); }} return;}
Use the following API to set the value of the Calculated Compliance field on the Specifications table of Item and ManufacturerPart objects:
Public void setCalculatedComplianceForPartSpec(Object specName, Object complianceEntryValue) throws APIException
In this API, the specName parameter is the name of the Specification object, and the complianceEntryValue parameter is the actual value of the Calculated Compliance field, which can be any entry in the Calculated Compliance list. Both parameters are of type String.
When this value is set by the SDK Client, it is never overwritten during the Rollup. This API allows users to set the calculated compliance value based on their own defined logic, instead of using the system's default logic.
Example 20-23 Setting the value of the Calculated Compliance field for Item objects
// COMPLIANT is the actual value of the Calculated Compliance field which shows // the Specification is compliant or not, based on the customized calculated // compliance result. String COMPLIANT = "Compliant"; // spec_num is the Specification Name in Item object's Specification Table String spec_num = row.getValue (ItemConstants.ATT_SPECIFICATIONS_SPECIFICATION).toString(); item.setCalculatedComplianceForPartSpec(spec_num, COMPLIANT);
This is similar to the previous API that enabled setting the Calculated Compliance field for Item objects. You can use this API to set the value of the Calculated Compliance field in Item table and Manufacturer Part table for Declaration objects.
Public void setCalculatedComplianceForMDOPartSpec (Object partName, Object partClassName, Object changeNumber, Object specName, Object complianceEntryValue)) throws APIException
The system recognizes that the SDK Client has set this value and will use the new setting in the subsequent response during Rollup. In this API, the parameter changeNumber is optional. When the Declaration object has only one revision of an item, you can set the value of changeNumber to null. If the Declaration object has more than one revision of an item, you must set the value of changeNumber for the proper execution of the API.
Similar to the previous API, when this value is set by the SDK Client, it is never overwritten during the Rollup within the declaration. This API allows users to set the calculated compliance value based on their own defined logic, instead of using the system's default logic.
Note: If the SDK developer intends to pass the changeNumber field to setCalculatedComplianceForDeclarationPartSpec(), the developer must have the Discover Change privilege mask to make this change. |
Example 20-24 Setting values for Calculated Compliance field of Declaration objects
// complianceValue -- This is the customized calculated compliance value and shows if the part is compliant to a Spec String ComplianceValue = "Compliant"; // partName is the Item/Mfr Part name in Declaration's Item/MfrPart table. If it is a mfr part, it should be like ”MfrName::MfrPartName” String partName =”P00001”; String partClassName = ”Parts”; // If the added part in Declaration is an Item, the changeName should be the // Change number corresponding to the Item's revision.// If the added part in Declaration is a Mfr Part, the changeName should be ”null” String changeName = ”C00001”; // spec_num is the Specification Name in Declaration object's Specification Table String specName = ”Rohs”; Declaration.setCalculatedComplianceForDeclarationPartSpec (partName, partClassName, changeName, specName, complianceValue);
The SDK supports this Compliance by exposing the setCalculateOverallCompliance API.
public void setCalculateOverallCompliance () throws APIException;
The following examples use this API to set values the Overall Compliance field of an Item and a Manufacture Part.
Example 20-25 Setting values for Calculated Overall Compliance field of an Item object
Private static void test_OverallComplianceofItem (IAgileSession session) { Try { // Load an existing Item. IItem item = (IItem) session.getObject (ItemConstants.CLASS_PART, "P00007"); item. SetCalculateOverallCompliance (); } catch (APIException e) { e.printStackTrace (); }}
Example 20-26 Setting values for Calculated Overall Compliance field of Manufacture Part objects
private static void test_OverallComplianceOfMfrpart(IAgileSession session) { HashMap params = new HashMap(); params.put(ManufacturerPartConstants. ATT_GENERAL_INFO_MANUFACTURER_PART_NUMBER, "mfrpart001"); params.put(ManufacturerPartConstants. ATT_GENERAL_INFO_MANUFACTURER_NAME, "ACT"); try { IManufacturerPart mfrPart = (IManufacturerPart) session.getObject (ManufacturerPartConstants.CLASS_MANUFACTURER_PART, params); mfrPart.setCalculateOverallCompliance(); } catch (APIException e) { e.printStackTrace(); }}
The SDK supports modifying the value of this Calculated Compliance field by exposing the following API:
public void setCalculatedComplianceForPartSpec (Object specName, Object calComplianceEntryValue,boolean can_bemodified) throws APIException;
The following examples use this API to set values the Calculated Compliance field of an Item, Manufacturer Part, and Commodity,
Example 20-27 Modifying Calculated Compliance fields in specification table of Items
private static void test_set_calculated_compliance_For_Item(IAgileSession session) { IItem item; try { item = (IItem)session.getObject(ItemConstants.CLASS_PART,"P00007"); item.setCalculatedComplianceForPartSpec("WEEE", "Non-Compliant",true); } catch (APIException e) { e.printStackTrace(); } try { item = (IItem)session.getObject(ItemConstants.CLASS_PART,"P00007"); item.setCalculatedComplianceForPartSpec("WEEE", "Non-Compliant",true); } catch (APIException e) { e.printStackTrace(); try { item = (IItem)session.getObject(ItemConstants.CLASS_PART,"P00007"); item.setCalculatedComplianceForPartSpec("WEEE", "Non-Compliant",true); } catch (APIException e) { e.printStackTrace(); }
Example 20-28 Modifying the Calculated Compliance field of specification tables of Commodities
private static void test_set_calculated_compliance_For_Commotidy(IAgileSession session){ try { ICommodity commodity; commodity = (ICommodity)session.getObject(ICommodity.OBJECT_TYPE, "Commodity1"); commodity.setCalculatedComplianceForPartSpec ("WEEE", "Non-Compliant",true); } catch (APIException e) { e.printStackTrace(); }}
Scheduled rollups, as the name implies, are run according to a schedule and Declarations are objects that enable Agile customers gather compliance information. These rollups use a server-based task that initiates a search for the set of objects that need rollup at the scheduled time. These objects are identified by a flag called need rollup. Once found, rollup is performed on these objects and their status is updated. The SDK exposes the setNeedRollupForDeclaration API to set (modify) the Need Rollup attribute to True or False.
Example 20-29 Modifying settings in the Need Rollup Flag
public void setNeedRollupForDeclaration(boolean complianceEntryValue) throws APIException IDeclaration subdeclaration = (IDeclaration) session.getObject (DeclarationConstants.CLASS_SUBSTANCE_DECLARATION,"SD1");subdeclaration.setNeedRollupForDeclaration (false);
PG&C's Specification objects have a cover page attribute called the Rollup Engine. This attribute enables PG&C users to perform only External Compliance Rollups on Specification objects and avoid Internal Compliance Rollups. The Rollup Engine is linked to an 'Internal/External' switch that enables identifying Specification objects requiring a Rollup. For example, if the attribute is set to External, the Rollup Engine ignores performing the Rollup on the Specification and if it is set to Internal, the Internal Rollup Engine performs the Rollup. This new attribute can link Specification, Declaration, Item, Manufacturer Part, and Part Group objects. The following IExternalRollupManager.java interface enables performing external rollups with SDK. The related APIs included in this interface are listed below.
This API invokes an external Rollup against a specific Object (item, mfrpart, part group) Int triggerExtractRollupDataforObject(Object partName, Object partClassName, Object changeNumber) throws APIException;
Code Sample: String objnumber="P00010";String objclass="Parts";int job_id=externalrollupManager. triggerExtractRollupDataforObject (objnumber, objclass, null);
This API triggers the external rollup engine to perform the required external rollup Integer [] triggerExternalRollup(int jobID) throws APIException;
Code Sample Integer[] extract_id=externalrollupManager.triggerExternalRollup (jobid);
This API gets the Composition of the Object which is passed as parameters in Integer [] triggerExternalRollup(int jobID) throws APIException;
IVOExternalComposition getObjectComposition (int extract_id) throws APIException;
Codes Sample IVOExternalComposition objectcomposition=(IVOExternalComposition)externalrollupManager.getObjectComposition(extractid);
This API actives the composition row placed in the archived Table by the IRow AppendUpdateRow (Object partName, Object partClassName, Object changeNumber, Object siteNumber, IVOExternalComposition externalComposition) throws APIException; API. Void activeComposition (Object partName, Object partClassName, Object changeNumber, int compositionId) throws APIException;
Code Sample String objnumber="P00010";String objclass="Parts";Int row_id=row. getRowId ();ArrayList list=new ArrayList();list.add(row_id);externalrollupManager.activeComposition(objnumber, objclass, change_number, list);
This API deletes records in the Fact_table that were generated by the Int triggerExtractRollupDataforObject(Object partName, Object partClassName, Object changeNumber) throws APIException; API Code Sample boolean flag=externalrollupManager.deleteExtractData(jobid);
To update the value of the calculated compliance attribute against an external specification, use the updatePartRollupResult API in IExternalRollupManager interface.
boolean updatePartRollupResult(String objectnumber,String objectclassname,String changenumber, int spec ID,int calculatedCompliance, Date rolluptime) throws APIException;
Description of Data Fields
specID |
External specification ID |
calculatedCompliance |
Calculated compliance value |
rolluptime |
Rollup time |
The IRollupRegulationFactory interface uses the following API to create external or internal specifications.
public ISpecification createRegulationwithNameRollupEngine (String subclasstypename,String regulation_name, boolean isexternalengine) throws APIException;
Agile SDK supports modifying values in the Calculated Compliance Field of Part Group, Item Composition, Manufacturer Part Composition, and Part Group Composition Objects by exposing the following API.
public void setCalculatedComplianceForDeclarationPartSpecSubstance (Object part_number, Object part_type, Object change_number, Object spec, Object substance, Object complianceEntryValue) throws APIException;
These examples use this API to set values the Calculated Compliance field for Item Composition, Manufacturer Part Composition, and Part Group Composition Objects by exposing the following APIs.
Example 20-32 Modifying Values in Item Composition Table
private static void TestItemSetValue(IAgileSession session2) throws APIException { IDeclaration dec = IDeclaration)session.getObject (DeclarationConstants.CLASS_SUBSTANCE_DECLARATIONS_CLASS, "MD00009"); dec.setCalculatedComplianceForDeclarationPartSpecSubstance ("P00001","Parts", "", "SPEC01", "1,4-BUTANOLIDE", "Non-Compliant"); }
Example 20-33 Modifying Values in Manufacturer Part Composition Table
private static void TestMfrpartSetValue(IAgileSession session2) throws APIException { IDeclaration dec =(IDeclaration)session.getObject (DeclarationConstants.CLASS_SUBSTANCE_DECLARATIONS_CLASS, "MD00009"); dec.setCalculatedComplianceForDeclarationPartSpecSubstance ("AMP::12345","Manufacturer parts", null, "", null, "Non-Compliant"); }
Example 20-34 Modifying Values in Part Group Composition Table
private static void TestPartFamliySetValue(IAgileSession session) throws APIException { IDeclaration dec = (IDeclaration)session.getObject (DeclarationConstants.CLASS_SUBSTANCE_DECLARATIONS_CLASS, "MD00009"); dec.setCalculatedComplianceForDeclarationPartSpecSubstance ("CAP","Part groups", "", "WEEE", "AL", "Missing Info");}