Executes the SQLPathExpression previously created with the cniSqlCreateReadOnlyPathExpression or the cniSqlCreateModifiablePathExpression utility functions, as defined by the sqlPathExpression argument.
CciElement* cniSqlNavigatePath( int* returnCode, CciSqlPathExpression* sqlPathExpression, CciMessage* inputMessageRoot, CciMessage* inputLocalEnvironment, CciMessage* inputExceptionList, CciMessage* outputMessageRoot CciMessage* outputLocalEnvironment, CciMessage* outputExceptionList);
The following table shows the mapping between the correlation names accepted in the ESQL path expression and the data that is accessed.
Correlation name | Data accessed |
---|---|
Environment | The single Environment tree for the flow. This element is determined by the broker and it is not necessary to specify it with this API. |
InputLocalEnvironment | inputLocalEnvironment parameter to cniSqlNavigatePath |
OutputLocalEnvironment | outputLocalEnvironment parameter to cniSqlNavigatePath |
InputRoot | inputMessageRoot parameter to cniSqlNavigatePath |
InputBody | Last child of InputRoot |
InputProperties | InputRoot.Properties (InputRoot.Properties is the first child of InputRoot, named "Properties") |
OutputRoot | outputMessageRoot parameter to cniSqlNavigatePath |
InputExceptionList | inputExceptionList parameter to cniSqlNavigatePath |
OutputExceptionList | outputExceptionList parameter to cniSqlNavigatePath |
Database | ODBC datasource identified by dataSourceName parameter to cniCreateReadOnlyPathExpression or cniCreateModifyablePathExpression |
InputDestinationList | Synonym for InputLocalEnvironment that is compatible with earlier versions |
OutputDestinationList | Synonym for OutputLocalEnvironment that is compatible with earlier versions |
All other rules regarding the actual navigability and validity of paths are defined in Correlation names.
Assuming that you have previously created a SQLPathExpression (see the example for cniSqlCreateReadOnlyPathExpression or cniSqlCreateModifiablePathExpression), you could use the following code to navigate to the target element.
CciElement* targetElement = cniSqlNavigatePath( NULL, ((NODE_CONTEXT_ST *)context)->pathExpression, message, localEnvironment, exceptionList, NULL, /* do not reference any output trees*/ NULL, NULL);