Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
FatalActivityExecutionException when I use html entities in command

I have a room listener as follows:
@Slash(value = "( .* )", mentionBot = false)
public void commandHandler(CommandContext ctx){...}

When I enter a command with any of the html entities & < > " '
It fails to read and gives following error:
[Fatal Error] :1:112 The entity name must immediately follow the '&' in the entity reference.
FatalActivityExecutionException: Unable to parse PresentationML

I tried replacing these values with the escape values eg putting & amp; as replacement of &
This seems to be working for me but why can I not use the html entities directly? Is there a work around to make this work?
Command that I had entered: #ref %^^&*&

  
  
Posted one year ago
Edited one year ago
Votes Newest

Answers 2


thanks for your suggestion, will look to upgrade bdk to latest version.
For now upgrading to bdk 2.3.1 has resolved my issue.

  
  
Posted one year ago

You didn't share your method body, but I suspect you're trying to echo the incoming message back into the room. The exception you see is not due to the incoming format but the outgoing format.

When sending messages, all special characters have to be escaped, as you have found. You can review the docs at this page:
https://docs.developers.symphony.com/building-bots-on-symphony/messages/overview-of-messageml#xml-formatting

  
  
Posted one year ago
Yong Sheng Tan
39 × 2 Administrator
  
  

The issue is not while responding to the message as I am not using any of the xml entities in my responses.
Please refer the error log: Error

Ali Rizvi   one year ago Report
  
  

Continuation of error log: Error

It doesnt enter my listener function commandHandler. Fails before entering.

Ali Rizvi   one year ago Report
1
1

My bad - I didn't realise you were using a regex in your pattern - that is no longer supported since 2.5.0 when arguments were introduced. there was also a fix for escape sequences in the interim but you should look at upgrading to the latest version of BDK. if you require a custom matcher (including regex), you will need to build a custom class that extends CommandActivity<CommandContext> and define an override to matcher()

Yong Sheng Tan   one year ago Report
1K Views
2 Answers
one year ago
one year ago
Tags