Create the Data Processor Method

The example described in this section relegates the bulk of the Query Processing logic to a separate DLL which is linked with the Aras Innovator Server. This separation of code is not necessary, but because of the amount of software that may apply to custom query processing this method of implementation is easier to manage. The actual Data Processor Method therefore is much smaller and is used mostly to validate input and make the necessary calls into the custom DLL in this case.

Note
It is recommended to make methods OS agnostic for use with Linux and Windows. The main incompatibility issues in operating systems that need to be considered when implementing the method are path case-sensitivity, path separators, OS-specific line-endings, OS-specific code. For more information about cross-platform development, see section 2.3 Cross-platform development in the Aras Innovator 31 - Programmer’s Guide.

The following is an example of the CustomQPProcessor Method, which is used to execute the Default Query Definition, pass the results to a custom DLL for processing, and generate the view data used for the 3D Viewer – Product Occurrences. The example is described here:

  1. This initial comment must be the first line in the Method. It is used to identify the Method template to be used.
  2. TheEventArgs object is passed into, and available, to this Method. This object contains The Query Definition ID, ID of the Item being viewed, the Query Definition Parameters map, and will contain the results created by the Query Processor.
  3. Retrieves the Aras Innovator connection.
  4. Retrieves the Query Definition Helper used for this Query Processor.
  5. Retrieves the Query Definition Item.
  6. Execute the Query Definition using the given Item ID and the query parameters used.
  7. This example includes a custom DLL used for the query processing logic, with the main class – CustomDefaultQP.DefaultQueryResultsParser. This software, explained below, is used to parse the query results, and construct the response used to populate the 3D Dynamic/Streaming Viewer.
  8. The results of the processing – Product Occurrence List – is constructed by the custom DLL and stored in the QueryProcessingResults Object which is then returned to the EventArgs Object passed into the Method (see Help files for API documentation).