Hi there,
I have process definition that includes timer event. When timer elapse, flow is executing a tasks that executes java code.
Definition of that task includes:
Script Format: groovy
Script: MyClass.MyMethod(execution.getVariable("MY_VARIABLE"))
I am using Single "Engine - Shared Database" multi-tenancy functionality of acitiviti engine, and activity is running as part of java spring web application.
Following is how I build the activity deployment when application is started:
DeploymentBuilder deploymentBuilder =
repositoryService
.createDeployment()
.enableDuplicateFiltering()
.tenantId(currentTenantResolver.getCurrentTenantId())
.name(resource.getFilename());
Following is dependency definition in the pom file
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>6.0.0</version>
</dependency>
Following is the definition for the process definition
ProcessDefinition processDefinition =
repositoryService
.createProcessDefinitionQuery()
.processDefinitionKey(SIGNUP_PROCESS_KEY)
.processDefinitionTenantId(currentTenantResolver.getCurrentTenantId())
.latestVersion()
.singleResult();
My issue is that there are situations when engine is executing MyClass.MyMethod() for tenant different than the tenant that was used when activity was initiated and process definition was created.
I can see in the database that tenant_id is correctly set for the timer job record, as well as in all other connected records.
Can someone share more info about this. Is this expected behavior or some bug, or there is some wrong usage in my code.
Thanks
Hi there,
can you please specify the version that you are using?
It sounds like the job executor that is picking up Job is not taking into consideration the tenant Id? It sounds like something that should have been fixed already.
Hi Mauricio,
I am using activiti-spring package version 6.0.
Any idea what is the version where this issue was resolved?
Thanks for helping on this.
It might be that it is fixed in the 6.x branch in Github. You might want to try that.
Hi Mauricio,
I have updated activiti-spring package to version "7-201802-EA" (this looks like latest maven package version.
With this version i get error that package "org.activiti.engine.FormService" can not be found.
Do you know if this is something that was replaced or removed?
Thanks
Yeah a lot of things are changing in 7, so I wouldn't recommend you to use that unless you really know what is included in version 7.
I would recommend to clone the 6.x branch of the Activiti/Activiti repository, build that and try that.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.