Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-71932

Autofill rule does not work when Input parameter is configured

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: Master
    • Fix Version/s: 7.1.X, Master
    • Component/s: Forms
    • Labels:
      None

      Description

      Steps to Reproduce

      1. Navigate to Forms Admin
      2. Add a new Data Provider
      3. Create a Data Provider with the following information:
        1. Name: Country ID to Name
        2. URL: ${portalURL}/api/jsonws/country/get-country
        3. User Name: test@liferay.com
        4. Password: test
        5. Inputs: Label: Country Code, Parameter: countryId, Type: Number
        6. Outputs: Label: Country Name, Path: nameCurrentValue, Type: Text
      4. Save the data provider
      5. Add a form
      6. Add a text field named Country Id
      7. Add a text field named Country Name
      8. Go to the form Rules
      9. Build the rule:
        If Country Id is not empty
        Do Autofill from Country ID to Name
      10. Select Country Id as Data Providers Input
      11. Select Country Name as Data Providers Output
      12. Save Rule
      13. Save Form
      14. Add a Form portlet to a page
      15. Select created Form
      16. Under Country Id input "20"

      Expected Result
      Country Name field will auto populate with "Afghanistan"

      Actual Result
      Country Name field is not autopopulated. The following errors are thrown in the console:

      23:02:46,664 WARN  [http-nio-8080-exec-3][CallFunction:97] Error evaluating expression: ,,
      java.lang.ClassCastException: Cannot cast net.minidev.json.JSONArray to java.lang.String
              at java.lang.Class.cast(Class.java:3369)
              at com.liferay.dynamic.data.mapping.data.provider.DDMDataProviderResponseOutput.getValue(DDMDataProviderResponseOutput.java:37)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.functions.CallFunction.setDDMFormFieldValues(CallFunction.java:266)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.functions.CallFunction.evaluate(CallFunction.java:93)
              at com.liferay.dynamic.data.mapping.expression.internal.DDMExpressionEvaluatorVisitor.visitFunctionCallExpression(DDMExpressionEvaluatorVisitor.java:150)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$FunctionCallExpressionContext.accept(DDMExpressionParser.java:1635)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToFunctionCallExpression(DDMExpressionBaseVisitor.java:258)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToFunctionCallExpressionContext.accept(DDMExpressionParser.java:1479)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitPrimary(DDMExpressionBaseVisitor.java:128)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$PrimaryContext.accept(DDMExpressionParser.java:1368)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToNumericUnaryExpression(DDMExpressionBaseVisitor.java:288)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToNumericUnaryExpressionContext.accept(DDMExpressionParser.java:1197)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToMultOrDiv(DDMExpressionBaseVisitor.java:38)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToMultOrDivContext.accept(DDMExpressionParser.java:1092)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToAdditionOrSubtractionEpression(DDMExpressionBaseVisitor.java:248)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToAdditionOrSubtractionEpressionContext.accept(DDMExpressionParser.java:861)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToBooleanOperandExpression(DDMExpressionBaseVisitor.java:68)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToBooleanOperandExpressionContext.accept(DDMExpressionParser.java:748)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToBooleanUnaryExpression(DDMExpressionBaseVisitor.java:168)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToBooleanUnaryExpressionContext.accept(DDMExpressionParser.java:598)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToComparisonExpression(DDMExpressionBaseVisitor.java:368)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToComparisonExpressionContext.accept(DDMExpressionParser.java:401)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToEqualityExpression(DDMExpressionBaseVisitor.java:228)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToEqualityExpressionContext.accept(DDMExpressionParser.java:289)
              at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionBaseVisitor.visitToLogicalAndExpression(DDMExpressionBaseVisitor.java:118)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ToLogicalAndExpressionContext.accept(DDMExpressionParser.java:154)
              at com.liferay.dynamic.data.mapping.expression.internal.DDMExpressionEvaluatorVisitor.visitExpression(DDMExpressionEvaluatorVisitor.java:124)
              at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser$ExpressionContext.accept(DDMExpressionParser.java:102)
              at com.liferay.dynamic.data.mapping.expression.internal.DDMExpressionImpl.evaluate(DDMExpressionImpl.java:77)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormRuleEvaluator.evaluateDDMExpression(DDMFormRuleEvaluator.java:78)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormRuleEvaluator.executeAction(DDMFormRuleEvaluator.java:83)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormRuleEvaluator.evaluate(DDMFormRuleEvaluator.java:51)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormEvaluatorHelper.evaluateDDMFormRule(DDMFormEvaluatorHelper.java:223)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormEvaluatorHelper.evaluate(DDMFormEvaluatorHelper.java:103)
              at com.liferay.dynamic.data.mapping.form.evaluator.internal.DDMFormEvaluatorImpl.evaluate(DDMFormEvaluatorImpl.java:49)
              at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormPagesTemplateContextFactory._createDDMFormEvaluationResult(DDMFormPagesTemplateContextFactory.java:290)
              at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormPagesTemplateContextFactory.create(DDMFormPagesTemplateContextFactory.java:80)
              at com.liferay.dynamic.data.mapping.form.renderer.internal.servlet.DDMFormContextProviderServlet.createDDMFormPagesTemplateContext(DDMFormContextProviderServlet.java:96)
              at com.liferay.dynamic.data.mapping.form.renderer.internal.servlet.DDMFormContextProviderServlet.doPost(DDMFormContextProviderServlet.java:132)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
              at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:50)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
              at com.liferay.portal.servlet.filters.authverifier.AuthVerifierFilter.processFilter(AuthVerifierFilter.java:169)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
              at org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration.doFilter(FilterRegistration.java:121)
              at org.eclipse.equinox.http.servlet.internal.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:45)
              at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:70)
              at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
              at org.eclipse.equinox.http.servlet.internal.HttpServiceRuntimeImpl.doDispatch(HttpServiceRuntimeImpl.java:373)
              at org.eclipse.equinox.http.servlet.internal.servlet.ProxyServlet.service(ProxyServlet.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at com.liferay.portal.module.framework.ModuleFrameworkServletAdapter.service(ModuleFrameworkServletAdapter.java:51)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
              at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
              at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:257)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
              at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
              at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
              at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:745)

      Reproduced on
      Tomcat 8.0 + PostgreSQL 9.4
      Portal master GIT ID cc6c28ef0ab3da4bd64b61fbf8ab8ebcad2abd97

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 31 weeks, 1 day ago

                Packages

                Version Package
                7.1.X
                Master