Integration von Beraterkampagnen


Der Wert des flavour Attributs ist bei Berater-Kampagnen ADVISOR. Berater-Kampagnen enthalten zwei neue Bereiche in der Rückgabe. Der eine Bereich enthält die aktiven Fragen und die dazugehörigen Antworten. Der andere Bereich enthält den vollständigen Frage-Antwort-Baum. Die „aktiven“ Fragen sind, die Fragen, die aktuell dem Shop-Besucher angezeigt werden. Da es sich um einen ganzen Baum von Fragen und Antworten handelt, startet der Bereich „aktive Fragen“ ganz zu Beginn mit den ersten Fragen des Baums. Klickt der User auf eine Antwort, werden unter „aktive Fragen“ die Folge-Fragen dieser ausgewählten Antwort zurückgeliefert.

XML

<ff xsi:noNamespaceSchemaLocation="schema/7.2/ffresult.xsd">
  ...
  <campaigns>
    ...
    <campaign nr="1" name="Bike-Advisor" category="Advisors" flavour="ADVISOR">
      <target>
        <name></name>
        <destination></destination>
      </target>
      <pushedProducts count="0"></pushedProducts>
      <advisor>
        <activeQuestions>
          <question id="0">
            <text>Welcher Fahrrad-Typ sind Sie?</text>
            <answer id="1">
              <text>Racing</text>
              <params>...</params>
            </answer>
            <answer id="2">
              <text>MTB</text>
              <params>...</params>
            </answer>
            ...
          </question>
        </activeQuestions>
        <advisorTree>
          <question id="0">
            <text>Welcher Fahrrad-Typ sind Sie?</text>
            <answer id="1">
              <text>Racing</text>
              <params>...</params>
            </answer>
            <answer id="2">
              <text>MTB</text>
              <params>...</params>
 
              <question id="3">
                <text>Hardtail or Dirt?</text>
                <answer id="4">
                  <text>Hardtail</text>
                  <params>...</params>
                </answer>
                <answer id="5">
                  <text>Dirt</text>
                  <params>...</params>
                </answer>
              </question>
            </answer>
            <answer id="6">
              <text>BMX</text>
              <params>...</params>
            </answer>
          </question>
        </advisorTree>
      </advisor>
    </campaign>
  </campaigns>
  ...
</ff>

JSON

{"searchResult": {
    
    "campaigns": [
      {
        "activeQuestions": [
          {
            "answers": [
              {
                "id": "1",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
              {
                "id": "2",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
             
            ],
            "id": "0",
            "text": "Welcher Fahrrad-Typ sind Sie?"
            "visible": true
          }
        ],
        "advisorTree": [
          {
            "answers": [
              {
                "id": "1",
                "params": { ... },
                "questions": [ ],
                "text": "Racing"
              },
              {
                "id": "2",
                "params": { ... },
                "questions": [
                  {
                    "answers: [
                      {
                        "id": "4",
                        "params": { ... },
                        "questions": [ ],
                        "text": "Hardtail"
                      },
                      {   
                        "id": "5",
                        "params": { ... },
                        "questions": [ ],
                        "text": "Dirt"
                       },
                     ],
                     "id": "3",
                     "text": "Hardtail or Dirt?"
                     "visible": true
                   }
                 ],
                 "text": "MTB"
               },
               {
                 "id": "6",
                 "params": { ... },
                 "questions": [ ],
                 "text": "BMX"
               }
             ],
             "id": "0",
             "text": Welcher Fahrrad-Typ sind Sie?"
             "visible": true
           } 
         ],
         "category": "Advisors",
         "feedbackTexts": [ ],
         "flavour": "Advisor",
         "id": "2",
         "name": "Bike-Advisor",
         "pushedProductsRecords": [ ],
         "target": {
         "destination": "",
         "name": ""
       }
     }
   ],
 }
 
}

Webservice / SOAP

class Campaign {   
   ...   
   List<Question>         activeQuestions;
   List<Question>         advisorTree; 
}
class Question {
   String          id;
   String          text;
   List<Answer>      answers;
   boolean          isVisible;
}

class Answer {
   String          id;
   String          text;
   Params          params;
   List<Question>    questions;
}
Bitte beachten Sie, dass der Parameter generateAdvisorTree keinen Einfluss hat und nur noch aus Kompatibilitätsgründen vorhanden ist. Der damit ursprünglich generierte AdvisorTree wird immer erstellt und mit dem Suchergebnis ausgeliefert, so denn eine Beraterkampagne aktiv ist. 
Auf dieser Seite