3D PLM Enterprise Architecture |
VPM Navigator |
Search Result APIAPI to fill Search Result Window |
Use Case |
AbstractThis article shows the way to execute a query on several objects and to display the search result window fulfilled with the results using the API to fill Search Result Window and explains how to use it in a command. |
This use case is intended to explain how to use the Search Result API to develop a new command to query for multiple objects and to display the search result window fulfilled with the results. Use of this API is demonstrated by means of a Search API Test command. This command is available from the Search workbench in the Seach API Test toolbar.
[Top]
The Search API Test command is a use case of the CAACATImmENOVIAProvider.edu framework that illustrates Search Result API capabilities.
[Top]
CAAImmSearchAPITestCmd is a command which uses the Identifier Acquisition Agent to get the VPM Identification information and passes this information to the OpenSearchResultWindow function. This function opens a new search result window and fulfills it with the result of the query.
[Top]
To launch CAAImmSearchAPITestCmd, you will need to set up the build time environment, then compile CAAImmSearchAPITestCmd along with its prerequisites, set up the run time environment, and then execute the use case [1] in the following way:
[Top]
The Search API Test command is made up of a single class named CAAImmSearchAPITestCmd located in the CAAImmSearchAPITestCmd.m module of the CAACATImmENOVIAProvider.edu framework :
Windows | InstallRootDirectory\CAACATImmENOVIAProvider.edu\CAAImmSearchAPITestCmd.m\ |
Unix | InstallRootDirectory/CAACATImmENOVIAProvider.edu/CAAImmSearchAPITestCmd.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
The following code illustrates how to call the SearchResult API:
[Top]
The Search API Test command derives from CATStateCommand.
class CAAImmSearchAPITestCmd: public CATStateCommand { ... public: void BuildGraph(); void ActionCommand(); ... |
We make the call to the Search Result API in the ActionCommand()
of the Test Command.
[Top]
The OpenSearchResultWindow
is called in command ActionCommand
method.
The arguments to be passed to the API have to be populated as shown below.
void CAAImmSearchAPITestCmd::ActionCommand() { ... CATUnicodeString iType = "DOCDIR/ENOVIA_VPMDocumentRevision"; int iNb = 4; CATListOfCATUnicodeString iAttrNameList; CATListOfCATUnicodeString iArrayValueList[4]; iAttrNameList.Append("V_ID"); iAttrNameList.Append("V_version"); iArrayValueList[0].Append("DocumentRevision_ID1"); //Used "DR_RZW_23Apr" iArrayValueList[0].Append("DocumentRevision_Version1"); //Used "---" iArrayValueList[1].Append("DocumentRevision_ID2"); //Used "DR_RZW_26Apr" iArrayValueList[1].Append("DocumentRevision_Version2"); //Used "---" iArrayValueList[2].Append("DocumentRevision_ID3"); //Used "Part1_RZW_23Apr" iArrayValueList[2].Append("DocumentRevision_Version3"); //Used "---" iArrayValueList[3].Append("DocumentRevision_ID4"); //Used "Part1_RZW_24Apr" iArrayValueList[3].Append("DocumentRevision_Version4"); //Used "---" HRESULT RC = CATImmCAAServices::OpenSearchResultWindow(iType,iAttrNameList,iNb,iArrayValueList); ... |
The above code snippet will search for four entities of type DOCDIR/ENOVIA_VPMDocumentRevision
based on the attributes V_ID and V_Version and display the results in a new result window. Different types and
attributes can be used to create a query.
[Top]
In case the Search Result API fails to find any objects based on our query, the following error message is shown.
[Top]
This use case shows usage of the Search Result API and the way to create a query and use that query to fill the Search Result window.
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [May 2007] | Document created |
Version: 2 [July 2007] | Document modified |
[Top] |
Copyright © 2007, Dassault Systèmes. All rights reserved.