Ok….I’m going to try to document this for ‘the world’.

Looking through the 7.6.4 JavaDocs, you can get a QualifierInfo object through 
numerous methods…the one outline in the appendix

QuerySourceForm primaryForm = new QuerySourceForm("Form1");
QuerySourceForm secondaryForm = new QuerySourceForm("Form2");
ArithmeticOrRelationalOperand field1 = new 
ArithmeticOrRelationalOperand(123456, primaryForm);
ArithmeticOrRelationalOperand field2 = new 
ArithmeticOrRelationalOperand(654321, secondaryForm);
RelationalOperationInfo relOp = new 
RelationalOperationInfo(RelationalOperationInfo.AR_REL_OP_EQUAL, field1, 
field2);
                
QualifierInfo joinQual = new QualifierInfo(relOp);

Or, through more ‘normal’ methods which would be something like this

String qual =  "'Field1' = $Field2$"; // 'Product Name' = $Model$

List<Field> f1 = arConnection.getListFieldObjects("Form1");
List<Field> f2 = arConnection.getListFieldObjects("Form2");

QualifierInfo joinQual = arConnection.parseQualification(qual, f2, f1, 
Constants.AR_QUALCONTEXT_DEFAULT);

The problem is that the first method creates a QualifierInfo object that looks 
something like this

[Operation=4,Operand Left=[Operation=1,Operand Left=[Operand 
Type=[type=1],Operand=[Field ID=123456,Func ID=0,Field Source=[Source 
Identifier=-6be110ff:136c144c57c:-8000,Source Name=Form1]]],Operand 
Right=[Operand Type=[type=1],Operand=[Field ID=654321,Func ID=0,Field 
Source=[Source Identifier=-6be110ff:136c144c57c:-7fff,Source 
Name=Form2]]]],Operand Right=<null>]

Whereas the second presents something like

[Operation=4,Operand Left=[Operation=1,Operand Left=[Operand 
Type=[type=1],Operand=123456],Operand Right=[Operand 
Type=[type=1],Operand=654321]],Operand Right=<null>]

So...Eric,
What I'm reading out of this is that the people over at BMC did not deem it 
necessary to either update the parseQualification method...or provide an 
appropriately overridden version of it to be able to create a QualifierInfo 
object that will work when utilizing the getListEntryObjects method with a 
RegularQuery object as one of the inputs....

This is a long, 'around the way' way of saying 'No' to your original 
question....it looks like you must use the 'long hand' method of creating the 
qualifier objects for the moment....and in the long run, if you want to be able 
to use the shorthand...you could either write your own method to build it 
properly....or submit an enhancement request to BMC to have them do the leg 
work.


From: LJ LongWing [mailto:lj.longw...@gmail.com] 
Sent: Monday, April 16, 2012 8:45 AM
To: 'arslist@ARSLIST.ORG'
Subject: RE: Multi schema join parse qualfier

Eric,
I see no reason why you wouldn’t be able to use that method to create the 
QualifierInfo object….I’m not entirely sure of the code you are using to get 
the cast error.  Please feel free to contact me offlist if you would like, but 
I would love to try to help ☺

From: Action Request System discussion list(ARSList) 
[mailto:arslist@ARSLIST.ORG] On Behalf Of Eric Roys
Sent: Sunday, April 15, 2012 9:02 PM
To: arslist@ARSLIST.ORG
Subject: Multi schema join parse qualfier

** 
For you java api folks… 

ARS 7.6.4 sp2
Java api 7.6.4 build 2
Java 7

Is there a parse qual method for translating a query string (i.e. ‘This’ = 
$This$ AND ‘That’ = $That$) for the QualifierInfo required by 
com.bmc.arsys.api.QuerySourceForm.setJoin(IQuerySource arg0, int arg1, 
QualifierInfo arg2) method [or does one have to embrace the long hand version 
and write out as indicated in the appendix of the C API reference doc (excerpt 
below)? I was hoping that the parseQualification(String queryString, 
List<Field> fieldList1, List<Field> fieldList2, int queryContext, boolean 
exceptionWhenFieldNotFound) method would do the trick but it seems the 
getListEntryObjects fails with a cast exception (java.lang.Integer cannot be 
cast to com.bmc.arsys.api.QueryFormField). 

Excerpt:
       // Create join qualifier, which is used to generate the SQL query’s
       // ON clause.  
       ArithmeticOrRelationalOperand field1 = new 
ArithmeticOrRelationalOperand(240001002, prodCat);
       ArithmeticOrRelationalOperand field2 = new 
ArithmeticOrRelationalOperand(240001002, products);
       RelationalOperationInfo relOp = new 
RelationalOperationInfo(RelationalOperationInfo.AR_REL_OP_EQUAL, field1, 
field2);
       
       QualifierInfo joinQual = new QualifierInfo(relOp);

Thanks, 

Eric

CONFIDENTIALITY NOTICE: This email communication is intended only for the 
personal and confidential use of the recipient(s) designated above and may 
contain information which is subject to Federal and/or State privacy laws. In 
the event that you are not the intended recipient or the agent of the intended 
recipient, you are hereby notified that any review, disclosure, or use of the 
information contained herein is strictly prohibited. Do not copy or use the 
information contained within this communication, or allow it to be read, copied 
or utilized in any manner by any other person(s). If you have received this 
communication in error, please notify the sender immediately, either by 
response e-mail or by phone, and permanently delete the original e-mail, any 
attachment(s), and copies. 
_attend WWRUG12 www.wwrug.com ARSlist: "Where the Answers Are"_ 

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"

Reply via email to