This page deals with how a workflow model is created on a Nuxeo instance. Note that when using Nuxeo Studio, everything is done transparently. The goal of this page is to let you understand what Studio generates in the JAR when you use the Studio feature and how the workflow is created and persisted when deploying the Studio project.
Nuxeo workflows are declared via the following contribution:
<extension target="org.nuxeo.ecm.platform.routing.service" point="routeModelImporter"> <template-resource id="TimeOffRequest" path="data/TimeOffRequest.zip"/> <template-resource id="TimeOffUpdateCancelRequest" path="data/TimeOffUpdateCancelRequest.zip"/> </extension>
As you can see, the workflow definition is referenced in a zip "data/TimeOffRequest.zip" (that is in the JAR bundle). In this zip you find the serialization in core-io format of the workflow graph: the parent document corresponds to the workflow model, and you have as many children as there are nodes in your graph.
Workflow and nodes, with their properties configured from Studio, are serialized as Nuxeo documents.
Once the runtime deploys the bundle that contains such a contribution, the workflows are created from the archive, under the path
/document-route-models-root. The workflow model is persisted as a document of type "
DocumentRoute" and children nodes as documents of type "
RouteNode". You can see the list of workflow models in the Admin Center (see the workflows deployed on the demo site).
Once deployed, depending on what has been set as the availability criteria for your workflow in Studio (stored on the DocumentRoute document, field
docri:availabilityFilter) you will see the workflow in the "start workflow" drop down list on the summary of the document. You can now start a new workflow.