ClassCastException While Loading Approver As IDataObject From Workflow Table

(Doc ID 2313757.1)

Last updated on OCTOBER 03, 2017

Applies to:

Oracle Agile PLM Framework - Version 9.3.6.0 and later
Information in this document applies to any platform.

Goal

When trying to load Approvers at Review Status of an ECO getting ClassCastException as below.
  java.lang.ClassCastException: com.agile.api.pc.CascadeList cannot be cast to com.agile.api.IDataObject

Customer'a sample code to fetch approver:

IChange change=(IChange)session.getObject(IChange.OBJECT_TYPE,"Change Number");
ITable changeWorkflowTable = change.getTable(ChangeConstants.TABLE_WORKFLOW);
Iterator<Object> chgWflwTableIterator = changeWorkflowTable.iterator();
while (chgWflwTableIterator.hasNext()) {
IRow chgWflwRow = (IRow)chgWflwTableIterator.next();
ICell currentStatusICell = chgWflwRow.getCell(ChangeConstants.ATT_WORKFLOW_WORKFLOW_STATUS);
String currentStatusStr = currentStatusICell.getValue().toString().trim();
ICell statusCodeICell = chgWflwRow.getCell(ChangeConstants.ATT_WORKFLOW_STATUS_CODE);
String statusCodeStr = statusCodeICell.getValue().toString().trim();

if (statusCodeStr.equalsIgnoreCase("Current Process")
|| statusCodeStr.equalsIgnoreCase("Process is moved forward")
|| statusCodeStr.equalsIgnoreCase("Process is moved backward")) {
if (currentStatusStr.equalsIgnoreCase("Review Status Name")) {
IDataObject approver=(IDataObject)chgWflwRow.getValue(ChangeConstants.ATT_WORKFLOW_REVIEWER);
System.out.println("approver"+approver);
}
}
}

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms