Kalyan and I worked on this issue off the forum and I'm updating this post for the future reference of Teamcenter Connector developers who may run into this or a similar issue. Here's what we found:
To successfully execute Teamcenter Connector’s ExecuteSavedQueries Java action, the User Entry Name of the attribute of a saved query (in Teamcenter) should match the name of the attribute of the search criteria input entity (in Mendix). The exception to this is when the User Entry Name has a space, replace it with an underscore while naming the attribute of the search criteria input entity on the Mendix side. Teamcenter Connector has some internal mapping where it automatically takes care of replacing this underscore back to a space before executing the saved query in Teamcenter.
I have executed some simple saved queries through Teamcenter Connector’s ExecuteSavedQueries Java action. The ones that I have experimented with are more or less similar to the Teamcenter out-of-the-box “Item Revision...” saved query. Discalimer: I have tried with Teamcenter 12.3, TcConnector 3.1 and Mendix Studio Pro 8.14.1.
If you are also making use of the ExecuteSavedQueries Java action, please double check the key input fields for it.
Input Data – should be set to a search criteria entity with its attributes having values that you want to search for.
Business Object Mappings – should be the mapping of Teamcenter business object names to Mendix entity names.
In our case, we have a custom property called “Asset ID” on the Issue Report Revision object. Our intention is to query for these Issue Report Revision objects when the input search value matches with the “Asset ID” value. For this purpose, e have defined a custom saved query. Now, on the Mendix side, I have defined two entities. One for the IssueReportRevision and the other for IssueRevSearchCriteria. The question here is that the IssueReportRevision object is not a direct child of ItemRevision object. It has more than one level of hierarchy of parents. In that case, I assumed that I have to define the entities in the domain model, for all its parent structure up to the ItemRevision?
I tried that way but it did not work. Below is my domain model for the IssueReportRevision
In the microflow, this is how I was calling the saved query with the mappings:
In the above snapshot, the query name and the business object are exactly defined as we have it in Teamcenter.
Please let me know if I am missing something here.