AEM InvokeService and guideBridege.validate() don't work together
Hi All,
We have a serious issue with AEM InvokeService (i.e. guidelib.dataIntegrationUtils.executeOperation() ) and guideBridege.validate() as the invokeService never terminates after guideBride.validate() returns true. We have an adaptive form consisting of 6 tabs and 6th tab is Review and Submit. Once user clicks on Submit button(type="button"), i will run guideBride.validate on each tab and once it returns true, i will invokeService which could be either POST (If user hasn't saved the form) or PUT operation. If I disable the validation then the form gets submitted but if i enable the validation, it shows the errors messages for all required fields if they are left blank and finally control goes to executeOperation but never exits.
In the sample code below we are never going to see "after fdm" in the console after successfull validation. But if i disable guideBridge.validate then form will get submitted and we can see the log message "after fdm" in browser console.
var operationInfo = {
"formDataModelId": "/content/dam/formsanddocuments-fdm/test",
"operationTitle": "Get data",
"operationName": "get_16166693155410"
};
var inputs = {
"id" : id_1,
"name" : name_1,
"frmDate" : date
};
var outputs = {
};
var createResponse = function(jsonResult){
alert("jsonREsult="+jsonResult);
};
var ci_errors = [];
guideBridge.validate(ci_errors,"guide[0].guide1[0].guideRootPanel[0]",true);
if(ci_errors.length === 0 ) {
console.log("Inside err len ===0 ");
guidelib.dataIntegrationUtils.executeOperation(operationInfo, inputs, outputs, createResponse);
console.log("after fdm");
}
Because of this issue we couldn't proceed with UAT and request you all if you could take some time to troubleshoot this issue or if there is any other alternate implementation.
If it is a simple POST operation then guideBridge.submit() works fine with guideBridege.validate(). We have issue only with InvokeService and guideBridege.validate().
Please let me know if you need any additional details.
Thanks & Regards
Suresh