cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Spring autowiring within a Service Task

gaston
Champ in-the-making
Champ in-the-making
Hi all,
I'm having problems calling a Spring autowired Repository from a task. The idea is to have the Service Task call one of the methods of a Service. Problem is, after executing the service task, I'm getting an "Unknown property in expression" if using a delegateExpression (similar to what's mentioned in this other thread), or a null pointer exception, as a result of the @Autowired Repository in myService not being properly instantiated).

The Service Task is being run as
 
   activiti:delegateExpression="${myBeanServiceImpl}")

My service bean is as follows:

   @Service("myBeanServiceImpl")
   public class MyBeanServiceImpl implements JavaDelegate {

      @Autowired
      private TestServiceDummy serviceDummy;

      @Override
      public void execute(DelegateExecution execution) {
         serviceDummy.save(new User()); // <– NPE here, the userRepository is null when called. ie: not being properly autowired.
           }

   // Getters and Setters for the testServiceDummy omitted for brevity

   }



Here's my TestServiceDummyImpl:


   @Service(value="testServiceDummyImpl")
   @Transactional(readOnly = true)
   public class TestServiceDummyImpl implements TestServiceDymmy {
      
      @Autowired
      private UserRepository userRepository;
      
      @Override
      public User save(User user) {
         userRepository.save(user);
      }
      
      // Getters && Setters for the repository
   
   }   

And a simple JPARepository from SpringData


   public interface UserRepository extends JPARepository<User, Long> {
   }
   
The same thing works without problems when called from our webapp (calling the service as a @ManagedProperty works ok) so the embedded project's config seems to be ok.

And here's Activiti Explorer's applicationContext file:


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
   xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jpa="http://www.springframework.org/schema/data/jpa"
   xmlns:jee="http://www.springframework.org/schema/jee"

   xsi:schemaLocation="
         http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                  http://www.springframework.org/schema/tx
                  http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.1.xsd
         http://www.springframework.org/schema/data/jpa
         http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
         http://www.springframework.org/schema/jdbc
         http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
         http://www.springframework.org/schema/jee
         http://www.springframework.org/schema/jee/spring-jee-3.1.xsd">

   <context:property-placeholder location="classpath*:jdbc.properties" />

   <!– Scan this classpath for annotated components that will be auto-registered
      as Spring beans –>
   <context:annotation-config />

   <!– scan the embedded project's components –>
        <context:component-scan base-package="edu.bedelias.*" />

   <jpa:repositories base-package="edu.bedelias.repositories*" />

   <bean
      class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

   <!– Automatically translate hibernate/jpa exceptions into Spring's generic
      DataAccessException hierarchy for those classes annotated with Repository –>
   <bean
      class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />

   <!– JPA Entity Manager Factory –>
   <bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
      <property name="dataSource" ref="dataSource" />
      <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
      <property name="packagesToScan">
         <list>
            <value>edu.bedelias.*</value>
         </list>
      </property>
      <property name="jpaProperties">
         <props>
            <!– set HibernateJpaVendorAdapter's behavior: 'create' = build a new
               DB on each run; 'update' = modify an existing database; 'create-drop' = 'create'
               and also drops tables when Hibernate closes; 'validate' = makes no changes
               to the database –>
            <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
         </props>
      </property>
   </bean>

   <bean id="hibernateJpaVendorAdapter"
      class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
      <property name="showSql" value="true" />
      <property name="generateDdl" value="false" />
      <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
   </bean>

   <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
      destroy-method="close">
      <property name="driverClass" value="${jdbc.driverClass}" />
      <property name="jdbcUrl" value="${jdbc.jdbcUrl}" />
      <property name="user" value="${jdbc.user}" />
      <property name="password" value="${jdbc.password}" />
      <property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
      <property name="maxStatements" value="${jdbc.maxStatements}" />
      <property name="minPoolSize" value="${jdbc.minPoolSize}" />
   </bean>

   <!– Transaction Manager is defined –>
   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
      <property name="entityManagerFactory" ref="entityManagerFactory" />
      <property name="dataSource" ref="dataSource" />
   </bean>

   <!– Hijack the current @Session scope annotation on each @Service and make
      it last only for the duration of the thread –>
   <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
      <property name="scopes">
         <map>
            <entry key="session">
               <bean class="org.springframework.context.support.SimpleThreadScope" />
            </entry>
         </map>
      </property>
   </bean>

   <!– Enable the configuration of transactional behavior based on annotations –>
   <tx:annotation-driven />

   <bean id="dbProperties"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="location" value="classpath:db.properties" />
      <!– Allow other PropertyPlaceholderConfigurer to run as well –>
      <property name="ignoreUnresolvablePlaceholders" value="true" />
   </bean>

   <bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
      <property name="processEngine" ref="processEngine" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="true" />
      <property name="customFormTypes">
         <list>
            <ref bean="userFormType" />
         </list>
      </property>
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"
      destroy-method="destroy">
      <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="identityService" factory-bean="processEngine"
      factory-method="getIdentityService" />

   <bean id="activitiLoginHandler" class="org.activiti.explorer.ui.login.DefaultLoginHandler">
      <property name="identityService" ref="identityService" />
   </bean>

   <!– Include the UI-related wiring. This UI context will be used in the
      alfresco activiti admin UI –>
   <import resource="activiti-ui-context.xml" />

   <!– Custom form types –>
   <bean id="userFormType" class="org.activiti.explorer.form.UserFormType" />

