AnsweredAssumed Answered

Fail to load custom parse listener

Question asked by tony_dietrich on Apr 8, 2014
Latest reply on Apr 22, 2014 by jbarrez
During configuration of the Activiti engine I am attempting to load a custom parser.

The load fails with the following message:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'customPostBPMNParseListeners'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.kallik.wm.listeners.WorkflowManagerCustomParseListener] to required type [org.activiti.engine.impl.bpmn.parser.BpmnParseListener] for property 'customPostBPMNParseListeners[0]': no matching editors or conversion strategy found

The activiti.config.xml used is:

<?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="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> 
    <!– Database configurations –>
    <property name="databaseSchemaUpdate" value="true" />
    <property name="databaseType" value="oracle" />
    <property name="jdbcUrl" value="jdbc:oracle:thin:@*********" />
    <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver" />
    <property name="jdbcUsername" value="*****" />
    <property name="jdbcPassword" value="*******" />
   <property name="jobExecutorActivate" value="true" />
   <property name="history" value="full" />
   <!– Required to create a task listener that is executed on every task creation, completion, transition etc. –>
   <property name="customPostBPMNParseListeners">
      <list>
         <bean class="com.kallik.wm.listeners.WorkflowManagerCustomParseListener" />
      </list>
   </property>
  </bean>
</beans>

Although I don't think its getting this far, the class referred to is defined as follows:

public class WorkflowManagerCustomParseListener implements BpmnParseListener {
    private static final Logger log = Logger.getLogger(WorkflowManagerCustomParseListener.class);

    /**
     * {@inheritDoc}
     * <P>
     * Adds generic listeners for create, assignment and complete operations for all user tasks in the system.
     */
    public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {
        log.info("Adding listeners to all of the user tasks for workflow: " + scope.getProcessDefinition().getName());
        UserTaskActivityBehavior utab = (UserTaskActivityBehavior) activity.getActivityBehavior();
        log.info("Adding CandidateGroupRenamerListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("create", new CandidateGroupRenamerListener());
        log.info("Adding GenericUserTaskCreateListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("create", new GenericUserTaskCreateListener());
        log.info("Adding GenericUserTaskCompletedListener listener to all of the user tasks for workflow: "
                + scope.getProcessDefinition().getName());
        utab.getTaskDefinition().addTaskListener("complete", new GenericUserTaskCompletedListener());
    }


… no further concrete method implementations …

}

Can anyone give me any ideas to help solve this, please?

Outcomes