Hmm, that's only half the story... Think about this ...

'Create Date' > ($TIMESTAMP$ - (7 * 24 * 60 * 60))
AND
<whatever LJ Longwing quoted below>

i.e. qualifiers that involve arithmetic operations as well. The 
recursiveness/complexity grows even more... :)

Unless you're really trying to emulate the qualification evaluation (like AR 
workflow runtimes such as Server/Midtier/UserTool typically do), I suggest not 
to go deal with all this complexity yourself. Rather see, if your utility can 
get by, simply by offering a string representation of the qualifier. To do 
these, you can surely use ARServerUser.formatQualification/parseQualification 
etc routines within Java API to convert AR given qualifier object to a readable 
string format or the reverse. However, if your requirement is to really build 
the "qualifier tree object" and process it some how - then make sure that your 
logic indeed covers logical operators (Longwing quoted these below), as well as 
arithmetic operations and finally deal with field/keyword references 
appropriately.

HTH
Appajee




________________________________
From: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] On Behalf Of LJ Longwing
Sent: Tuesday, October 27, 2009 8:15 AM
To: arslist@ARSLIST.ORG
Subject: Re: Java API for ARS - How to obtain a Run-If line from an Active Link 
(for example)

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:arsl...@arslist.org] On Behalf Of David Morgan
Sent: Tuesday, October 27, 2009 8:33 AM
To: arslist@ARSLIST.ORG
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<http://www.tiberone.com/>

_Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the Answers Are"_
_Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the Answers Are"_

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: "Where the Answers Are"

Reply via email to