Rule editor stuck on "Getting rules" when using client library | Community
Skip to main content
Level 4
April 8, 2021
Solved

Rule editor stuck on "Getting rules" when using client library

  • April 8, 2021
  • 4 replies
  • 2759 views

I am using an existing client library that has worked before. Now when I edit a new form, apply the client library, and try to open the rule editor, it gets stuck on "Getting rules".

 

I receive this error in the browser console:

guideCommonAuthoring.js:5404 Error in retrieving Expression or Form Objects JSON

And I receive this error from the error.log:

08.04.2021 15:02:02.917 *ERROR* [0:0:0:0:0:0:0:1 [1617919322913] GET /libs/fd/af/components/info.json HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable org.mozilla.javascript.EvaluatorException: missing ; before statement (#33)

 

This is happening in my local and stage environments on AEM Version 6.5.3.

Has this issue happened to anyone else?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by workflowuser

somewhere in the client lib the javascript code is giving you the error. The best way is to comment few lines of code at a time and load the rule editor till you narrow down the culprit line in the javascript

4 replies

Adobe Employee
April 8, 2021

looks like this has to do with the client library associated with StoreAndFetch use case. The javascript code in the client library could be missing a semi colon. For the StoreAndFetch use case, you do not need to use the rule editor.

Adobe Employee
April 8, 2021

which clientlib are you using?

techddxAuthor
Level 4
April 8, 2021

I am using the client library from this tutorial: https://experienceleague.adobe.com/docs/experience-manager-learn/forms/adaptive-forms/document-of-record-api-tutorial-use.html?lang=en#adaptive-forms

 

Here is the modified js within the client library:

 

/** * Get pdf * {OPTIONS} drop down options */ function getPdf() { console.log("in view pdf"); window.guideBridge.getDataXML( { success: function(result) { var formData = new FormData(); formData.append("dataXml",result.data); console.log("got data"+result.data); var settings ={ "async": true, "url": "/bin/name", "method": "POST", data:{'data':result.data}, } $.ajax(settings).done(function(response, status, xhr) { console.log("got response from POST"); // check for a filename var filename = ""; var disposition = xhr.getResponseHeader('Content-Disposition'); if (disposition && disposition.indexOf('attachment') !== -1) { var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; var matches = filenameRegex.exec(disposition); if (matches != null && matches[1]) filename = matches[1].replace(/['"]/g, ''); } let binaryString = window.atob(response); let binaryLen = binaryString.length; let bytes = new Uint8Array(binaryLen); for (let i = 0; i < binaryLen; i++) { let ascii = binaryString.charCodeAt(i); bytes[i] = ascii; } let blob = new Blob([bytes], {type: "application/pdf"}); let link = URL.createObjectURL(blob); var a = document.createElement('a'); a.href = link; a.target = '_blank'; a.download = filename; document.body.appendChild(a); a.click(); }) }, error:function(guideResultObject) {console.log("got error"); }, guideState : null, boundData : true}); }

 

workflowuserAdobe EmployeeAccepted solution
Adobe Employee
April 8, 2021

somewhere in the client lib the javascript code is giving you the error. The best way is to comment few lines of code at a time and load the rule editor till you narrow down the culprit line in the javascript

techddxAuthor
Level 4
April 8, 2021
Changing the "let" statements to "var" made it work. Thank you for your help!
Mayank_Gandhi
Adobe Employee
Adobe Employee
April 9, 2021

@techddx avoid using let and const, these are not fully supported in forms.