Snippets

Sachin Dhir Score to drive business logic on multiple options selected in Adobe Campaign web app

Created by Sachin Dhir
<webApp accessControl="1" appState="0" appType="1" archivedFieldSchema="temp:webAppLogRcpData"
        background="nms:backgrounds/survey.png" builtIn="0" cmsAccount-id="0" created="2017-02-27 10:45:44.548Z"
        createdBy-id="101148730" defaultDictionary-id="1039" defaultLanguage="en"
        defaultOrigin-id="0" deliveryMapping-id="0" designLanguage="en" endDate=""
        entitySchema="nms:webApp" folder-id="1180" folderProcess-id="0" hasHtmlPage="0"
        id="118516750" idCounter="5" internalName="demoSurveyApp" isModel="0" label="Demo Survey"
        lastModified="2017-02-27 10:45:44.548Z" library="nms:webAppLogRcp" modelName="newSurvey"
        modifiedBy-id="101148730" nature="survey" operation-id="0" operator-id="0"
        originUrlOverride="true" publicationDate="" rendering-id="3526" schema="nms:recipient"
        startDate="" startPath="/" state="0" timezone="_inherit_" trackingEnabled="true"
        translationStatus="0" useAEM="false" uuid="82959c97-3ff1-440b-804b-f6c9fb2d240c"
        xtkschema="nms:webApp">
  <properties labelPosition="left" navigationMode="button" renderingEngine="1" windowTitle="Enter the title of the window here"/>
  <errorPage label="Technical error" name="errorPage">
    <endPage>
      <source><![CDATA[<table style="color: red;">
<tbody>
<tr>
<td style="vertical-align: middle; padding-left: 0.5em;"><img src="/xtk/img/error.png"/></td>
<td style="vertical-align: middle; padding: 1em;">
<p><%= $(error) %></p>
<p><%= $(retry) %></p>
</td>
</tr>
</table>]]></source>
      <strings>
        <string id="retry" value="Please try again later."/>
        <string id="error" value="Sorry, a technical error occurred."/>
      </strings>
    </endPage>
  </errorPage>
  <closedFormLog>'This survey is currently closed.'</closedFormLog>
  <desc><![CDATA[Template to create a survey from scratch]]></desc>
  <facet advanced="0" purl="0" survey="1"/>
  <rendering _cs="Standard form" created="2015-03-24 10:36:52.901Z" createdBy-id="0"
             displayNavigation="0" folder-id="1026" id="3526" internalName="defaultFormRendering"
             label="Standard form" lastModified="2015-11-12 01:02:01.951Z" modifiedBy-id="16768199"
             navigationLabel="" pageBorder="0" preview="/nms/img/survey/theme/preview/defaultRendering.png"
             type="0">
    <header hideIfDashboard="true" id="1" position="3">
      <font strikethrough="default" style="normal" underline="default"/>
      <left>
        <text><![CDATA[$(PAGETITLE)]]></text>
      </left>
      <right>
        <text><![CDATA[<% if(serverForm.activities[String(ctx.activityHistory.activity[0].@name)].type != "end") { %> $(PAGE) / $(PAGES) <% }%>]]></text>
      </right>
      <border>
        <left style="default"/>
        <top style="default"/>
        <right style="default"/>
        <bottom style="default"/>
      </border>
    </header>
    <header hideIfDashboard="true" id="2" position="3">
      <font strikethrough="default" style="normal" underline="default"/>
      <right>
        <text><![CDATA[$(LOGO)]]></text>
      </right>
      <border>
        <left style="default"/>
        <top style="default"/>
        <right style="default"/>
        <bottom style="default"/>
      </border>
    </header>
    <logo height="30" position="1" src="xtk:report/neologo118x30.png" width="195"/>
    <layout errors="1" footer="2" footertext="2" header="2"/>
    <format css="/nl/webForms/defaultWebApp.css" defaultFontSize="8" name="web">
      <cssOverloading><![CDATA[/* Enter here anything loaded over the CSS */]]></cssOverloading>
    </format>
    <modifiedBy _cs="Chris Skilton (cskilton)"/>
    <folder _cs="Form rendering"/>
  </rendering>
  <folder _cs="Web applications"/>
  <defaultDictionary _cs="User dictionary"/>
  <activities>
    <start img="xtk:activities/start.png" label="Start" mask="0" name="start" x="84"
           y="88">
      <transitions>
        <next enabled="true" name="next" target="page"/>
      </transitions>
    </start>
    <page colcount="1" img="nms:activities/page.png" label="Vehicle Choice" labelPosition="inherit"
          mask="0" name="page" randomQuestionsLimit="1" type="page" x="264" y="88">
      <transitions>
        <next enabled="true" label="Next" name="next" target="test"/>
      </transitions>
      <container colcount="1" colspan="1" id="container3" label="Which vehicles you own (select all that apply)?"
                 labelPosition="inherit" style="container" type="question">
        <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list"/>
        <input action="refresh" colspan="1" dateEditor="jsCalendar" enabledWhenHistory="false"
               id="input4" label="vehicles" labelPosition="inherit" targetSchema=""
               targetSchemaMode="xpath" type="radiolist">
          <rendering htmlEditor="Simple" justifyButton="1" styleButton="1" tableClass="list"/>
          <storage dateFormat="DDMNY4" firstYear="1920" lastYear="2015" maxsel="5"
                   minsel="1" mode="library" multipleChoice="true" timeFormat="none"
                   type="string" unbound="true" userEnum="">
            <field xpath="vehicles"/>
            <options>
              <option autoSqlName="true" id="70451201" label="Bicycle" score="0.5"/>
              <option autoSqlName="true" id="72548355" label="Bike" score="0.5"/>
              <option autoSqlName="true" id="71630850" label="Car" score="1"/>
              <option autoSqlName="true" id="74514437" label="SUV" score="3"/>
              <option autoSqlName="true" id="73269252" label="Truck" score="10"/>
            </options>
          </storage>
          <contextOptions useContext="0"/>
        </input>
      </container>
    </page>
    <test img="xtk:activities/condition.png" label="@Score &gt;= 10?" mask="0" name="test"
          x="432" y="88">
      <transitions>
        <condition enabled="true" help="(parseInt(score) greater than or equal to 10)"
                   label="True" name="transition1" target="end">
          <condition id="97714184" leftExpr="parseInt(@score)" operator="&gt;=" rightExpr="10"/>
        </condition>
        <default enabled="true" label="False" name="default" target="test2"/>
      </transitions>
    </test>
    <end img="xtk:activities/end.png" label="You own a truck" mask="0" name="end"
         x="632" y="48">
      <endPage>
        <source><![CDATA[<P>You own a Truck.</P>]]></source>
      </endPage>
    </end>
    <test img="xtk:activities/condition.png" label="@Score &gt;= 3?" mask="0" name="test2"
          x="589" y="169">
      <transitions>
        <condition enabled="true" help="(parseInt(score) greater than or equal to 3)"
                   label="True" name="transition1" target="end2" x="0" y="0">
          <condition id="114360329" leftExpr="parseInt(@score)" operator="&gt;="
                     rightExpr="3"/>
        </condition>
        <default enabled="true" label="False" name="default" target="end3" x="0"
                 y="0"/>
      </transitions>
    </test>
    <end img="xtk:activities/end.png" label="You have SUV." mask="0" name="end2"
         x="744" y="136">
      <endPage>
        <source><![CDATA[<P>You have SUV.</P>]]></source>
      </endPage>
    </end>
    <end img="xtk:activities/end.png" label="You missed SUV." mask="0" name="end3"
         x="752" y="256">
      <endPage>
        <source><![CDATA[<P>You missed SUV.</P>]]></source>
      </endPage>
    </end>
  </activities>
  <archivedFields>
    <field autoSqlName="true" label="vehicles" name="vehicles" type="string" unbound="true">
      <userEnum name=""/>
    </field>
  </archivedFields>
</webApp>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.