How can I create my own workflow without Nuxeo Studio?

Hi, I would like to know how can I use more than the Serial and the Parallel default ones. I don't want to rely on Nuxeo Studio.

I believe it is possible to do so by using an XML file, but I don't know how to write it. The XML files of the defaults workflows are rather cryptics. Is there anyone who can recommand a tutorial?

Thanks

6 votes

5 answers

759 views

ANSWER

well i tried a couple of ways to define workflow without studio but it's hard to maintain. The generated xml for workflow tasks and routing tasks is zipped. No idea what kind of tool do they use to generate the workflow schema.
06/22/2016



Hi,

in case someone still needs it. We create workflows manually via our own gitlab. We create two projects, one holding the workflows only that will lead to the zip archive containing the workflows, the other holding the rest of the customizing (incl. the schema used in the workflows):

  • my_customizing
  • my_customizing_workflow.

We can then produce a “my_customizing.jar” with workflows with this script:

    - git clone git@gitlab:abc/my_customizing_workflow.git workflow
    - cd workflow
    - find . -maxdepth 1 -type d -regex ./[^.].* -exec zip -r {}.zip {} \;
    - find . -maxdepth 1 -type f -name '*.zip' -exec zip -r {} .nuxeo-archive \;
    - find . -maxdepth 1 -type f -name '*.zip' -exec mv {} ../data/ \;
    - cd ../
    - jar -cfM my_customizing.jar META-INF OSGI-INF data web

The .nuxeo-archive is actually an empty file.

In the my_customizing_workflow.git there is one directory per workflow. Each step inside the workflow is a separate folder again, e.g. Task0001, Task0002. And inside each of these folders there is the respective document.xml holding the workflow / task information.

Each workflow and task have their own schema which we store in the data/schema structure of the my_customizing project.

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="my_wf" prefix="my_wf" override="true" src="data/schemas/my_wf.xsd"/>
    <schema name="Task0001" prefix="Task0001" override="true" src="data/schemas/Task0001.xsd"/
</extension>

And we reference the corresponding facets there too:

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
    <facet name="facet-Task0001">
        <schema name="Task0001"/>
    </facet>
    </extension>

We add the filters to handle the required rules:

<extension target="org.nuxeo.ecm.platform.actions.ActionService" point="filters">
    <filter id="filter@wf@my_wf">
        <rule grant="true">
            <permission>Write</permission>
            <group>administrators</group>
        </rule>
    </filter>
    </extension>

The workflow itself is called via the routing service:

<extension target="org.nuxeo.ecm.platform.routing.service" point="routeModelImporter">
    <template-resource id="my_wf" path="data/my_wf.zip"/>
</extension>

The workflow and task document.xmls are easy to understand besides the visualization component you can view in the Admin section or when the workflow is executed. But this should be mainly playing around with the coordinates.

Hope this info helps you.

Stefan

2 votes



ssze Thank you Stefan, I really appreciated
09/09/2016


I want to know the answer to this question too.

2 votes



you should upvote the question rather than post an answer, don't you think so ?
05/10/2014


Well according to my research https://github.com/nuxeo-archives/nuxeo-core/blob/master/nuxeo-core-io/src/main/java/org/nuxoweo/ecm/core/io/ExportConstants.java the workflows are zipped and archive with zipheader and a marker file and interpreted by a document model importer. So i think you should prepare your workflow xml zip it and marked it.

0 votes



Well according to my research https://github.com/nuxeo-archives/nuxeo-core/blob/master/nuxeo-core-io/src/main/java/org/nuxoweo/ecm/core/io/ExportConstants.java the workflows are zipped and archive with zipheader and a marker file and interpreted by a document model importer. So i think you should prepare your workflow xml zip it and marked it.

0 votes



UP please…

0 votes