cancel
Showing results for 
Search instead for 
Did you mean: 

Problem defining form for workflow task

amitev
Champ in-the-making
Champ in-the-making
Hi all! I am creating my own workflow and defined a form for the start workflow and the transition to the next task is successful. But when I open the second task for Edit instead of the default form I get the following error on the web page:


An error has occured in the Share component: /share/service/components/form.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 04030000 Failed to process template org/alfresco/components/form/form.get.html.ftl
Server: Alfresco Spring WebScripts - v1.0.0 (Release Candidate 2 744) schema 1,000
Time: May 3, 2011 3:51:22 PM
Click here to view full technical information on the error.

The exception in the log is:


15:54:02,820 http-7080-1 ERROR [scripts.forms.FormUIGet] org.json.JSONException: Expected a ':' after a key at character 14431
15:54:02,822 http-7080-1 ERROR [freemarker.runtime] Expression form.mode is undefined on line 5, column 19 in org/alfresco/components/form/form.lib.ftl.

Expression form.mode is undefined on line 5, column 19 in org/alfresco/components/form/form.lib.ftl.
The problematic instruction:
———-
==> ${form.mode} [on line 5, column 17 in org/alfresco/components/form/form.lib.ftl]
in user-directive formLib.renderFormsRuntime [on line 17, column 10 in org/alfresco/components/form/form.get.html.ftl]
———-

Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Expression form.mode is undefined on line 5, column 19 in org/alfresco/components/form/form.lib.ftl.
   at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   at freemarker.core.Expression.getStringValue(Expression.java:118)
   at freemarker.core.Expression.getStringValue(Expression.java:93)
   at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IfBlock.accept(IfBlock.java:82)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IfBlock.accept(IfBlock.java:82)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:231)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:284)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:264)
   at org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:93)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:600)
   at org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:539)
   at org.springframework.extensions.surf.render.RenderService.renderChromeInclude(RenderService.java:893)
   at org.springframework.extensions.webscripts.ChromeIncludeFreeMarkerDirective.execute(ChromeIncludeFreeMarkerDirective.java:71)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:186)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:89)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRenderer.java:80)
   at org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:92)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:492)
   at org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:75)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.visit(Environment.java:395)
   at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:378)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:123)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:85)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
15:54:02,823 http-7080-1 ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 04030001 Failed to process template org/alfresco/components/form/form.get.html.ftl
org.springframework.extensions.webscripts.WebScriptException: 04030001 Failed to process template org/alfresco/components/form/form.get.html.ftl
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:175)
   at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:231)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:284)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:264)
   at org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:93)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderComponent(RenderService.java:600)
   at org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:539)
   at org.springframework.extensions.surf.render.RenderService.renderChromeInclude(RenderService.java:893)
   at org.springframework.extensions.webscripts.ChromeIncludeFreeMarkerDirective.execute(ChromeIncludeFreeMarkerDirective.java:71)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:186)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:89)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRenderer.java:80)
   at org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:92)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:492)
   at org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:75)
   at freemarker.core.Environment.visit(Environment.java:263)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.visit(Environment.java:395)
   at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:345)
   at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:57)
   at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:378)
   at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:123)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:85)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
Caused by: freemarker.core.InvalidReferenceException: Expression form.mode is undefined on line 5, column 19 in org/alfresco/components/form/form.lib.ftl.
   at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   at freemarker.core.Expression.getStringValue(Expression.java:118)
   at freemarker.core.Expression.getStringValue(Expression.java:93)
   at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IfBlock.accept(IfBlock.java:82)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IfBlock.accept(IfBlock.java:82)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   … 88 more

If I define a form definition for this task in share-config-custom.xml then no exception occurs but what I get is a blank form with the following in the log of share:


15:59:18,083 http-7080-4 ERROR [scripts.forms.FormUIGet] 04030015 Wrapped Exception (with status template): 04030014 Error during processing of the template 'Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.'. Please contact your system administrator.

and the following exception in alfresco app (i use different servers for alfresco repository and share):


17:44:43,790 User:adr ERROR [freemarker.runtime] Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.

Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.
The problematic instruction:
———-
==> if-else  [on line 55, column 13 in org/alfresco/repository/forms/formdefinition.lib.ftl]
in user-directive formDefLib.formDefJSON [on line 2, column 1 in org/alfresco/repository/forms/formdefinition.post.json.ftl]
———-

Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.
   at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   at freemarker.core.BuiltIn$is_booleanBI._getAsTemplateModel(BuiltIn.java:728)
   at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
   at freemarker.core.Expression.isTrue(Expression.java:138)
   at freemarker.core.IfBlock.accept(IfBlock.java:80)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
   at freemarker.core.Environment.visit(Environment.java:417)
   at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:197)
   at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:377)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
