简体   繁体   English

Taleo Connect 客户端脚本

[英]Taleo Connect Client Script

Summary: I'm trying to write a script that will pull through a candidates "answer" based off of of a "question code", and have it only pull one row of data per candidate.摘要:我正在尝试编写一个脚本,该脚本将根据“问题代码”提取候选人“答案”,并让每个候选人仅提取一行数据。

Problems:问题:

  1. The "answer" field brings through the answers to multiple questions (which in turn brings multiple rows; 1 for each question/answer), and I only care about bringing through the answer to the one question. “答案”字段带来了多个问题的答案(这又带来了多行;每个问题/答案 1 行),我只关心一个问题的答案。
  2. If I filter the entire script off of the question code (DQ_009), it will only pull through candidates that have answered the question and it does not pull through candidates that have not answered it.如果我从问题代码 (DQ_009) 中过滤掉整个脚本,它只会筛选已回答问题的候选人,而不会筛选未回答问题的候选人。
  3. I'm not a developer/code writer by trade.我不是专业的开发人员/代码编写者。 I'm being asked to do this because no one else has any idea what's going on.我被要求这样做是因为没有其他人知道发生了什么。

What I'm looking for: I'm trying to figure out possibly how to use a complex projection or a subquery (or something else, I'm not sure the right approach) within TCC that will only bring through the answer to that specific question, but also bring it through for people that have not answered it (leaving it blank though).我在找什么:我试图弄清楚如何在 TCC 中使用复杂的投影或子查询(或其他东西,我不确定正确的方法),这只会带来特定的答案问题,但也为没有回答的人提供它(尽管留空)。

Code explanation:代码说明:

  1. In the code I have provided, I copied and pasted this from the "source" of the script.在我提供的代码中,我从脚本的“源”复制并粘贴了它。 I have it filtering on the candidate number of 36620, which is a candidate that has not answered the question, and thus is not pulling through a value.我让它过滤候选编号 36620,这是一个没有回答问题的候选,因此没有通过一个值。
  2. I'm trying to have it only pull through the value for the "Question" section when it equals "DQ_009"(which ends up being 'Yes', 'No', or if the candidate has not answered the question, and thus does not exist, I want it to just be blank so it still pulls a row of data for them).我试图让它仅在它等于“DQ_009”时通过“问题”部分的值(最终为“是”,“否”,或者如果候选人没有回答问题,因此不存在,我希望它只是空白,所以它仍然为它们提取一行数据)。

Any help is extremely appreciated.非常感谢任何帮助。

<quer:query productCode="RC1704" model="http://www.taleo.com/ws/tee800/2009/01" projectedClass="Profile" locale="en" mode="CSV" csvheader="true" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
  <quer:subQueries/>
  <quer:projections>
    <quer:projection alias="Candidate_ID">
      <quer:field path="ProfileInformation,Candidate,Number"/>
    </quer:projection>
    <quer:projection alias="Visa_Needed">
      <quer:field path="ProfileInformation,Candidate,QuestionAnswers,Answer,Description"/>
    </quer:projection>
    <quer:projection alias="Question">
      <quer:field path="ProfileInformation,Candidate,QuestionAnswers,Question,Code"/>
    </quer:projection>
  </quer:projections>
  <quer:projectionFilterings/>
  <quer:filterings>
    <quer:filtering>
      <quer:equal>
        <quer:field path="ProfileInformation,Candidate,Number"/>
        <quer:long>36620</quer:long>
      </quer:equal>
    </quer:filtering>
  </quer:filterings>
  <quer:sortings/>
  <quer:sortingFilterings/>
  <quer:groupings/>
  <quer:joinings/>
</quer:query>

Here is a way to do it using a complex projection.这是一种使用复杂投影的方法。 Note that I modified your query to start from the "Candidate" entity instead of "Profile" to shorten the field paths.请注意,我将您的查询修改为从“候选人”实体而不是“个人资料”开始,以缩短字段路径。

With the complex projection you can modify the filters of the main query to also extract candidates that did not answer to the question.使用复杂投影,您可以修改主查询的过滤器,以提取未回答问题的候选人。

<?xml version="1.0" encoding="UTF-8"?>
<quer:query productCode="RC1704" model="http://www.taleo.com/ws/tee800/2009/01" projectedClass="Candidate" locale="en" alias="MainQuery" mode="CSV" csvheader="true" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
    <quer:subQueries/>
    <quer:projections>
        <quer:projection alias="Candidate_ID">
            <quer:field path="Number"/>
        </quer:projection>
        <quer:projection alias="Visa_Needed">
            <quer:query projectedClass="Candidate" alias="VisaAnswer">
                <quer:projections>
                    <quer:projection alias="AnswerDesc">
                        <quer:field path="QuestionAnswers,Answer,Description"/>
                    </quer:projection>
                </quer:projections>
                <quer:filterings>
                    <quer:filtering>
                        <quer:equal>
                            <quer:field path="QuestionAnswers,Question,Code"/>
                            <quer:string>DQ_009</quer:string>
                        </quer:equal>
                    </quer:filtering>
                    <quer:filtering>
                        <quer:equal>
                            <quer:field path="Number"/>
                            <quer:field ownerQuery="MainQuery" path="Number"/>
                        </quer:equal>
                    </quer:filtering>
                </quer:filterings>
            </quer:query>
        </quer:projection>
    </quer:projections>
    <quer:projectionFilterings/>
    <quer:filterings>
        <quer:filtering>
            <quer:equal>
                <quer:field path="Number"/>
                <quer:long>36620</quer:long>
            </quer:equal>
        </quer:filtering>
    </quer:filterings>
    <quer:sortings/>
    <quer:sortingFilterings/>
    <quer:groupings/>
    <quer:joinings/>
</quer:query>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM