Shared process engine with sharding datastores

hi @devj87,

could you publish your code somewhere? on github for instance?

Cheers,
Askar

@aakhmerov ok what kind of files do you need?

I build a ā€œcustomā€ configuration as process engine in sharding environment

So defining pairs of process engine with datasources for example:

engine1 ----> datasource1
engine2 ----> datasource2

all as jndi resource and defined as sring bean as following:

<bean name="processEngine" id="processEngine"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName"
    value="java:global/camunda-bpm-platform/process-engine/default" />
</bean>

<bean name="processEngine2" id="processEngine"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName"
    value="java:global/camunda-bpm-platform/process-engine/default2" />
</bean>

So I set ā€œrunningā€ process engine by our alg so I can fine create tasks in sharding mode but Iā€™canā€™t start process for a deployment issue this is my processes.xml:

<?xml version="1.0" encoding="UTF-8" ?>

    <process-application
        xmlns="http://www.camunda.org/schema/1.0/ProcessApplication" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <process-engine name="default">
            <job-acquisition>default</job-acquisition>
            <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration
            </configuration>
            <datasource>java:jdbc/ProcessEngine</datasource>

            <properties>
                <property name="databaseTablePrefix">TENANT_1.</property>

                <property name="history">full</property>
                <property name="databaseSchemaUpdate">true</property>
                <property name="authorizationEnabled">true</property>
                <property name="useSharedSqlSessionFactory">true</property>
            </properties>
        </process-engine>

        <process-engine name="default2">
            <job-acquisition>default</job-acquisition>
            <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration
            </configuration>
            <datasource>java:jdbc/ProcessEngine2</datasource>

            <properties>
                <property name="databaseTablePrefix">TENANT_2.</property>

                <property name="history">full</property>
                <property name="databaseSchemaUpdate">true</property>
                <property name="authorizationEnabled">true</property>
                <property name="useSharedSqlSessionFactory">true</property>
            </properties>
        </process-engine>


        <process-archive name="default-loan-approval">
            <process-engine>default</process-engine>
            <properties>
                <property name="isDeleteUponUndeploy">false</property>
                <property name="isScanForProcessDefinitions">true</property>
            </properties>
        </process-archive>

        <process-archive name="default2-loan-approval">
            <process-engine>default2</process-engine>
            <properties>
                <property name="isDeleteUponUndeploy">false</property>
                <property name="isScanForProcessDefinitions">true</property>
            </properties>
        </process-archive>

    </process-application>

hey @devj87,

just put on the github project files, java classes, config files etc. excluding application server.

Cheers,
Askar.

Iā€™m sorry @aakhmerov I canā€™to do :frowning:

Hi @devj87,

I am sorry, but I donā€™t think I can help you without seeing your code and project structure. I think we are not getting common understanding of your problem here and the only realistic way to get it would be to see your project.

Cheers,
Askar

1 Like

Hi @aakhmerov I solved deploying declaring only two archive for each process engine as follow:

  <process-archive name="default-archive">
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
    </properties>
  </process-archive>

    <process-archive name="processEngine2-archive">
    <process-engine>processEngine2</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
    </properties>
  </process-application>

And putting .bpmn under /src/main/resource

:grin:

Best regards