cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot see process progress and/or task status

jherryft
Champ in-the-making
Champ in-the-making
Hello, here is my configuration:

   <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
      <property name="targetDataSource">
         <bean class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver" />
            <property name="url" value="jdbc:mysql://localhost:3306/activity" />
            <property name="username" value="activity" />
            <property name="password" value="activity" />
            <property name="defaultAutoCommit" value="false" />
         </bean>
      </property>
   </bean>

   <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="false" />
   
   <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource"></property>
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="databaseType" value="mysql" />
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="true" />
      <property name="history" value="full" />
   </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" />
   <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
   <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
   <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />

   <bean id="activitiRule" class="org.activiti.engine.test.ActivitiRule">
      <property name="processEngine" ref="processEngine" />
   </bean>
My code:

   @Test
   @Deployment(resources = {"example.bpmn20.xml"})
   public void simpleProcessTest() {
      
      Map<String, Object> variables = new HashMap<String, Object>();
      variables.put("foo", "bar");

      ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("activateProcess", variables);
     
      Assert.assertTrue(processInstance.isEnded());
   }
The process is quite long but I cannot see anything in history neither in runtime database. I would like to see the progress in Probe but it also display nothing, it does not see any task… What am I doing wrong?
Thank you.
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
The unit-test clears the process-engine when the tests is finished, so it's normal you don't see anything in your DB. You can just assert if history is available in the test itself…

jherryft
Champ in-the-making
Champ in-the-making
I know but the thing is that I don't see anything during the process. I can only see something when process is stoped on a user task (I only have serviceTask).

frederikherema1
Star Contributor
Star Contributor
Thats the way activiti works. Between 2 wait-states (eg. task) or process-end , the same db-transaction  is used which is only commited when a wait-state (or process end) is reached.

So all changed done in a single execution will be rolled back when an exception occurs in one of the steps.