<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: How to access process variable in ftl file?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/pmuthuraman">Muthuraman Panneerselvam</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/636166#636166">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Thanks Tihomir for the reply.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>My java code to start the process has the below.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table><tbody><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";">Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();</td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";">params.put("policyId", "testingpolicyId");</td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td></tr><tr><td style=";"><br/></td><td style=";"><br/></td><td style=";"><br/></td><td style=";">ksession.startProcess("voluntaryProcess", params);</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have added the variable "policyId" in the variable definition property of my process.&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/2-636166-17292/process.JPG"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2-636166-17292/450-254/process.JPG </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am using guvnor 5.1 and the designer version is 1.0.0.55.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When I tried to access my variable in the ftl file as ${policyId},&#160; I am getting the below error.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>freemarker.core.InvalidReferenceException: Expression policyId is undefined on line 19, column 18 in ApprovedTask.</p><p> freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)</p><p> freemarker.core.Expression.getStringValue(Expression.java:118)</p><p> freemarker.core.Expression.getStringValue(Expression.java:93)</p><p> freemarker.core.DollarVariable.accept(DollarVariable.java:76)</p><p> freemarker.core.Environment.visit(Environment.java:209)</p><p> freemarker.core.MixedContent.accept(MixedContent.java:92)</p><p> freemarker.core.Environment.visit(Environment.java:209)</p><p> freemarker.core.Environment.process(Environment.java:189)</p><p> freemarker.template.Template.process(Template.java:237)</p><p> org.jbpm.integration.console.forms.AbstractFormDispatcher.processTemplate(AbstractFormDispatcher.java:116)</p><p> org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:119)</p><p> org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:50)</p><p> org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)</p><p> org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)</p><p> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p> java.lang.reflect.Method.invoke(Method.java:597)</p><p> org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)</p><p> org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)</p><p> org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)</p><p> org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)</p><p> org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)</p><p> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)</p><p> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)</p><p> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)</p><p> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)</p><p> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)</p><p> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Can you please let me know what is wrong?&#160; Please let me know if you need any other information.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/636166#636166">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>