cancel
Showing results for 
Search instead for 
Did you mean: 

'ActivitiException: Unknown property' usinig Call Activity

alef
Champ in-the-making
Champ in-the-making
Hi all,
I'm using a Call Activity element in order define a reusable process definition which is common to several process.
This subprocess try to execute an operation, an in case of failure it retries the action until success.
The problem is that after some retries the following exception is thrown:
org.activiti.engine.ActivitiException: Unknown property used in expression: #{msisdnLockManager.lockMSISDN(action)} 


Invocation of msisdnLockManager.lockMSISDN(action) method works for some times before have the exception.
As you can see below
msisdnLockManager
bean  is correctly declared and passed to
ProcessEngineConfiguration
.

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="dbTransactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="asyncExecutorEnabled" value="false" />
      <property name="asyncExecutorActivate" value="false" />   
      <property name="jobExecutorActivate" value="true" />      
      <property name="beans">
         <map>
            <entry key="msisdnLockManager" value-ref="msisdnLockManager" />
            <entry key="wfCreateOrder" value-ref="wfCreateOrder" />
         </map>
      </property>
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

   <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
   <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />

   <!– BEGIN:Workflow components –>
   <bean id="msisdnLockManager" class="my.package.workflow.MSISDNLockManager" />
   <bean id="wfCreateOrder" class="my.package.workflow.processor.WFCreateOrder" />
   <!– END:Workflow components –>

</beans>


Both the diagram are uploaded below. Subprocess is LockMSISDNProcess.bpmn file.

Could anyone help me to understand where is the problem?
Thanks in advance.


13 REPLIES 13

jbarrez
Star Contributor
Star Contributor
> Could you please test it using an application server?

Not immediately, running a unit test is one thing, but setting up an application server with a specific config takes quite some time. If I'd do that for every issue here, the forum would be my day job …

> It seems that the executor cannot reference the bean.

I don't think it's due to the executor. I thinks it's the classloader of Weblogic screwing it up and not acting like a normal JDK would do.

alef
Champ in-the-making
Champ in-the-making
For your information, if I put all in a single diagram I have the same problem. Sometimes I have the exception "Unknown property used in expression: #{subProcess.doStuff(action)}".
It seems that after the first retries the executor cannot references the bean anymore.

alef
Champ in-the-making
Champ in-the-making
If you have an application server installed it's just matter of change the database configuration to run it.

Anyway, I run the application on Tomcat and Jetty. I don't see anymore the exception, but the execution stops after one or two retries.
The execution remains blocked on the receive task, as you can see in the attachement.

Moreover, when the executor can perform more than one retry, the Time Duration of PT10S is not respected.

<code>INFO  10:33:47,574 org.activiti.test.ProcessActivator - Starting activiti process…
INFO  10:33:48,017 org.activiti.test.SubProcess - Action: someValue
INFO  10:33:48,048 org.activiti.test.ProcessActivator - Activiti process started with id 20001
INFO  10:34:00,081 org.activiti.test.SubProcess - Action: someValue
INFO  10:34:35,040 org.activiti.test.SubProcess - Action: someValue</code>

jbarrez
Star Contributor
Star Contributor
I tried it here on a tomcat 7, and changed the config to use the new async executor:

<code>
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
        <property name="driverClass" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://127.0.0.1:3306/forum?characterEncoding=UTF-8"/>
        <property name="username" value="alfresco"/>
        <property name="password" value="alfresco"/>
    </bean>

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  <property name="dataSource" ref="dataSource" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="databaseSchemaUpdate" value="drop-create" />
  <property name="asyncExecutorEnabled" value="true" />
  <property name="asyncExecutorActivate" value="true" />
  <property name="jobExecutorActivate" value="false" /> 
  <property name="beans">
   <map>
    <entry key="subProcess" value-ref="subProcess" />
    <entry key="mainProcess" value-ref="mainProcess" />
   </map>
  </property>
</bean>
</code>

This works:

<code>
Thu Apr 09 11:13:45 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:14:05 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:14:25 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:14:45 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:15:05 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:15:25 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:15:45 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:16:05 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:16:25 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:16:45 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:17:05 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:17:26 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:17:46 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:18:06 CEST 2015 : SubProcess: Action: someValue
Thu Apr 09 11:18:26 CEST 2015 : SubProcess: Action: someValue
</code>

Note that there is a bug showing here: the duration is doubled (this was fixed a couple of weeks ago). So I tested with a local build of master (and changed defaultTimerJobAcquireWaitTimeInMillis to 1 second instead of 10S, as this could skew the results here cause the timer is set to 1 second)

<code>
Starting activiti process…
Thu Apr 09 11:56:11 CEST 2015 [main]  : SubProcess: Action: someValue
Activiti process started with id 8
DONE
Thu Apr 09 11:56:21 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
Thu Apr 09 11:56:31 CEST 2015 [pool-1-thread-2]  : SubProcess: Action: someValue
Thu Apr 09 11:56:41 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
Thu Apr 09 11:56:51 CEST 2015 [pool-1-thread-2]  : SubProcess: Action: someValue
Thu Apr 09 11:57:01 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
Thu Apr 09 11:57:11 CEST 2015 [pool-1-thread-2]  : SubProcess: Action: someValue
Thu Apr 09 11:57:21 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
Thu Apr 09 11:57:31 CEST 2015 [pool-1-thread-2]  : SubProcess: Action: someValue
Thu Apr 09 11:57:41 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
Thu Apr 09 11:57:51 CEST 2015 [pool-1-thread-2]  : SubProcess: Action: someValue
Thu Apr 09 11:58:01 CEST 2015 [pool-1-thread-1]  : SubProcess: Action: someValue
</code>

I also added   variables.put("lockResult", false);. When I enabled logging, I could see the property was missing. I don't know how you add it, so I simply added it to the start to keep looping.

Do note that I cleaned the db before I ran this. Old jobs will have an influence of course.