cancel
Showing results for 
Search instead for 
Did you mean: 

PropertyNotFoundException in form

kaech
Champ in-the-making
Champ in-the-making
I am trying to map JavaBean properties to form properties as described in the user guide.

<userTask id="order" name="order" activiti:formKey="order.form">
<documentation>order</documentation>      
<extensionElements>
<activiti:formProperty id="quantity" variable="quantity" expression="#{order.quantity}" required="true" type="long" />
</extensionElements>

</userTask>

In the form I always get a javax.el.PropertyNotFoundExeption for the property quantity.
In ACT_RU_VARIABLE I only see the serialized JavaBean.
${order.quantity} is available in the form but ${quantity} is not.

Do you have any advice?
31 REPLIES 31

kaech
Champ in-the-making
Champ in-the-making
Is it really necessary to change the source code?
I added the new form type to activiti.cfg.xml as you descibed earlier, but it doesn't seem to work.
I changed the configuration in ..\webapps\activiti-rest\web-inf\lib\activiti-cfg.jar
Is this the right place?

The error is raised during deployment.

frederikherema1
Star Contributor
Star Contributor
No, it's not necessary to change source-code, just showed an extract of how the form-property types are determined in the engine.

Can you paste your config file?

kaech
Champ in-the-making
Champ in-the-making
Here you go.

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="orderFormType" class="org.example.OrderFormType"/>
       
  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
 
    <property name="jobExecutorActivate" value="true" />
    <property name="history" value="audit" /> 

    <property name="customFormTypes">
       <list>
         <ref bean="orderFormType"/>
       </list>
    </property> 
   
    <!– Database configurations –>
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jdbcUrl" value="jdbc:h2:tcp://localhost/activiti" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />
   
    <property name="jobExecutorActivate" value="true" />

    <property name="dbCycleUsed" value="true" />
   
  </bean>

</beans>

kaech
Champ in-the-making
Champ in-the-making
I still can't get it to work.
Any news on that?

frederikherema1
Star Contributor
Star Contributor
How do you load your process-engine? The configuration-file you pasted above can never work, since it contains duplicate 'jobexecutor' property:

Configuration problem: Multiple 'property' definitions for property 'jobExecutorActivate'
Offending resource: resource loaded through InputStream
Bean 'processEngineConfiguration'

So I guess the engine you are using isn't the one you think it is Smiley Wink

kaech
Champ in-the-making
Champ in-the-making
Oh, I overlooked the jobexecutor setting.
I am using the engine integrated in the Tomcat installation and deploy the process via the Explorer. I updated the activiti.cgf.xml in the activiti-rest application inside the Tomcat webapps directory.

Which config file do I have to update to apply the config changes?

frederikherema1
Star Contributor
Star Contributor
The activiti.cfg.xml in the activiti.cfg.jar in webapps/activiti-rest/WEB-INF/lib/. In activiti probe, you can see which engine is used (on start page), this includes the resource it was initialized from. Check this, should be the one in aciviti.cfg.lib$activiti.cfg.xml

kaech
Champ in-the-making
Champ in-the-making
The configuration issue is solved now. Thank you.

In the meantime I installed Activiti 5.4. cause it is supposed to expose form properties via activiti-rest.
Unfortunately the original problem is still there.

This is what I did:

I am exposing the following form property in a userTask:

<activiti:formProperty id="thequantity" expression"#{order.form}"/>

When calling http://.../activiti-rest/service/task/<taskid>/form

I am getting PropertyNotFoundException: Cannot find property thequantity

Actually the whole scenario is very simple.
Do you have an idea what could be wrong here?

kaech
Champ in-the-making
Champ in-the-making
In the 5.4 release, they are  You shouldn't use the *.form files (and formKey) if you want external rendering

Does that mean I need to remove the formKey attribute to make it work?

kaech
Champ in-the-making
Champ in-the-making
I tried to remove the formkey attribute from the user task.
Now I get a WebScriptException: There is no form for task …
Of course, that is what I expected.

To summarize what I am trying to do:

1. Connect a client which has no access to the Activiti API.
2. Connect the client via activiti-rest.
3. Use an existing JavaBean as process model.
4. Serialize the Java Bean using a custom form type class.
4. Expose parts of the JavaBean as form properties to get access in the client.

After all my investigation it seems that <activiti:formProperty …> is not yet properly supported in Activiti. Currently there seems to be no way to combine external clients in case the form properies differ from the process properties.

I think in non trivial enterprise environments it is very important to be able to modify complex (JavaBeans based) process models using arbitrary clients via REST.

Is there a roadmap for that?
If not, what is you suggestion for those kinds of scenarios?