2
1
0

My problem is exactly the same as Async run of tool plugins (without answer since 2013)

I need to run asynchronoueously a plugin without waiting the end of the plugin.

I made an asynchronous subflow between 2 activities.

When I complete the first activity, I was expecting to have immediatly the second activity and the subflow running in parallele.

Instead of this, I have to wait for the subflow to finish as if it was a synchronous subflow

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Do you write the plugins yourself? Can you share the code?

      1. Olivier JT

        Hi, It is a custom plugin (extends DefaultApplicationPlugin). The issue is not about the plugin contents but how to launch it in async mode

      2. Aristo

        Ok, basically there are simple and advance approaches. The simple one is create a flow with only 1 tool, and then trigger the flow using Beanshell Plugin (or any other plugin as long as it can trigger to run a flow). The more comprehensive (and advance) approach is create a plugin to run another plugin, you can use PluginManager.getPlugin method to dynamically get plugin object and perhaps you can run the plugin using Java multithreading. I haven't checked the later approach, but seems workable (and surely later I will work on the Async Process Plugin since it is cool and reuseable)

      3. Anders

        If you have a custom plugin, you can execute the code in a background thread https://docs.oracle.com/javase/tutorial/essential/concurrency/runthread.html

      4. Aristo

        Hi, I created a plugins. It might not be fully tested but I hope it helps. It can run any Tool Plugins asynchronously so you don't need to modify anything. https://github.com/kinnara-digital-studio/jw-plugins-async-run-tool

      CommentAdd your comment...