what 'other way of refering'? What is your current way? It should be referred to from the processdefinition. Look at the examples how to do this
I have poured over the examples and none of them detail how to reference a freemarker template if uploaded via the "addResourceFromFile" method. What I meant by "other way of refering" is that freemarker templates are typically given a path relative to the class path when using the "form" attribute in a process definition.
1 of 1 people found this helpful
first of all I would like to suggest reading Task forms section of dev guide if you haven't done that yet - http://docs.jboss.com/jbpm/v4/devguide/html_single/#taskforms
In my opinion resources (including task forms) are stored in database and they will be referenced by classpath relative path on runtime.
You could try to check if the data base entry has correct name. Task forms are retrieved from data base using following method:
// check if a template exists String name = task.getFormResourceName(); InputStream template = repoService.getResourceAsStream(procDef.getDeploymentId(), name);
and if templete is null it will throw the exception you mentioned.
So, possible issue could be:
1. template is not deployed due to not being compliant with rules defined in dev guide (mainly ftl extension)
2. name is different than expected (can be checked on Task object by inspecting formResourceName field
Thanks for the reply. I've read the jBPM documentation (both User and Developer's Guide) from start to finish. The "task form" section does not offer any insight into this issue. In the past, I have been able to successfully use templates, but only when creating the ProcessEngine outside of JBoss.
I will attempt to pull the form using the code you have submitted to see if it is returning null from the api. I will update this forum when I get the results.