Markus,
You should not block the execution thread using long-running tasks (like
sleep()) in actions, as this will actively lock the resources of the
engine. You should use wait states, event nodes and/or work item nodes
if you want to perform long-running tasks. Even when implementing a
work item handler, the work performed there should either be quick and
synchronous or performed asynchronously (acting as a wait state).
As a result, startProcess() will block only until the process has
reached a wait state, but this should almost be instantaneously (and if
you don't have any asynchronous behaviour, this could already be the
completion of your process). This allows concurrent execution of
process instances if they contain asynchronous tasks (which is usually
sufficient).
You could also invoke the engine non-blocking (in a separate thread) if
you want true concurrency.
Kris
Quoting mardo <mardo(a)abicola.de>:
> Hi there,
>
> I just began exploring the capabilities of drools and also
considered its
> applicability for typical EAI scenarios.
>
> It really may be a beginner's question. But I took the simple
example
> workflow and inserted a Thread.sleep() for its task action.
>
> I experienced the blocking startProcess() as discussed here:
>
>
http://stackoverflow.com/questions/1326718/how-to-start-multiple-processes
> -in-drools-flow
>
> So did I miss something or how would it be possible to get the
internal ID
> of the WF instance right after starting it before its completion to
be
> able to query the engine proactively during runtime?
>
> I also see that this relates to
>
http://www.mail-archive.com/rules-users@lists.jboss.org/msg05828.html,
but
> I also don't see a solution here.
>
>
>
> Thanks and Best
>
>
> Markus
Disclaimer:
http://www.kuleuven.be/cwis/email_disclaimer.htm