I'm trying to run an IQA query via SOA and to pass through multiple parameters. I couldn't find any documentation though a found a couple of samples here in the community.
The base code I grabbed from Paul Rogers example is:
var em = new EntityManager(AppContext.CurrentIdentity.UserId);
var query = new QueryData("IQA");
// The first query criterion MUST be named "QueryName"
query.AddCriteria(CriteriaData.Equal("QueryName", "$/ContactManagement/DefaultSystem/Queries/SingleContact"));
// Each subsequent query parameter required for the IQA query must be named "Parameter", the operation must always
// be "Equals" and each query criterion must be added to the collection in the order in which the required filters
// are defined in the query.
query.AddCriteria(CriteriaData.Equal("Parameter", "101"));
var results = em.Find(query);
If I add another parameter to the query in my IQA and try to add this extra parameter the above code fails or returns the incorrect results. Essentially when adding criteria for parameters it must be named Parameter. If there are two "Parameter" entries it just takes the last (understandably). There is no way to name the parameters that I have found, we just get an error if tried.
I also tried passing in the parameters as a comma separated string as detailed here: http://www.imiscommunity.com/iqa_web_service but it seems to just take the first value and ignore the rest.
Has anyone successfully run an IQA with multiple parameters using SOA?
Thanks
A
More details?
I played a bit with this, and had no problem specifying multiple parameters and getting the desired result. Performing multiple AddCriteria calls resulted in a collection of "Parameter" items in the correct order.
Can you provide a few more details on your particular situation? Such as:
For example, on the 15.1.3 level of iMIS, I set up a query named $/Test, with a source BO of Activity, and two optional filter items, on Id and Activity Type. The following code yielded the desired results:
var em = new EntityManager("user", "password"); // Use valid user/password values
var iqaQuery = new QueryData("IQA");
iqaQuery.AddCriteria(CriteriaData.Equal("QueryName", "$/Test"));
iqaQuery.AddCriteria(CriteriaData.Equal("Parameter", "123")); // Some valid value iqaQuery.AddCriteria(CriteriaData.Equal("Parameter", "DUES")); // Some valid value
var result = em.Find(iqaQuery);