Archives: February 9, 2014

TCC – Case by Value

So we’ve established that case can be done by criterion or value.  Criterion has been done previously in the blog, here is how to do it by value:


<quer:projection alias="testCase" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:switchByValue>
<quer:baseValue>
<quer:field path="Requisition,JobInformation,HireType,Description"/>
</quer:baseValue>
<quer:cases>
<quer:case>
<quer:string>Contingent</quer:string>
<quer:string>This is temp work</quer:string>
</quer:case>
</quer:cases>
<quer:defaultValue>
<quer:string> </quer:string>
</quer:defaultValue>
</quer:switchByValue>
</quer:projection>

TCC – LessThanOrEqual (Expirience)

This is a less than or equal to X to return work experiences.

<quer:filtering xmlns:quer="http://www.taleo.com/ws/integration/query">
 <quer:or>
 <quer:lessThanOrEqual>
 <quer:field path="ProfileInformation,Experiences,DisplaySequence"/>
 <quer:integer>1</quer:integer>
 </quer:lessThanOrEqual>
 <quer:isNull>
 <quer:query projectedClass="Experience" alias="My_Exp_SubQuery">
 <quer:projections>
 <quer:projection alias="My_Exp_Alias">
 <quer:field path="DisplaySequence"/>
 </quer:projection>
 </quer:projections>
 <quer:filterings>
 <quer:filtering>
 <quer:equal>
 <quer:field path="Number"/>
 <quer:field ownerQuery="NewHire" path="ProfileInformation,Experiences"/>
 </quer:equal>
 </quer:filtering>
 </quer:filterings>
 </quer:query>
 </quer:isNull>
 </quer:or>
</quer:filtering>

 


TCC – LessThanOrEqual (study)

This is a query that returns the top X elements in the study class


<quer:filtering xmlns:quer="http://www.taleo.com/ws/integration/query">
 <quer:or>
 <quer:lessThanOrEqual>
 <quer:field path="ProfileInformation,Studies,DisplaySequence"/>
 <quer:integer>1</quer:integer>
 </quer:lessThanOrEqual>
 <quer:isNull>
 <quer:query projectedClass="Study" alias="My_Study_SubQuery">
 <quer:projections>
 <quer:projection alias="My_Study_Alias">
 <quer:field path="DisplaySequence"/>
 </quer:projection>
 </quer:projections>
 <quer:filterings>
 <quer:filtering>
 <quer:equal>
 <quer:field path="Number"/>
 <quer:field ownerQuery="NewHire" path="ProfileInformation,Studies"/>
 </quer:equal>
 </quer:filtering>
 </quer:filterings>
 </quer:query>
 </quer:isNull>
 </quer:or>
</quer:filtering>


TCC – Case by Criterion

Had a field that either needed to be an employee number or 777777 to signify that it’s not a rehire.  I had to use a case statement based on criterion, so I set the default value to 777777 and if it’s isNotNull then it’s the number, I was stoked when it finally worked.


<quer:projection alias="EmployeeID" xmlns:quer="http://www.taleo.com/ws/integration/query">
  <quer:switchByCriterion>
    <quer:cases>
      <quer:case>
        <quer:isNotNull>
          <quer:field path="Offers,Employee_20ID"/>
        </quer:isNotNull>
        <quer:field path="Offers,Employee_20ID"/>
      </quer:case>
    </quer:cases>
    <quer:defaultValue>
      <quer:string>999999</quer:string>
    </quer:defaultValue>
  </quer:switchByCriterion>
</quer:projection>