</beans>
 

I've tried going for an "Expression" approach, as suggested [url=http://forums.activiti.org/en/viewtopic.php?f=8&t=3276&p=13020
]here and here to no avail.

If anyone is curious, the URL of the project is here: http://code.google.com/p/tecnoinf-activiti/source/browse/

Thanks in advance,

Gaston
18 REPLIES 18

frederikherema1
Star Contributor
Star Contributor
Do your spring-services work with the auto wiring, called from outside activiti-context?

gaston
Champ in-the-making
Champ in-the-making
Thanks for your reply, and yes, we're calling the same services from another webapp without issues. I even ran a couple of test cases trying to persist an entity, calling directly the services from within the Activiti Explorer project without issues.

IMO, problem seems to be the autowiring not being done when calling the beans from the activiti engine, which I'm guessing is a mistake I'm making when configuring the engine (not manually wiring the beans perhaps?)

Regards,

frederikherema1
Star Contributor
Star Contributor
When the ProcessEngineFactoryBeans is called, it passes on the application-context that is provided by spring into the expression-manager as-is. So no special handling is done with this context, so I'm sure the problems lies within the context initialization itself.

How do you extract the engine from the context?

gaston
Champ in-the-making
Champ in-the-making
Sorry for the late reply. I'm currently not extracting the engine from the context (just loading the process in Activiti explorer and calling the execute method). Is there something else I should be doing?

gaston
Champ in-the-making
Champ in-the-making
Ok, an update.

My problem seems to be related to Vaadin, as seen here.

I've noticed that when comparing a web project (which includes the same jar with the Spring annotated Services as the one I'm having trouble autowiring in Activiti Explorer2 app) and noticed I was missing this on the web.xml file:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
      classpath*:applicationContext.xml
     </param-value>
</context-param>
As soon as I add that, the Explorer fails to start and I'm greeted with:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.activiti.explorer.ExplorerApp] is defined: expected single bean but found 0:
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:276)

Digging through the code, and following the advice on the previous SO thread, I'm fairly certain that ExplorerApplicationServlet should be dealing with this without any problems. I'm a complete noob and haven't touched anything Vaadin related in the past, so perhaps I'm missing something else entirely?

Thanks for your time (and patience Smiley Very Happy )

Gaston

jbarrez
Star Contributor
Star Contributor
You also need activiti-ui-context.xml to be included, that's where the ExplorerApp bean is defined.

gaston
Champ in-the-making
Champ in-the-making
You also need activiti-ui-context.xml to be included, that's where the ExplorerApp bean is defined.

