cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect a created process(and its tasks) to one ProcessEngine for execution

dergrahl
Champ in-the-making
Champ in-the-making
Hi,

I would like to use Activiti in my application. As far as I have understand it is possible to share one Repository with more then one ProcessEngine, but when a Process is initiated it cannot be said where its tasks are executed during its runtime (especially timer tasks).

Is it possible to connect a created process and its task to a specific ProcessEngine, so that they are only executed there?

I ask this, because my application will be distributed over many nodes, but the resources for the tasks will be only available on the node which created the process.

Is it possible to configure or write some extension to achive this (some meta information on the process or task like node id)?

Regards

Alexander
6 REPLIES 6

trademak
Star Contributor
Star Contributor
Hi Alexander,

You could implement your own job executor component and implement the logic which job has to be processed by which job executor there. Maybe by adding a specific process variable or so you could make the distinction. I must however say that without any background knowledge of your use case, it doesn't sound like a good approach to make the job executors server aware.

Best regards,

dergrahl
Champ in-the-making
Champ in-the-making
Hi,

the background is, that there will be many file resources which have to be handled by the tasks (>1GB). So it is necessary that the tasks is running in the application node where these resources are available.

Thanks for the hint with the job executer,

Alexander

dergrahl
Champ in-the-making
Champ in-the-making
Hi,

I had now a look at the JobExecuter implementation. Currently I do not see that it would so simple to extend the JobExecuter to use a value for just selecting only the tasks for its node.

I think I have to implement a whole new implementation which also uses other sql statements to select the tasks.

Any hints on the JobExecuter? From there I think the AcquireJobsCmd and here the

<code>List<JobEntity> jobs = commandContext
      .getJobEntityManager()
      .findNextJobsToExecute(new Page(0, maxNonExclusiveJobsPerAcquisition));</code>

must be changed.

Thanks,

Alexander

trademak
Star Contributor
Star Contributor
Maybe it makes sense in your use case to have separate Activiti Engine + DB per server. So what I mean is have a separate Activiti DB per Activiti Engine. This means that the job executor always executes on the same server. The only downside is of course that you need multiple Activiti DB instances. But for your use case this seems like a better approach then re-implementing the job executor.

Best regards,

dergrahl
Champ in-the-making
Champ in-the-making
Hi,

I thought about this scenario too, but I see some downsides on this:

- a nodes can be created very easy, but it would be difficult to always create a new database just for a new node (database administrators do not like that :-))
- Backup gets more complicated
- Monitoring becomes very complicated
- Currently all my nodes share a common database, I would like to keep it this way.

Another approach could be to have some nodes to be Activiti nodes, which handle the execution of the Processes and tasks, and the tasks are only proxies, which then call the approbiated task on the other nodes. But this is also not so easy to implement 🙂

Does'nt anybody else had this problem before? I like the idea to design the process in BPMN 2, this is a very felexible way to handle customer specific needs. But in case you have large data to process, it is not so easy to handle or implement that. I will think little bit more about the proxy approach.

Regards

Alexander

jbarrez
Star Contributor
Star Contributor
Reading your requirements, I indeed think you need some smart proxy … maybe another approach could be the implement custom implementations of all the services, wrap the existing ones and do the routing on some custom logic…