Rovo (12) [Avatar] Offline

I tried to deploy and run the book order example from the svn on camunda fox and after submitting a new order I get a PropertyNotFoundException: Cannot resolve identifier 'bookOrderTask' - the code is unchanged and I used "mvn clean package" (mvn clean install produces the same war-file) to build the war-file

Moreover, in the book on page 227 it is explained that on extending from JndiProcessEngineLookup we can make use of camunda fox's process engine - but the activit-cdi module does not provide this class in my case (version 5.9) and the full class name is not provided in the book too.

As includes an experimental comment I guess this feature will be available in the next version?

So, what am I missing here? In my opinion this Exception is raised on invoking the validateTask service task (<serviceTask id="validateTask" activiti:expression="#{bookOrderTask.validate()}" />smilie as this is the first time the bookOrderTask is invoked. The other CDI classes seem to work as currentUser.username is set inside taskList.jsf automatically.

Kind regards,
tijs.rademakers (494) [Avatar] Offline
Re: C9.2.2 PropertyNotFoundException: Cannot resolve identifier 'bookOrderTask'

I just ran the example on a JBoss 7.1 server and that works fine. Which version of Camunda fox are you using?
You're right that the JndiProcessEngineLookup class is not present anymore in the Activiti CDI module, it was before. You can see it here:

I can see if I can add that JNDI lookup class again to trunk.

Best regards,

Rovo (12) [Avatar] Offline
Re: C9.2.2 PropertyNotFoundException: Cannot resolve identifier 'bookOrderTask'
Hi Tijs,

I do run camunda fox ce version: 1.22.0 jboss as server version: 7.1.0.Final

Eclipse is showing me version number 319 for the project and the pom. I build the war-file using 'mvn clean package' and deploy the war-file into %CAMUNDA_FOX%/jboss-as-7.1.0.Finalstandalonedeployments directory where the deployment does not produce any errors. On runing maven I'll get some warnings due to missing version settings or missing encoding definitions (Platform encoding is Cp1252) and a web.xml file which is ignored as a web.xml file is already present

Maven improvements:
<!-- Remove platform dependency warning -->
<!-- Avoid warnings of ignoring web.xml file as it already exists -->

I see the bookorder task and the link to start the process. After clicking on the link I get forwarded to the page where I have to enter an ISBN-number (6 numbers). On clicking the submit-button I'll end up with

javax.servlet.ServletException: org.activiti.engine.ActivitiException: Unknown property used in expression

root cause

org.activiti.engine.ActivitiException: Unknown property used in expression
root cause

org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'bookOrderTask'

At the moment I try to integrate Activiti in a JSF based web application - without any application server, so no CDI available (so only using Tomcat) - the book-cdi-app is only to see how things work together. I therefore have created a singleton class which holds the reference to the Activiti Engine which gets referenced as a managed bean in the faces-config.xml. This is working as intended (I can start the process and get the process id in return) but I'm a bit unsure on how to set the navigation to show the page for the current task as defined in the process description, f.e. I have defined:

<!-- inside a sub-process -->
<startEvent id="startevent2" name="Start" />
<userTask id="getAddress" name="get address" activiti:assignee="kermit" activiti:formKey="addressForm.jsf">
<!-- <br /> <extensionElements> <br /> <activiti:formProperty id="firstName" name="First Name" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="lastName" name="Last name" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="street" name="Street" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="zip" name="Zip-Code" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="city" name="City" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="country" name="Country" type="string" required="true"></activiti:formProperty> <br /> <activiti:formProperty id="telNo" name="Telephone" type="string" required="false"></activiti:formProperty> <br /> </extensionElements> <br /> -->

So after starting the process via:
Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put(some_var, someValue);
RuntimeService runtimeService = ActivitiEngine.getInstance(processDescription).getProcessEngine().getRuntimeService();
ProcessInstance instance = runtimeService.startProcessInstanceByKey(processName, variableMap);

how do I retrieve the addressForm.jsf and set the navigation in jsf to show this page?

A solution that would come to my mind is to call the FormService inside the backing bean and just insert the values taken from the jsf page (uncommenting the extensionElements therefore) and use simple navigation definitions inside the faces-config.xml and do the navigations myself. I will use this approach only if I'm unable to show the page defined in the process description as this will introduce further required handling in case the execution is non-linear (xor or loops) which does make the Activiti definition somehow redundant as the actual navigation has to be defined in jsf too.

Thank you for your input so far,


EDIT: found a way to retrieve the formKey in the process definition via: processEngine.getFormService().getTaskFormData(task.getId()).getFormKey()