Call a BAQ in BPM (Data Directive)

Hello All,
I need to call a BAQ in BPM,

but I can’t references Ice.Adapters.DynamicQuery.dll for Data Directive,

So I try to only using Ice.Contracts.DynamicQuery.

This is my code,but it’s not work,

how can I use Custom Code to call BAQ in BPM,

   Ice.Contracts.DynamicQuerySvcContract boDynamicQuery = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.DynamicQuerySvcContract>(Db);
   Ice.Tablesets.QueryExecutionTableset dsQueryExecution = new QueryExecutionTableset();

   ExecutionParameterRow drRow = new ExecutionParameterRow();
   drRow.ParameterID = "par_legalnumber";  // name of parameter from BAQ
   drRow.ParameterValue = invoicie_row.LegalNumber;
   drRow.ValueType = "nvarchar";
   drRow.IsEmpty = false;
   drRow.RowMod = "A";
   drRow.SysRowID = Guid.Empty;

   dsQueryExecution.ExecutionParameter.Add(drRow);
   DataSet dsResults = boDynamicQuery.ExecuteByID("MyBPM_ID", dsQueryExecution);
   DataTable result_dt = dsResults.Tables["Results"];

Hi,

Is the query required for a condition check. If so, there’s a data directive condition that may be based on a BAQ. See screenshot.

Nancy

2 Likes

Thanks for your reply,Nancy.
But My BAQ use a lot of subquery and calculated fields.
It still has some limitations.

Are you getting an error when running or validating this? Could you post the full custom code?

Oops…
I’m sorry for everyone.
When I validating the BAQ,
the code is work and the result is correct…