I have developed a custom trigger in SDL Smart Target 2014 and I am able to print the claim values in my application using AmbientDataContext. I want to pass the value of claim as a trigger to the Fredhopper query in the code below. When I fetch the list of triggers from the code below, it does not list my custom claim as trigger.I have defined a url-param for the same in my trigger-types.xml also.
ClaimStore claims = AmbientDataContext.getCurrentClaimStore();
if (claims != null) {
Map<URI, Object> x = claims.getAll();
out.print("<b>Printing Claims registered</b><br/><br/>");
for (Map.Entry<URI, Object> entry : x.entrySet()) {
out.println("\"KEY\" " + entry.getKey() + " \"Value\" "
+ entry.getValue() + "<br/><br/>");
}
}
String triggers = AmbientDataHelper.getTriggers(claims);
out.println("<b>Triggers retreived list is </b>" + triggers);
ResultSet rs = query
.execute("fh_location=//catalog01/en_US/categories<{catalog01_tcm_0_1234_1}&st_region=Homepage Promotions",
"", "&st_publication=tcm:0-1234-1&taf:claim:usertype:prof=Physicians");
out.println("<br/><br/><b>No of Promotions fetched form QueryFactory approach are </b>" + rs.getPromotions().size());
"taf:claim:usertype:prof" is the URI of my claim and user_prof is the url-param I have defined in the trigger-types.xml
I have tried by passing both values in the above code but I am unable to fetch the promotions based on the query. I have also made entry to the smarttarget_conf file in the Prefix section as below by replacing the ":" sign with "_" as in the dcumentation.
<taf_claim_usertype_prof>user_prof</taf_claim_usertype_prof>
When I print the list of triggers as string in above code it displays a list of preconfigured triggers like browser and os but not my custom trigger.
Please provide me pointers on how can I register it as a claim.
Thanks