Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
techddx
Level 2

Likes

12 likes

Total Posts

65 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
Level 2
techddx
Level 2

Likes

12 likes

Total Posts

65 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
techddx
Level 2

08-04-2021

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
gbedekar
Level 3

08-04-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

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

278 likes

Total Posts

1,101 posts

Correct Reply

181 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

278 likes

Total Posts

1,101 posts

Correct Reply

181 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile
Mayank_Gandhi
Level 10

08-04-2021

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

Avatar

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
gbedekar
Level 3

08-04-2021

which clientlib are you using?

techddx

I am using the client library from this tutorial: https://experienceleague.adobe.com/docs/experience-manager-learn/forms/adaptive-forms/document-of-re...

 

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});

}

 

techddx

The js is tested and working, however the rule editor no longer works when the client library is applied in the form container.

After removing the client library from the forms container, the rule editor starts to work again.

Avatar

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Level 3
gbedekar
Level 3

Likes

24 likes

Total Posts

33 posts

Correct Reply

8 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
gbedekar
Level 3

08-04-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.