Running an IQA with Multiple Parameters via SOA

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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:
 

  • Are you using the shipped 15.1.3 SOA or the ETP version?
  • How is your query set up?  That is, what is your source, and how are your parameters set up (optional, required, etc.)?
  • Is your SOA client's source language C# or some other language?

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);

 

I think this is related to

I think this is related to the structure of the IQA. This is the 15.1.3 release of SOA, code in c#.

I built an IQA based on CContact, displaying basic data, name, state, member type, company. I then created two optional parameters on Member Type and State Province of type equals. When I do this everything runs correctly and as expected.

I then added a third optional parameter for Company and this parameter is just ignored, it rune the two equal parameters.

If I then make all the parameters required I get an error "Error: In Iqa query, parameters must be Parameter Equal'. I assume this means that SOA queries do not support anything other than equal parameters?


q.AddCriteria(CriteriaData.Equal("QueryName", "$/Test"));//iqa.IqaQuery));
q.AddCriteria(CriteriaData.Equal("Parameter", "CM")); //Member Type - equal param
q.AddCriteria(CriteriaData.Equal("Parameter", "TX")); //State - equal param
q.AddCriteria(CriteriaData.Equal("Parameter", "A")); //Company - starts with param
FindResultsData results = dest.Find(q);

I tell a lie. The above code

I tell a lie. The above code actually does work. I inadvertently ran through with Criteria.StartsWith and that is when I got the error. I think the weirdness I was seeing is due to my machine. Lets consider this resolved, I'll post again if I work anything else out.

SOA IQA query w/custom Business Object

Did you try doing an IQA query that pulls data from a custom business object?

Everything works fine for me when I use IQA queries that use built-in business objects, but as soon as I create my own business object (even a simple business object that pulls from the Name table), it errors out (with or without parameters).

Here is the error: "an Error Occured (sic) While Constructing the Query".

Has anyone done this successfully yet?

FYI, I opened a ticket with

FYI, I opened a ticket with ASI and they confirmed this is a bug. It has been assigned a "Medium" priority.