This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Page tree
Skip to end of metadata
Go to start of metadata

Ant is not a workflow engine

Ant is a build tool. It was created to compile and package code, and along the way has learned about JUnit testing, rudimentary deployment, and other things. Yet it has remained focused on the problem of build-time preparation of code, documentation and other artifacts of a software project.

Every so often, somebody tries to use it as a general purpose workflow engine. These people usually get into trouble, for the following reason: General Purpose Workflow is Complicated. The complexity with workflow is specifying the fault handling, when user intervention is needed, how to handle failures of an operation. Transactions, retries, timeouts, all are features of a workflow system -along with parallel execution of operations, fault tolerant execution, and other needed features.

Ant is not a workflow engine, as it lacks:

  • Persistent state. If the ant process dies, all explicit record of the state is lost. In a build, this is not a problem; file artifacts are still present, and rebuilds are the best action.
  • Fault handling. In a build process, task failure often means something is seriously wrong and needs fixing. In a workflow, exception handling logic allows for failures to be handled automatically. Note that AntContrib has a <trycatch> task that provides some failure handling.
  • Parallel operation. Yes, there is a <parallel> task, but it gets complex to use. Also, you need to be sure that all the tasks that are used in parallel are safe to be used re-entrantly.
  • Better model of state. Ant's write-once model of properties is ideal for a build process in which outer build files can control inner builds. But it does not work when state is really something that is associated with individual jobs going through the pipeline.

Accordingly, we do not encourage people to try and use ant as a workflow engine. Ant can be used as an execution tool to perform work in the context of a workflow engine, but it is very dangerous and unwise to use it as a workflow engine. It may work at first, but you will soon discover its limitations.

  • No labels