Re-use/Caching of DMN objects in multi-threaded application


Is it possible to re-use the following objects in an application:

  1. DmnEngine (created by DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine()) for the execution of all possible rules
  2. DmnDecision (created by DmnEngine.parseDecision(String, InputStream)) to cache already parsed decision files and execute them repeatedly with different variables

Are both classes thread-safe so they can be used by several threads concurrently or does each thread have to instantiate its own DmnEngine or DmnDecisions ?


Hi Michael,

both should be possible. If you see any failures, please report them.

Best regards,

1 Like

Thanks Philipp !

I am firing concurrently with 4 Threads on the same objects. Works fine so far.
On a Macbook Pro I get up to 240’000 rules processed per second this way (well, 80’000 with each 2 chained decisions which re-use the variable context). Pretty impressive for not compiled rules!


1 Like