6.4.2.6.
Update your workflows to use GenericSetup profiles
Up one level
Installing workflows via GenericSetup will make your product work only on Plone 2.5 and upwards, so make sure you create a special release/branch if you want your product to still work on Plone 2.1/2.0 (which are unsupported releases when Plone 3.0 is released).
Typical error message that indicates that you are trying to install workflows not using GenericSetup:
ImportError: cannot import name addWorkflowFactory
For existing workflows, the easiest way to make the product install use GenericSetup for workflows is:
- Install your product (and its workflows) using Plone 2.5.
- Using the
portal_setuptool in the ZMI, export a snapshot of the current site profile:- Click the
Exporttab. - Select the parts you want to export the configuration for (in this case,
Workflow Tool). - Click the
Export Selected Stepsbutton. - You will now get a tar file named something like
setup_tool-20070424225827.tar.
- Click the
- Unpack the tar file, and put the resulting files and directories in a directory
profiles/default/in the root of your product. - Remove the workflow directories in
workflow/that are not part of your product, and editworkflows.xmlso that it only has the information for your workflows. See Poi changeset 41071 for an example. - Delete your old '.py'-based workflow definitions in
Extensions, but make sure you keep any workflow scripts, since these will be referenced from the profile definitions. - Add a
configure.zcmlfile in the root of your product that registers the default profile. See Poi's configure.zcml for an example. - Remove the redundant code from
Extensions/Install.pyand add the boilerplate code to invoke the GS setup, see Poi changeset 41071 for an example.
This process is also the same for any code you want to move to GenericSetup, in the Poi example, we also moved the catalog metadata and various other things to use GenericSetup profiles, and could get rid of most of Install.py in the process.