cancel
Showing results for 
Search instead for 
Did you mean: 

Multi tenancy support

feldmani
Champ in-the-making
Champ in-the-making
Hi,
I would like to install the Activiti engine embedded in an application that supports multi-tenant environment (offering a Software As A Service for several customers on the same DB).
Is there a way / somebody who already did this?

thanks,
Nir
31 REPLIES 31

jpalomaki
Champ in-the-making
Champ in-the-making
Thanks for the information. In our case tenants do actually share the definitions, so this should not be a problem.

l_marinkov
Champ in-the-making
Champ in-the-making
I would like to ask if support for multi tenancy is planned to be implemented in future activiti versions? Thx

heymjo
Champ on-the-rise
Champ on-the-rise
i have created a jira issue with some initial thoughts in it

http://jira.codehaus.org/browse/ACT-872

feel free to add your requirements or ideas, and maybe if there are enough votes someone will step up and do this. I don't think it is that hard from a technical point of view, you just need to get it right and transparent to those that don't want multi-tenancy.

ingo_ri
Champ in-the-making
Champ in-the-making
My comment on this (here and in in JIRA http://jira.codehaus.org/browse/ACT-872😞

We also need support for multiple tenants in one database. In our application we have a column tenantId in every database table. And we set the tenantId from the application.

To support an optional multi-tenant-environment in Activiti I would suggest to add some new start methods with an additional parameter 'tenantId'.

The activiti engine propagates this optional value to every row that belongs to this processinstance in all ACT_RU- and ACT_HI-tables without database triggers. Every instantiated task and activity gets this value, too. Every table should get an additional nullable column tenant_id_ varchar(64).

When a transition gets fired, it propagates the tenantId to the following activities or jobs, if a deadline is reached.

The default process definitions are for all tenants and some tenants build their own definitions. There sould be a parameter tenantId in the deployment-service.

We use our own identity-management, so no need for improvement here.

But for Demos, there should be a tenantId in the user tables too. This tenantId should be used in the application to query for tasklists etc.

This approach allows restricted access to tasks and processinstances over the api.

Is it sufficient for an open source superdeluxe workflow engine?

inoko
Champ in-the-making
Champ in-the-making
the jira issue(http://jira.codehaus.org/browse/ACT-872) was resolved?
So, multi tenancy isn't planed to be implemented on Activiti?

trademak
Star Contributor
Star Contributor
Multi tenancy can be achieved in Activiti by setting a specific process variable that you can use in a query. Currently we don't have plans to support multi tenancy in another way, but if there's an interest in that in the community then we can rethink that of course.

Best regards,

inoko1
Champ in-the-making
Champ in-the-making
Thanks for your information, Tijs.

Do you mean that if I make Activiti(engine, rest, explorer) Multi tenancy, I have to change following implementation?
- starting process instance : RuntimeService#startProcessInstance**
- querying process variables : TaskService#createTaskQuery#**, RuntimeService#createProcessInstanceQuery#**
- user management
- db schema : ACT_HI**, ACT_ID** ACT_RE**

If I develop this feature, I want to commit to code base, but is there anyone who are interested in this?

kepkap
Champ in-the-making
Champ in-the-making
Hi Guys,

seems like an old thread comes to live again.

I am also very much interested in multitenant BPM… BUT, it must be truly multitenant support in single datasource, no workarounds like configuring datasource per tenant, multiple engine instances, etc. It's not going to scale. the target customer count we target at is not 10 or 100, but more than 1000.  It's obvious that handling that much by dedicating separate engine instance or datasource is not practical.

IMHO, the best way to do that is seaparting tenant data by tenantId filter everywhere. Process Instances, Tasks, users, roles, pretty much all entities.

so, my message is:
1. I vote for multitenant support.
2. I can participate. (…well, I think I can.)

Regards,

trademak
Star Contributor
Star Contributor
Hi,

There are 2 approaches. One is an approach that you can already use today. You can write your own Parsehandler and insert an process start listener for every process definition deployed. In this start execution listener you can set the tenantId value as a process variable. Also in the ParseHandler you could make the process definition tenant aware by adding a tenant prefix or something similar.

The second approach is to change the Activiti tables and add a tenant id in every table where needed. What you are suggesting is to go for the second approach, right? I think that would be a good addition to Activiti so we would definitely welcome that. If you need our help let us know.

Best regards,

chrisc
Champ in-the-making
Champ in-the-making
I guess using Activiti like Alfresco uses it with smart choice of userIds and the business keys can mean you can use Activiti out of the box for many multi-tenant scenarios.