I think I know what’s happening here. We had the exact same issue after upgrading to 9.3.4. The problem is a combination of PX script error handling gaps and how the API validates attribute types now.
First, let’s address the PX script error handling. You need to add proper null checks and validation before attempting attribute assignment:
if (attributeValue != null && attributeId != null) {
IAttribute attr = newItem.getAttributes().get(attributeId);
if (attr != null && attr.isModifiable()) {
newItem.setValue(attributeId, attributeValue);
}
}
Second, the attribute mapping validation changed in 9.3.4. The API now validates that the attribute data type matches exactly. If you’re passing a String when the attribute expects an Integer or Date, you’ll get NPE instead of a type conversion error. Check your attribute definitions in the admin console under Data Settings > Attributes and verify the data type.
Third, item subtype configuration matters more now. Oracle added a validation layer that checks if attributes are properly initialized for the subtype before allowing setValue(). If your subtype has a complex inheritance chain or uses attribute groups, you need to ensure the parent classes are properly configured.
Here’s a more robust approach:
// Pseudocode - Key implementation steps:
1. Create item object with proper subtype initialization
2. Validate attribute exists and is modifiable for this subtype
3. Check attribute data type matches value being set
4. Wrap setValue() in try-catch with specific exception handling
5. Add logging to capture attribute state before assignment
6. Verify all required attributes are set before save()
// See Agile PLM SDK Guide Section 6.3 for attribute validation
The difference between test and production is likely due to different privilege sets or attribute configurations. Export your test environment’s class configuration and compare it with production. Look for differences in attribute properties like ‘Required’, ‘Enabled’, or ‘Visible’ settings.
Also enable debug logging in your PX script to capture the actual attribute values and types at runtime. Add this before your setValue() call:
logger.debug("Setting attribute: " + attributeId +
" with value: " + attributeValue +
" of type: " + attributeValue.getClass().getName());
This will help you identify if the issue is with the value itself or the attribute configuration. In 9.3.4, Oracle also changed how custom attributes handle null values - they’re more strict now. If your workflow allows null values in test but production has stricter validation rules, that would explain the difference.
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.