JBoss Community

Re: How to access process variable in ftl file?

created by Muthuraman Panneerselvam in jBPM - View the full discussion

Thanks Tihomir for the reply.

 

My java code to start the process has the below.

 




Map<String, Object> params = new HashMap<String, Object>();



params.put("policyId", "testingpolicyId");







ksession.startProcess("voluntaryProcess", params);

 

I have added the variable "policyId" in the variable definition property of my process. 

 

 http://community.jboss.org/servlet/JiveServlet/downloadImage/2-636166-17292/450-254/process.JPG

 

 

 

I am using guvnor 5.1 and the designer version is 1.0.0.55.

 

When I tried to access my variable in the ftl file as ${policyId},  I am getting the below error.

 

freemarker.core.InvalidReferenceException: Expression policyId is undefined on line 19, column 18 in ApprovedTask.

freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)

freemarker.core.Expression.getStringValue(Expression.java:118)

freemarker.core.Expression.getStringValue(Expression.java:93)

freemarker.core.DollarVariable.accept(DollarVariable.java:76)

freemarker.core.Environment.visit(Environment.java:209)

freemarker.core.MixedContent.accept(MixedContent.java:92)

freemarker.core.Environment.visit(Environment.java:209)

freemarker.core.Environment.process(Environment.java:189)

freemarker.template.Template.process(Template.java:237)

org.jbpm.integration.console.forms.AbstractFormDispatcher.processTemplate(AbstractFormDispatcher.java:116)

org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:119)

org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:50)

org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)

org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:597)

org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)

org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)

org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)

org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)

org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)

org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)

org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)

org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

 

 

 

 

Can you please let me know what is wrong?  Please let me know if you need any other information.

Reply to this message by going to Community

Start a new discussion in jBPM at Community