cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify a tenantID for processEngineConfiguration.deploymentResources bean property in spring xml configuration

bgitaadji
Champ in-the-making
Champ in-the-making
Hello,
  How do I specify a tenantID for processEngineConfiguration.deploymentResources bean property in xml configuration (deploying using spring config xml) ?

Below is a snippet of my config xml:

<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="deploymentName" value="BGDeployment" />
         <property name="deploymentMode" value="single-resource" />
         <property name="deploymentResources">
            <list>
               <value>classpath*:/bpmn/workcode/WorkCodeAckCancel_SubProc.bpmn</value>               
            </list>
         </property>
  </bean>
4 REPLIES 4

bgitaadji
Champ in-the-making
Champ in-the-making
repost the snippet of spring config xml:

<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="deploymentName" value="BGDeployment" />
   <property name="deploymentMode" value="single-resource" />
   <property name="deploymentResources">
    <list>
     <value>classpath*:/bpmn/workcode/WorkCodeAckCancel_SubProc.bpmn</value>    
    </list>
   </property>
  </bean>

jbarrez
Star Contributor
Star Contributor
You can't, that's a feature we don't have yet.
You would have to use 'manual' deployment (via the API) when you want to use the tenantId.

bgitaadji
Champ in-the-making
Champ in-the-making
ok, is it safe and will work properly to use a combination Spring config xml (processEngineConfiguration.deploymentResources) follow with Java RepositoryService.changeDeploymentTenantId() call to update/set the empty tenantId during the boot up cycle of our web ap (Activiti runtime jar is embedded in this web-app)

Thanks

jbarrez
Star Contributor
Star Contributor
Yes, that should work as far as I can see.
The alternative is that you write your own listener for spring that takes care of deployment (and passes the tenantId directly)