To get a human readable string for a QualifierInfo object use
ARServerUser.formatQualification();

>From the JavaDocs for the method:

String<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser%7EformatQualification%7EQString;%7EQObject;%E2%98%82String>com.bmc.arsys.api.
ARServerUser<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser>
.formatQualification(String<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser%7EformatQualification%7EQString;%7EQObject;%E2%98%82String>form,
Object<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser%7EformatQualification%7EQString;%7EQObject;%E2%98%82Object>qualification)
throws
ARException<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser%7EformatQualification%7EQString;%7EQObject;%E2%98%82ARException>

Formats an internal representation of a qualifier to a readable String
Parameters: *form* Form against which this qualification is defined *
qualification* given qualification - it can be an encoded qualification
representation (String) or a QualifierInfo object Returns: Readable
qualification string Throws:
ARException<eclipse-javadoc:%E2%98%82=api/src%3Ccom.bmc.arsys.api%7BARServerUser.java%E2%98%83ARServerUser%7EformatQualification%7EQString;%7EQObject;%E2%98%82ARException>-
in case of formatting errors

In your code below, you can do it by using the following line:

System.out.println(context.formatQualification(aLinkObjs.get(i).getPrimaryForm(),
aLinkObjs.get(i).getQualifier()) );


Hope that helps.

Calman


On Tue, Oct 27, 2009 at 8:14 AM, LJ Longwing <[email protected]> wrote:

> **
> Wow...ask a tough one....ok....took me FOREVER to figure out
> Qualifiers....but here is basically what you need to do.
>
> A QualifierInfo object has three main parts, LeftOperand, Operation, and
> RightOperand.  To explain these parts I will give you an example
>
> ('Status' = "Fixed") AND ('Create Date' < $DATE$)
>
> Ok, if that is your QualifierInfo object, here are your pieces
>
> LeftOperand = ('Status' = "Fixed")
> Operation = AND
> RightOperand = ('Create Date' < $DATE$)
>
> So, what I have done in several programs now is to write an iterative
> subroutine, if you check the operation to determine if it is a relational
> operation (< > = != etc).  If it's not, I throw RightOperand back into the
> sub till it is, If it is then you know you are down to a single operand, and
> then you can parse the field/value on left and right for what you want to
> check/test for.
>
> Please let me know if this helps any....it's still a bit fuzzy in my head,
> but I understand it well enough as it is to do what I need to do.
>
>  ------------------------------
> *From:* Action Request System discussion list(ARSList) [mailto:
> [email protected]] *On Behalf Of *David Morgan
> *Sent:* Tuesday, October 27, 2009 8:33 AM
> *To:* [email protected]
> *Subject:* Java API for ARS - How to obtain a Run-If line from an Active
> Link (for example)
>
> **
>
> Hi ARSListers,
>
>
>
> I have been looking at the Java API but am stumped by Qualifiers.
>
>
>
> String name1 = "Demo";
>
> String swd = "etno";
>
> String sname = "dclha002";
>
> Integer tcpport = 8001;
>
> Integer rpcnum = 0;
>
>
>
>
>
> ARServerUser context=new ARServerUser(name1,swd,"",sname, tcpport);
>
> // Check and verify user login:
>
>  try {
>
>        // If User Pass/Acct name is wrong, this gens an error.
>
>        context.login();
>
>
>
>      } catch( ARException e ) {
>
>        System.out.println( "Login Error : " + " Possible Bad password or
> acct name. " );
>
>        //This return ends all further processing and exits...
>
>         return;
>
>      }
>
> List<ActiveLink> aLinkObjs=context.getListActiveLinkObjects("AST:WorkLog");
>
> int x = 0;
>
> for (int i = 0; i < aLinkObjs.size(); i++) {
>
>     System.out.format("\n%20s%60s\n\n", i, aLinkObjs.get(i).getName());
>
>     //ActiveLink alink = aLinkObjs.get(x);
>
>
>
>             try{
>
>                 QualifierInfo encryptedQual =
> aLinkObjs.get(i).getQualifier();
>
>                 System.out.println(encryptedQual.toString() );
>
>                 RelationalOperationInfo qualEnglish =
> encryptedQual.getRelationalOperationInfo();
>
>
>
>                 System.out.println("Qual : "+ qualEnglish.toString());
>
>             } catch (Exception e){
>
>                 System.out.println("no Qualification\n");
>
>             }
>
>
>
>
>
>     if (aLinkObjs.get(i).toString().contentEquals("ASI:AWL:Close_100") ) {
>
>         x = i ;
>
>        // System.out.println(x);
>
>     }
>
> }
>
> context.logout();
>
> }
>
>
>
> I can get the names of the Active links associated with the named form (in
> this example I used AST:WorkLog)
>
> But I cannot seem to decode the Qualifier. All I get from the output is :-
>
>
>
>                    1
> SHR:SHR:Help_003_CheckOnlineHelpInstall_E
>
>
>
> [Operation=4,Operand Left=[Operation=2,Operand Left=[Operand
> Type=[type=2],Operand=$LASTCOUNT$],Operand Right=[Operand
> Type=[type=2],Operand=0]],Operand Right=<null>]
>
> Qual : [Operation=2,Operand Left=[Operand
> Type=[type=2],Operand=$LASTCOUNT$],Operand Right=[Operand
> Type=[type=2],Operand=0]]
>
> I just need some help in decoding the Qualifier. Anyone got any ideas?
> Thanks in advance!!
>
>
>
> *David Morgan*
>
> *Senior Technical Consultant*
>
>
>
> *Tiberone Technologies Limited*
>
> Golden Cross House
>
> 8 Duncannon Street
>
> London WC2N 4JF
>
> Ph: +44 (0) 207 484 5069
>
> Fax: +44 (0) 870 8310 381
>
> Mob: +44 (0) 7876 450102
>
> www.tiberone.com
>
>
> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
> Are"_
> _Platinum Sponsor: [email protected] ARSlist: "Where the Answers
> Are"_
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

Reply via email to