AnsweredAssumed Answered

Access SpringProcessEngineConfiguration in rest-webapp

Question asked by b.schnarr on May 9, 2014
Latest reply on May 27, 2014 by b.schnarr
Hello at all,

I need to inject custom configuration parameters into the rest webapp. Therefore, I want to use the existing activiti-context.xml and the processEngineConfigurationBean. But I do not succeed in accessing the processEngineConfigurationBean.
In another post, there is written: "You can always access the Spring application context and get the configuration bean from that."
But as I am not a skilled java developer, this information is not enough.

Could someone give me a little code example how I can read in those config parameters within a rest-class? Lets say I extend the standard 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="mailServerHost" value="localhost" />
      <property name="mailServerPort" value="5025" />
      <property name="jobExecutorActivate" value="false" />
        <property name="customFormTypes">
          <list>
            <bean class="org.activiti.rest.form.UserFormType"/>
            <bean class="org.activiti.rest.form.ProcessDefinitionFormType"/>
            <bean class="org.activiti.rest.form.MonthFormType"/>  
          </list>
        </property>
   </bean>


with the two parameters ltpaKey and ltpaPassword:


<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="mailServerHost" value="localhost" />
      <property name="mailServerPort" value="5025" />
      <property name="jobExecutorActivate" value="false" />
               <property name="ltpaKey" value="****" />
               <property name="ltpaPassword" value="***" />
        <property name="customFormTypes">
          <list>
            <bean class="org.activiti.rest.form.UserFormType"/>
            <bean class="org.activiti.rest.form.ProcessDefinitionFormType"/>
            <bean class="org.activiti.rest.form.MonthFormType"/>  
          </list>
        </property>
   </bean>


How can I access those values in the rest-classes?

Thank you very much and best regards
Ben

Outcomes