Looking for assistance creating processes and tasks to provision tenants

Original Title - not accepted by posting engine: "Is it possible to Access the “MultiSchemaMultiTenantProcessEngineConfiguration” from within a script task? "

Hi all, apologies in advance, very new to Flowable.

Short question: Is it possible to get access to the MultiSchemaMultiTenantProcessEngineConfiguration in a [groovy] task via the spring context?

Longer question:

I’m looking at trying to integrate Flowable as the workflow engine for the FOLIO open library platform (https://www.folio.org/). FOLIO is an open source project currently targetted at the academic library ecosystem and trying to challenge some of the big business forces consolidated in that space. FOLIO is a microservice based architecture, but currently, any orchestration of those services is done at the code level inside specific modules. We are looking at the possibility of using a workflow engine to automate service orchestration tasks… however…

FOLIO uses a dynamic tenant registration and initialization system - so we don’t know when the system is deployed what tenants might be initialized. We would like to use a schema-per-tenant isolation mechanism and for our Proof of Concept Work we’re using the flowable/all-in-one docker image.

As a part of normal system operation, microservices are enabled for specific tenants which cause a schema to be created and initialised for the module on the tenant.

I am interested to know if we could create a default-tenant task “registerTenant” which will sit in a default-tenant process called “initialiseTenant” that will dynamically provision a flowable engine for a tenant. I’ll be researching this some more, but if anyone is able to offer advice or insight I would be really interested. We did some PoC work about 6 months ago based on Camunda, but my sense is that Flowable has the edge in orchestrating web-based microservices. I’ve been looking at https://blog.flowable.org/2018/09/11/multitenancy-in-flowable/ but I think what I’m really interested in is calling the functions defined there from a process itself - so using the engine to manage the engine.

Any pointers or suggestions would be very welcome - we’re very new to this and on a learning curve, so please be gentle. is this a dumb question?

Thanks in advance,
Ian.

Hey Ian,

My moto is that there are no dumb questions :slight_smile:. This looks like an interesting use case.

Short answer: Yes it is possible to get acces to the MultiSchemaMultiTenantProcessEngineConfiguration in a [groovy] task via the Spring context. In order to do so you would need get the bean name for the registered MultiSchemaMultiTenantProcessEngineConfiguration

Long answer:

I think that this image is not sufficient for you since it uses the SpringProcessEngineConfiguration, and you can’t really change that. What I would suggest is to create your own Spring configuration with the MultiSchemaMultiTenantProcessEngineConfiguration.

I think you don’t need to provision a new engine for a tenant. There is still one engine. However, before calling the engine services you need to set the current tenant id via the TenantInfoHolder.
I assume that registering a tenant is a special process. This process can leave in some default tenant of your own choosing that would be preconfigured at the beginning.

Hope that this was helpful to you and that you can proceed with your PoC.

Cheers,
Filip

Superstar! Thanks Filip - that is really helpful.

Ian.