This section examines the XQuery Expression system properties as well as useful examples
this.responsecount
Number of responses for the given proposition
this.impressioncount
Number of impression for the given proposition. Note - this should be used with care. The impression counted equates to number of times a proposition has been sent to the client , but not necessarily displayed.
$var//request/<input parameter>
TBC
$var//lastresponse/row/<proposition property>
Retrieve the last response details , for example,
$var//lastresponse/row/propid = "ABC"
returns the last response proposition id and returns 'true' if the value equals 'ABC'
$var//lastimpression/row/<proposition property>
Retrieve the last impression details , for example,
$var//lastimpression/row/propid = "ABC"
returns the last impression proposition id details and returns 'true' if the value equals 'ABC'
let $doc :=.
let $doc2 :=
if ($doc//request/operation = "response")
then 1
else
(if (this.responsecount = 0)
then 1 else -1 )
let $return_val := $doc2
return $return_val
This translates to
return '1' if this is a response operation
else
return '1' if there are no responses
else
return '-1' (false)
'this.' is a key word which will allow to access a number of special variables:
responsecount - number of responses for the given proposition
impressioncount - number of impression for the given proposition. Note - this should be used with care. The impression counted equates to number of times a proposition has been sent to the client , but not necessarily displayed.
let $doc :=.
let $doc2 := if (($doc//request/EventId = "Event1")
and (this.responsecount = 0)
and ($doc//lastresponse/row/propid = "ABC"))
then 1
else -1 return $doc2
This translates to
return '1' if this is "Event1"
and there are no responses
and the last response involved proposition "ABC"
else
return '-1' (false)
let $doc :=. let $doc2 := if ($doc//request/operation = "response")
then 1
else if (($doc//request/EventId = "Event2") and (this.responsecount = 0) and ($doc//lastresponse/row/propid = "XYZ"))
then 1
else -1
return $doc2
A value of '-1' will filter Journey stages.
A value of 0 will filter propositions
let $doc :=.
(: Response check :)
let $doc2 := if ($doc//request/operation = "response")
then 1
(: Journey check :)
else if (($doc//request/EventId = "EventId1") and (this.responsecount = 0))
then
(: Proposition check :)
if ($doc//lastresponse/row/propid = "ABC") then 1 else 0
else -1
return $doc2
Input Friendly format
let $doc :=. (: Response check :) let $doc2 := if ($doc//request/operation = "response") then 1 (: Journey check :) else if (($doc//request/EventId = "EventId1") and (this.responsecount = 0)) then (: Proposition check :) if ($doc//lastresponse/row/propid = "ABC") then 1 else 0 else -1 return $doc2