SDK integration fails to sync custom attributes for new parts via JavaClient

We’re implementing a custom part class synchronization using Agile SDK 9.3.4 and encountering attribute mapping failures. When creating new parts via JavaClient, standard attributes sync correctly but custom attributes (CUSTOM_TEXT01, CUSTOM_DATE02) remain empty despite being populated in our source system.

Our SDK code initializes the part object and sets attributes:

IItem part = (IItem) session.createObject(ItemConstants.CLASS_PART, "P-NEW");
part.setValue(ItemConstants.ATT_TITLE_BLOCK.DESCRIPTION, desc);
part.setValue("CUSTOM_TEXT01", customValue);

Schema validation passes but custom fields don’t persist. The integration runs without exceptions, yet database queries show NULL values for custom attributes. Has anyone resolved similar SDK attribute mapping issues or JavaClient customization challenges?

I’ll provide a complete solution addressing all three focus areas - SDK attribute mapping, JavaClient customization, and schema validation.

SDK Attribute Mapping Fix: The core issue is improper attribute referencing. Custom attributes must be accessed through the class definition, not string literals. Here’s the corrected approach:

IAgileClass partClass = session.getAdminInstance().getAgileClass(ItemConstants.CLASS_PART);
IAttribute customAttr = partClass.getAttribute("CUSTOM_TEXT01");
IItem part = (IItem) session.createObject(ItemConstants.CLASS_PART, "P-NEW");
part.setValue(customAttr, customValue);
part.setValue(partClass.getAttribute("CUSTOM_DATE02"), dateValue);

JavaClient Customization: Verify your custom attributes are properly configured:

  1. In Java Client Admin, navigate to Data Settings → Classes & Attributes
  2. Select your Part subclass and confirm CUSTOM_TEXT01/CUSTOM_DATE02 are visible and enabled
  3. Check that attribute API IDs match exactly (case-sensitive)
  4. Ensure the integration user role has Read/Write access to these attributes in User Settings → Roles & Privileges

Schema Validation: Implement proper validation before setting values:

if (customAttr != null && !customAttr.isReadOnly()) {
    part.setValue(customAttr, customValue);
} else {
    throw new APIException("Attribute not writable or undefined");
}

Additional Considerations:

  • Clear SDK session cache: session.refresh() after schema changes
  • Use part.getValues() immediately after creation to verify attribute persistence
  • Enable SDK logging (agile.properties: log4j.logger.com.agile=DEBUG) to trace attribute setting operations
  • For batch operations, commit transactions explicitly with `session.commit() The combination of proper attribute object retrieval, JavaClient configuration verification, and validation checks should resolve your custom attribute synchronization issues. Test with a single part creation first before scaling to bulk operations.

This draft is based on general Oracle Agile PLM knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

I’ve seen this before with custom attribute synchronization. The issue is often that custom attributes need explicit class mapping configuration in Agile. Check if your part class has the custom attributes properly defined in Java Client Admin under the specific subclass you’re targeting. SDK won’t automatically map custom fields without proper schema registration.

Adding to Sara’s point - when using SDK for custom attributes, you need to retrieve the attribute object first rather than using string literals. Try using session.getAgileClass() to get the class definition, then access custom attributes through the proper API constants. Also verify that your SDK user has write permissions to those custom fields in the part class. The fact that standard attributes work suggests a permission or mapping configuration gap specific to custom fields.

Thanks both. I checked Java Client Admin and the custom attributes are defined on the part subclass. Permissions look correct - our integration user has full access. Could this be related to how we’re referencing the custom attribute IDs in the SDK code? Should we be using API IDs instead of database column names?

“Confirmed this resolves the attribute sync issue — using partClass.getAttribute() instead of string literals in our JavaClient integration immediately fixed custom attribute mapping for new parts.”

Yes, that’s likely your issue. Custom attributes in Agile SDK require using the API ID, not the database column name. You need to reference them through the attribute constants or by retrieving the IAttribute object. The SDK doesn’t recognize direct string references like “CUSTOM_TEXT01” for custom fields. Use the getAttributes() method on your class object to get the proper attribute reference, then setValue() on that. This is a common gotcha in SDK customization work.

Also worth checking your Agile PLM schema cache. Sometimes after adding or modifying custom attributes, the SDK session cache needs refresh. Try calling session.refresh() or restart your integration service to ensure the SDK is working with the latest schema definition. We had similar NULL value issues that resolved after proper cache invalidation.

We had similar NULL value issues that resolved after proper cache invalidation.