I have a Java service which take a record referece list as input parameter. When I use code generation, it generate IData for this parameter instead of IData. The sample is like this:
The input parameter is called Company which is a Record Reference List using a defined record named CompanyRec. ComapnyRec contains id and rating, both represented as String.
Here is the generated code:
IDataCursor pipelineCursor = pipeline.getCursor();
IData company = IDataUtil.getIData( pipelineCursor, “company” );
if ( company != null)
IDataCursor companyCursor = company.getCursor();
String company_1 = IDataUtil.getString companyCursor, “company” );
String rating = IDataUtil.getString( companyCursor, “rating” );
When I test, company is always null even though I have input values.
Then I modify the program as follows:
IData com = IDataUtil.getIDataArray( pipelineCursor, “comany” );
System.out.println("com is " + com);
if ( com != null)
for ( int i = 0; i < com.length; i++ )
IDataCursor comCursor = com[i].getCursor();
String company = IDataUtil.getString( comCursor, “company” );
String rating = IDataUtil.getString( comCursor, “rating” );
System.out.println("company is " + company + ", rating is " + rating);
Now it runs correctly.
I tried using Record List as input parameter, code generation does generate correct code like the above. Therefore, I think this seems to be a bug in code generation for Record Reference List type of parameter. Does anyone experience similar problem?