12 Replies Latest reply on Feb 10, 2015 10:17 AM by andrea_chi

    Multi tenancy support in JBPM5.2

    maverick.mittal

      Does any version of JBPM5  support multi tenancy? Any Plan for the same going ahead?

        • 1. Re: Multi tenancy support in JBPM5.2
          roger0681

          Hi, Saurabh

           

          If you mean serving several isolated group of users, I think jbpm supports such isolation. You should configure properly users/groups and manage the presentation layer in your GUI. I'm not sure that the default gwt console manages this principle.

           

          Hope to help

           

          Greetings,

          Roger

          • 2. Re: Multi tenancy support in JBPM5.2
            maverick.mittal

            Thanks Roger.Thats one of the way to acheive multi tenancy.

            My defination of multi tenancy is "  on a single application server  instance (one code base of JBPM ) and database server instance  (one schema)  multiple customer can model , take action etc "

            and then the data remain isolated for that cutomer.

             

            Thanks

            • 3. Re: Multi tenancy support in JBPM5.2
              salaboy21

              You can leverage the fact that jBPM5 is a very light weight engine and you can start it multiple times in the same server. Each instance can be configured to work with a client or you can use multiple instances to servers multiple clients, it's up to you.

               

              Cheers

              • 4. Re: Multi tenancy support in JBPM5.2
                maverick.mittal

                But we will need to manitain different database schema.?

                • 5. Re: Multi tenancy support in JBPM5.2
                  salaboy21

                  Yes, but as I'm telling you it will be trivial to extend the engine to support that multitenancy.. If you want to go ahead with that contribution we can guide you.

                  Cheers

                  • 6. Re: Multi tenancy support in JBPM5.2
                    nkb

                    how it´s possible to tell an instance to use a specific datasource? persistence is (also) defined in standalone.xml and there is only one in every jboss

                    • 7. Re: Multi tenancy support in JBPM5.2
                      houtsmatisering

                      When you have a large number of clients (>100), multiple instances of the engine are not a option. Is there a way to handle multiple schema's from a single or a set of engines?

                      • 8. Re: Multi tenancy support in JBPM5.2
                        bennixview

                        Is it possible to make a custom SessionManager that handles for each Tenant a new Session so that the Session ID in DB will be the TenantID?

                        • 9. Re: Multi tenancy support in JBPM5.2
                          ctkcin

                          you can create separate persistence-unit for each tenant. and then in you calling code you can pick persistence-unit as per tenant id.

                           

                          Create separate persistence-unit for each tenant in persistence.xml.

                          Create entitymanagerfactory for each persistence-unit in you code. (you can keep these in a  map where key will be tenant id)

                          Create Taskservice for each EMF. (you can keep these in a  map where key will be tenant id)

                           

                          Use taskservice for required tenant.

                          • 10. Re: Multi tenancy support in JBPM5.2
                            bennixview

                            I don't know the number of tenants. They can be added / removed while runtime. (is it possible to add a PU while runtime?)

                             

                            I want to go the way which Mauricion describes. And he said that it is "trivial", hence i want to know if my approach to make a custom SessionManager that handles for each Tenant a new Session is what he means? Or is it even easier ... (fyi: i use jbpm 5.4)

                            • 11. Re: Multi tenancy support in JBPM5.2
                              bennixview

                              Hi,

                               

                              i have a Soloution that works for me.

                               

                              First: Every time I start a new processinstance i put a "Context" to the parameters. So i've got a technical processvariable wich contains the tenant-ID in every processinstance.

                              Second: I made a custom HumanTaskWorkitemHandler wich puts the "Context" from the processinstance to the ContextData of a HumanTask. So i can filter HumanTasks by tenant-ID. (In frontend the tenant-ID is hidden).

                               

                              Regards

                              • 12. Re: Multi tenancy support in JBPM5.2
                                andrea_chi

                                Although it's been a long time

                                I would be interested in how to configure the solution you proposed possibly utilizzanto jBPM6.

                                Thanks for your answers.