Compatibility between multitenancy and other addons

Tagging @v.fadeev since he presented the multitenancy webinar

my application uses the multitenancy addon and I already integrated a bunch of other addons as well. Im also planning to soon integrate bpm.

One of the latest addons I integrated is the email templates add-on.

to my surprise, any email template I create is visible for all tenants.

I then started going through the documentation and found this Multitenancy :: Jmix Documentation

So, if I understand that section correctly … There is no support for email templates, dashboards, bpm, … addons with multitenancy?

This would be unforeseen and a serious limitation, not to say catastrophal.

On the other hand, I followed the webinar where the bookstore was demo’ed and that was integrated with bpm :thinking:

Please clear up the smoke here, is the documentation wrong? How do integrate with the email template addon?

Ps. This was literally the first question asked by me on the multitenancy webinar.

Hi Tom! Glad to hear that you’ve implemented the Multitenancy Addon for your project. I’m not sure whether E-mail template Addon supports multitenancy or not. I need to check with the team. As for BPM it supports multitenancy 100%. Dashboard should also operate as expected - showing tenant specific data in charts. Keep in my mind that to make it work you should implement @TenantId annotation to the tenant specific entities. Come back to you soon with details on E-mail template.

Thank your for the reply @v.fadeev

I understand that you say dashboards are multi-tenant in the sense that tenant-specific data is displayed in the dashboards. This makes sense as they probably just rely on the same data retrieval mechanisms (datamanager) that already support it.

However, I am talking about the fact that the addons entities themselves should be multitenant. I want my tenants to be able to create their own email templates, their own dashboard definitions, and their own bpm process definitions.

If I’m optimistic, the only thing that would I expect that should be done is for JMiX to add @TenantId properties on all of the addons’ relevant entities.

If you look at the io.jmix.reports.entity.Report you’ll see that it has the @TenantId property, but io.jmix.emailtemplates.entity.EmailTemplate and io.jmix.dashboards.entity.PersistentDashboard don’t.

I think is is much needed and I expect it was simply forgotten since else it would cripple the whole power of the plugins and multitenancy.

Thank you for your inputs. I’ve double checked the multi-tenancy in BPM add-on and it truly works. Unfortunately it is missing in the documentation Multitenancy :: Jmix Documentation in the tenant specific modules list. This should be fixed soon. Thus you can create and manage different BPMN models for different tenants in a single database. E-mail templates and Dashboards - looks like you’re right while I was wrong telling that it support multi-tenancy in the webinar. I guess this should be fixed for a consistent approach. I’m in discussion with the team on this issue and come back with details by the end of the week.

1 Like

I’ve put an issue on this after discussion with the team Missing Multitennancy support for E-mail templates and Dashboards add-ons · Issue #2386 · jmix-framework/jmix · GitHub. Next week we’ll decide when it should be probably fixed. Keep you posted.

Hi Tom,

The above issue is planed for release 1.6 because changing DB model in bug fix release is not possible. As a workaround, you can extend system entities and add tenantId field manually. I’d recommend adding it with the name that is usually used in Jmix entities, so when migrating to 1.6 you won’t have problems with different tenant attribute id name:

@Column(name = "SYS_TENANT_ID")
@TenantId
protected String sysTenantId;

Regards,
Gleb

1 Like