You can try Apache Camel too. I'm not sure if ANT APIs inside a work item it's the best alternative, but feel free to try.
Thanks for the quick reply. While Apache Camel has exec adaptor for external tools, I think it is still too heavy for my case. Meanwhile, I would like to follow JBoss Stacks (Seam, HornetQ, jBPM, etc) and keep Web Service away to make things simple. Another soluiton may be using Groovy scripts to call Apache Ant (Gant, a powerful groovy wrapper for Ant) exec task.
I am not sure jBPM5 supports Groovy script well or not. Any examples?
You can create a work item that execute groovy scripts and that will probably works for you.
Or you can just call ant apis directly from the work items.
Work items are indeed the recommended way to communicate with external applications / tools (to avoid having to encode all this logic in script nodes inside your process). We have a work item implementation that might be useful, it all depends on what communication channels the application you are trying to invoke supports.
ExecWorkItemHandler allows you to call console commands using org.apache.commons.exec
If this examples can be used out-of-the-box in your case, they should at least give you an idea on how to setup integration with your services using a custom handler. I could for example see a similar ant work item that allows you to call ant targets. We're hoping to extend the set of supported work item handlers for jBPM 5.1, with the help of the community
Thanks for the tips. I've also found the exec workitem. It is great! And I will also implement and contribute an Ant target workitem since it is more powerful (build file can contain some minor and fixed process and its exec task with other advanced features of Ant such as batch mode and paralleling can do much than just apache commons.exec).