Jump to content

BPM added apostrophes


Recommended Posts

I got the error pop up when I saved my Business Process, I couldn't see the error in the logs but I managed to copy the text from the popup using Chrome's debug tools (making this error popup copyable might be useful for troubleshooting?)

The text was:

decision ("s1"/"decision-66cdaa31-fd17-4c23-b9f2-443122eaea5a") parse: at 2/105: "Uncaught SyntaxError: Unexpected identifier"
 return [((typeof global["flowcode"]["site"]==='string' && global["flowcode"]["site"].toLowerCase() == ''broomfield hall'')) == true,(true) == true]; })()"
----------------------------------------
(function(){ var outcome=false;if(functions.pcf===undefined){functions.pcf = function(formId,questionId){ var pcfForms = {}; if(typeof global["flowcode"]["syspcfanswers"] ==="string")	{try{ 	pcfForms = JSON.parse(global["flowcode"]["syspcfanswers"]); if(typeof pcfForms[formId] === "object"){if(pcfForms[formId].hasOwnProperty(questionId)){return pcfForms[formId][questionId];}}}catch(e){};}return "";}};if(global["inputParams"]["outcome"]) {outcome = global["inputParams"]["outcome"];}else if(global["outputParams"]["outcome"]) {outcome = global["outputParams"]["outcome"];}else {outcome = global["flowcode"]["outcome"];}
 return [((typeof global["flowcode"]["site"]==='string' && global["flowcode"]["site"].toLowerCase() == ''broomfield hall'')) == true,(true) == true]; })()

After a fair bit of rummaging, I found that the relevant decision branch had decided to wrap the static expression in my decision in single quotes.

No idea why that happened, but removing them fixed the flowcode.

Link to comment
Share on other sites

In your actual static test, in the branch, did you manually enter 'broomfield hall' ?  With the quotes?

The condition generator knows that the var you are worknig with is a string so it adds the quotes when building the condition.

You don't need to add quotes yourself when setting up your conditions.

 

Link to comment
Share on other sites

In the field in the node when I created it I entered Broomfield Hall but when I checked after getting the error it was showing as 'Broomfield Hall'

Once I removed them all was well.

I did notice that in the error it showed as ''Broomfield Hall'' which fits with the generator adding the quotes.

The only thing that was different about this node was that it was copied, then pasted a few times but I wouldn't expect that to have caused this issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...