17:44:43,797  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 04030001 Wrapped Exception (with status template): 04030002 Error during processing of the template 'Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.'. Please contact your system administrator.
org.springframework.extensions.webscripts.WebScriptException: 04030001 Wrapped Exception (with status template): 04030002 Error during processing of the template 'Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.'. Please contact your system administrator.
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:758)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:377)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.service.cmr.repository.TemplateException: 04030002 Error during processing of the template 'Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.'. Please contact your system administrator.
   at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)
   at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   … 24 more
Caused by: freemarker.core.InvalidReferenceException: Expression form.formData[k] is undefined on line 55, column 18 in org/alfresco/repository/forms/formdefinition.lib.ftl.
   at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   at freemarker.core.BuiltIn$is_booleanBI._getAsTemplateModel(BuiltIn.java:728)
   at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
   at freemarker.core.Expression.isTrue(Expression.java:138)
   at freemarker.core.IfBlock.accept(IfBlock.java:80)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
   at freemarker.core.Environment.visit(Environment.java:417)
   at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Macro$Context.runMacro(Macro.java:172)
   at freemarker.core.Environment.visit(Environment.java:603)
   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.MixedContent.accept(MixedContent.java:92)
   at freemarker.core.Environment.visit(Environment.java:210)
   at freemarker.core.Environment.process(Environment.java:190)
   at freemarker.template.Template.process(Template.java:237)
   at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:197)
   … 27 more



Idea what am I doing wrong and how to fix that?
4 REPLIES 4

amitev
Champ in-the-making
Champ in-the-making
After some debugging i found that the exception is thrown in the following code in alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/forms/formdefinition.lib.ftl:


        "formData":
        {
            <#list form.formData?keys as k>
            <#if form.formData[k]?is_boolean>
            <#– Render boolean data without the surrounding inverted commas –>
            "${k}": ${form.formData[k]?string}<#if k_has_next>,</#if>
            <#elseif form.formData[k]?is_number>
            <#– Render number data without the surrounding inverted commas and no formatting –>
            "${k}": ${form.formData[k]?c}<#if k_has_next>,</#if>
            <#else>
            <#– All other data rendered with inverted commas –>
            "${k}": "${form.formData[k]}"<#if k_has_next>,</#if>
            </#if>
            </#list>
        }

The json that is saved in the model for the view ftl is the following:


{
   "formData":{
      "prop_bpm_packageActionGroup":null,
      "prop_bpm_packageItemActionGroup":null
   },
   "item":"api/task-instances/jbpm$4",
   "type":"sirmawf:DRAReviewTaskAndDocument01",
   "submissionUrl":"/api/task/jbpm$4/formprocessor",
   "fields":[
      "org.alfresco.repo.forms.PropertyFieldDefinition@1adc141 (name=sirmawf:DRANeedSMETeamForReview, dataType=boolean, dataTypeParams=null, label=sirmawf:DRANeedSMETeamForReview, description=null, binding=null, defaultValue=null, dataKeyName=prop_sirmawf_DRANeedSMETeamForReview, group=null, protectedField=false, mandatory=true, repeats=false, constraints=null)",
      "org.alfresco.repo.forms.PropertyFieldDefinition@6acfc9 (name=sirmawf:DRAApproveDocument, dataType=boolean, dataTypeParams=null, label=sirmawf:DRAApproveDocument, description=null, binding=null, defaultValue=null, dataKeyName=prop_sirmawf_DRAApproveDocument, group=null, protectedField=false, mandatory=true, repeats=false, constraints=null)"
   ]
}
[/code]

And the problem comes when formData array is iterated where the values are null. But still I have no idea what I am doing wrong.

mikeh
Star Contributor
Star Contributor
Rather than trying to debug your problem from the exception traces it would be better to post the configuration you've changed and start from there.

Thanks,
Mike

amitev
Champ in-the-making
Champ in-the-making
I have share-config-custom.xml.


<config evaluator="task-type" condition="sirmawf:DRAReviewTaskAndDocument01">
      <forms>
         <form>
            <field-visibility>
               <show id="sirmawf:DRANeedSMETeamForReview" />
               <show id="sirmawf:DRAApproveDocument" />
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label="Tralala" />
               <field id="sirmawf:DRANeedSMETeamForReview" />
               <field id="sirmawf:DRAApproveDocument" />
            </appearance>
         </form>
      </forms>
</config>

Here is the data model:


<type name="sirmawf:DRAReviewTaskAndDocument01">
         <parent>bpm:task</parent>
         <properties>
            <property name="sirmawf:DRANeedSMETeamForReview">
               <type>d:boolean</type>
               <mandatory>false</mandatory>
            </property>
            <property name="sirmawf:DRAApproveDocument">
               <type>d:boolean</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
</type>

What other information should I provide?

amitev
Champ in-the-making
Champ in-the-making
It got fixed when i changed the parent of the task to bpm:workflowtask instead of bpm:task but I don't know why this was needed.