Here's my applicationContext.xml :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"

        xsi:schemaLocation="
                        http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/tx
            http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.1.xsd
                        http://www.springframework.org/schema/jdbc
                        http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
                        http://www.springframework.org/schema/jee
                        http://www.springframework.org/schema/jee/spring-jee-3.1.xsd">

        <!– <import resource="classpath*:/activiti.cfg.xml" /> –>
        <import resource="classpath*:/applicationContextCore.xml" />
        <contextSmiley Tongueroperty-placeholder location="classpath*:jdbc.properties" />

        <!– Scan this classpath for annotated components that will be auto-registered
                as Spring beans –>
        <context:annotation-config />
        <context:spring-configured />

        <context:component-scan base-package="edu.bedelias.*" />

        <bean
                class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

        <!– Automatically translate hibernate/jpa exceptions into Spring's generic
                DataAccessException hierarchy for those classes annotated with Repository –>
        <bean
                class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />

        <!– JPA Entity Manager Factory –>
        <bean id="entityManagerFactory"
                class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
                <property name="packagesToScan">
                        <list>
                                <value>edu.bedelias.*</value>
                        </list>
                </property>
                <property name="jpaProperties">
                        <props>
                                <!– set HibernateJpaVendorAdapter's behavior: 'create' = build a new
                                        DB on each run; 'update' = modify an existing database; 'create-drop' = 'create'
                                        and also drops tables when Hibernate closes; 'validate' = makes no changes
                                        to the database –>
                                <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
                        </props>
                </property>
        </bean>

        <bean id="hibernateJpaVendorAdapter"
                class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="true" />
                <property name="generateDdl" value="false" />
                <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
        </bean>

        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
                destroy-method="close">
                <property name="driverClass" value="${jdbc.driverClass}" />
                <property name="jdbcUrl" value="${jdbc.jdbcUrl}" />
                <property name="user" value="${jdbc.user}" />
                <property name="password" value="${jdbc.password}" />
                <property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
                <property name="maxStatements" value="${jdbc.maxStatements}" />
                <property name="minPoolSize" value="${jdbc.minPoolSize}" />
        </bean>

        <!– Transaction Manager is defined –>
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
                <property name="entityManagerFactory" ref="entityManagerFactory" />
                <property name="dataSource" ref="dataSource" />
        </bean>

        <!– Hijack the current @Session scope annotation on each @Service and make
                it last only for the duration of the thread –>
        <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
                <property name="scopes">
                        <map>
                                <entry key="session">
                                        <bean class="org.springframework.context.support.SimpleThreadScope" />
                                </entry>
                        </map>
                </property>
        </bean>

        <!– Enable the configuration of transactional behavior based on annotations –>
        <tx:annotation-driven />

        <!– <bean id="dbProperties" –>
        <!– class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> –>
        <!– <property name="location" value="classpath:db.properties" /> –>
        <!– Allow other PropertyPlaceholderConfigurer to run as well –>
        <!– <property name="ignoreUnresolvablePlaceholders" value="true" /> –>
        <!– </bean> –>

        <bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator">
                <property name="processEngine" ref="processEngine" />
        </bean>

        <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
                <property name="dataSource" ref="dataSource" />
                <property name="transactionManager" ref="transactionManager" />
                <property name="databaseSchemaUpdate" value="true" />
                <property name="jobExecutorActivate" value="true" />
                <property name="customFormTypes">
                        <list>
                                <ref bean="userFormType" />
                        </list>
                </property>
        </bean>

        <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"
                destroy-method="destroy">
                <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="identityService" factory-bean="processEngine"
                factory-method="getIdentityService" />

        <bean id="activitiLoginHandler" class="org.activiti.explorer.ui.login.DefaultLoginHandler">
                <property name="identityService" ref="identityService" />
        </bean>

        <!– Include the UI-related wiring. This UI context will be used in the
                alfresco activiti admin UI –>
        <import resource="activiti-ui-context.xml" />

        <!– Custom form types –>
        <bean id="userFormType" class="org.activiti.explorer.form.UserFormType" />

</beans>
I've left the import of the activiti-ui-context.xml as in the sample file, does it need to be included somewhere else?

Just in case, here's the web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="WebApp_ID" version="2.5">
        <display-name>Vaadin Web Application</display-name>

        <context-param>
                <description>Vaadin production mode</description>
                <param-name>productionMode</param-name>
                <param-value>true</param-value>
        </context-param>

<!– with this context-param Activiti explorer won't start –>
        <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>
              classpath*:applicationContext.xml
