cancel
Showing results for 
Search instead for 
Did you mean: 

Job Acquisition filter

smirzai
Champ on-the-rise
Champ on-the-rise
We have a need here. In a cluster deployment model, it might be the case, that some nodes do not have the resource to do an async job, temporarily or permanently. The desired behavior would be to able to configure which nodes pick which jobs.

It might be also in some other case. Just imagine we have two machines, one fast and one slow and we want the higher priority tasks to be executed in Fast machines.

It is already mentioned in forum that it is not easy to implement the job prioritization by its sheer sense. But this way  might be a compromise.

Here is a proposal on configuration:
<bean id="jobExecutor" class="org.activiti.engine.impl.jobexecutor.JobExecutor">
   <property name="jobFilter" value="jobName='proc_def_1'"/>
</bean>

To address the above second case, it might useful to set a new generic parameter, say "param1" to job Executer table. This parameter can be set in xml definition file. Something like:
<serviceTask id="service1" name="Generate Invoice" activiti:class="my.custom.Delegate" activiti:async="true" activitiSmiley Tonguearam="1" <!– means to be run on fast machine/>

I can try to see how this feature could be implemented.  Would it be a reasonable extension ?
14 REPLIES 14

trademak
Star Contributor
Star Contributor
Hi Saeid,

I think the use case you are describing is perfectly fine, and it can be implemented with a custom job executor and the job priority configuration we are planning for 5.13.
But as far as I can see it now, there's no need to do additional things in the Activiti Engine.
So let's discuss this in relationship to the job priority configuration for 5.13. The first start of that is this wiki page

Best regards,

jwohl
Champ in-the-making
Champ in-the-making
Hi there,
We've got a similiar problem in our development environment. There is a central database with the activiti schema. The application using the activiti engine runs on local websphere servers on each developers machine. For activiti and it's job aquisition it's like a distributed environment (it was even called cluster environment in a former post of this thread). Different developers work on the same process but implement different tasks. When they test the process in this kind of configuration the tasks are not necessarily executed on the developers machine who launched the process. Thats because how the standard Job Aquisition works. My question is: Could there be a special job aquisition filter which only selects the jobs which belong to the machine from where the process was instantiated? At the moment I can't see any proper selection criteria in the ACT_RU_* tables (i.e. in the ACT_RU_EXECUTION table). Maybe it would make sense to add a information like the node or machine name which instanciated the process to the datamodel and the Activiti Engine?
Thanks for your reply.
Best Regards,
Joern

frederikherema1
Star Contributor
Star Contributor
This is a feature that is not really generic enough to add to the engine, imho. Also, risks getting jobs stuck because the machine is down. Maybe the future improvements to the jobExecutor could make it easier to plug this kind of approach in without having to rip out the whole jobExecutor as it is now.

nbromage
Champ in-the-making
Champ in-the-making
Hello Frederik,

Did the job priority configuration changes make it into  the 5.13 release?

nick

frederikherema1
Star Contributor
Star Contributor
No job-priority handling has been added to the engine.