Here’s the complete solution addressing all three focus areas - PX script logic, SDK API usage, and compliance audit requirements.
PX Script Revision Logic Fix:
Your current code creates the SBOM but doesn’t initialize it as a revisioned object. You need to use the IRevisionControlled interface after object creation:
IItem sbomItem = (IItem)session.createObject("SBOM");
sbomItem.setValue(ItemConstants.ATT_TITLE_BLOCK_NUMBER, sbomNumber);
sbomItem.setValue(ItemConstants.ATT_TITLE_BLOCK_DESCRIPTION, description);
// Initialize as first revision
IRevisionControlled revControl = (IRevisionControlled)sbomItem;
revControl.setRevision("A");
Agile SDK API Usage:
The critical step is properly casting to IRevisionControlled and setting the initial revision before save(). In Agile 9.3.4, the SDK requires explicit revision initialization for programmatically created items. Additionally, ensure your session has appropriate privileges - use session.setUserContext() if needed to match the privilege level of manual SBOM creation.
For bulk operations, wrap your import logic in proper transaction handling:
- Use session.beginTransaction() before the loop
- Call setRevision() for each SBOM immediately after setValue() calls
- Commit in batches of 50-100 items to maintain performance
- Implement rollback logic for failed items
SBOM Compliance Audit Resolution:
For the 1,200 existing SBOMs without revision history:
-
Immediate Fix: Create a remediation script that iterates through affected SBOMs and properly initializes their revision records. You’ll need to use the Agile SDK to update the REVTABLE entries directly or use the revision API to “re-establish” them as Rev A with proper audit trail timestamps.
-
Validation Layer: Implement post-import verification that queries each SBOM’s revision history immediately after creation:
IRevision[] revisions = sbomItem.getRevisions();
if (revisions == null || revisions.length == 0) {
// Log error and rollback
}
-
Audit Trail Reconstruction: For compliance purposes, you may need to work with Oracle Support to properly backdate the revision creation timestamps to match the original import dates. Document this remediation in your audit trail as a corrective action.
-
Future Prevention: Add revision validation to your PX script framework as a mandatory check. Consider implementing a custom workflow that automatically verifies revision initialization for all SBOM imports.
The key takeaway is that PX scripts bypass normal Agile business logic, so revision management must be explicitly coded. Always test bulk import scripts on a small dataset first and verify database table entries (NODETABLE, REVTABLE, HISTORYTABLE) before running production imports. For compliance-critical objects like SBOMs, consider adding automated validation that checks revision history completeness as part of your import process.
If you need to remediate the existing 1,200 SBOMs, I recommend engaging Oracle Support to ensure the revision history reconstruction maintains audit trail integrity for regulatory compliance.
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.