<!– should I be including the activiti-ui-context here? –>
                </param-value>
        </context-param>

  <!– To load the Spring context –>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

  <!– To allow session-scoped beans in Spring –>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>

        <servlet>
                <servlet-name>Vaadin Application Servlet</servlet-name>
                <servlet-class>org.activiti.explorer.servlet.ExplorerApplicationServlet</servlet-class>
        </servlet>
      
        <servlet-mapping>
                <servlet-name>Vaadin Application Servlet</servlet-name>
                <url-pattern>/*</url-pattern>
        </servlet-mapping>

        <!– Session timeout on one day –>
        <session-config>
                <session-timeout>480</session-timeout>
        </session-config>


</web-app>
 

As per the activiti-ui-context.xml file, I just modified the param ${activiti.ui.environment} for 'activiti', the rest remains unchanged.
Here's the code:


<?xml version="1.0" encoding="UTF-8"?>
<beans
        xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jee="http://www.springframework.org/schema/jee"
        xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
        http://www.springframework.org/schema/jee
        http://www.springframework.org/schema/jee/spring-jee-3.1.xsd">

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" name="activitiUiPropertyPlaceholder">
    <property name="location" value="classpath:ui.properties" />
    <!– Allow other PropertyPlaceholderConfigurer to run as well –>
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
  </bean>

  <!– Global scoped beans –>

  <bean name="navigatorManager" class="org.activiti.explorer.navigation.NavigatorManager" />

  <bean name="attachmentRendererManager" class="org.activiti.explorer.ui.content.AttachmentRendererManager" />
  
  <!– Custom form property renderers can be plugged in here –>
  <bean id="formPropertyRendererManager" class="org.activiti.explorer.ui.form.FormPropertyRendererManager" lazy-init="true">
    <!– Default renderer –>
    <property name="noTypePropertyRenderer">
      <bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
    </property>
    <!– Renderers by property type –>
    <property name="propertyRenderers">
      <list>
        <bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.EnumFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.LongFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.DateFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.UserFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.BooleanFormPropertyRenderer" />
      </list>
    </property>
  </bean>

  <!– Variable value rendering –>
  <bean id="variableRendererManager" class="org.activiti.explorer.ui.variable.VariableRendererManager" />

  <bean name="componentFactories" class="org.activiti.explorer.ComponentFactories">
    <property name="environment" value="activiti" />
  </bean>

<!– value="${activiti.ui.environment} –>

  <!– User cache usage depends on environment, hence the faactory approach –>
  <bean name="userCache" class="org.activiti.explorer.cache.UserCacheFactoryBean">
    <property name="environment" value="activiti" />
  </bean>

<!–   ${activiti.ui.environment} –>

  <!– Session scoped UI beans –>

  <bean name="navigationFragmentChangeListener" class="org.activiti.explorer.navigation.NavigationFragmentChangeListener" scope="session">
    <property name="navigatorManager" ref="navigatorManager" />
  </bean>

  <bean name="mainWindow" class="org.activiti.explorer.ui.MainWindow" scope="session">
    <property name="navigationFragmentChangeListener" ref="navigationFragmentChangeListener" />
    <property name="i18nManager" ref="i18nManager" />
  </bean>

<!–   ${activiti.ui.environment} –>
  <bean name="explorerApp" class="org.activiti.explorer.ExplorerApp" scope="session">
    <property name="environment" value="activiti" />
    <property name="userCache" ref="userCache" />
    <property name="i18nManager" ref="i18nManager" />
    <property name="viewManager" ref="viewManager" />
    <property name="notificationManager" ref="notificationManager" />
    <property name="attachmentRendererManager" ref="attachmentRendererManager" />
    <property name="formPropertyRendererManager" ref="formPropertyRendererManager" />
    <property name="variableRendererManager" ref="variableRendererManager" />
    <property name="applicationMainWindow" ref="mainWindow" />
    <property name="componentFactories" ref="componentFactories" />
    <property name="loginHandler" ref="activitiLoginHandler" />
  </bean>

  <bean name="i18nManager" class="org.activiti.explorer.I18nManager" scope="session" />

  <bean name="notificationManager" class="org.activiti.explorer.NotificationManager" scope="session">
    <property name="mainWindow" ref="mainWindow" />
    <property name="i18nManager" ref="i18nManager" />
  </bean>

  <bean name="viewManager" class="org.activiti.explorer.ViewManagerFactoryBean" scope="session">
    <property name="mainWindow" ref="mainWindow" />
    <property name="environment" value="activiti" />
  </bean>
<!–   ${activiti.ui.environment} –>

</beans>

Thanks,

Edit:

Somewhat related?
http://forums.activiti.org/en/viewtopic.php?f=9&t=4741

jbarrez
Star Contributor
Star Contributor
Yet again, I don't see you importing the activiti-ui-context.xml anywhere in your root applicationContext.xml?

Am I reading it that bad? Can you paste the section where you do it?

gaston
Champ in-the-making
Champ in-the-making
Yet again, I don't see you importing the activiti-ui-context.xml anywhere in your root applicationContext.xml?

Am I reading it that bad? Can you paste the section where you do it?

It's right there Smiley Tongue


<!– Include the UI-related wiring. This UI context will be used in the
      alfresco activiti admin UI –>
   <import resource="activiti-ui-context.xml" />