Migrating overloaded workflows


This page deals with migrations to be carried out on your workflow files when your project contains specific overloads or project-specific workflows.
Migration is therefore only to be applied to workflow files containing an overload. Other files must be deleted from the application.

To migrate your files, there are 2 possibilities:
- either start from the default core workflow file (now included in the associated plugin ) and reapply your project overload (recommended). Find the reference file according to your application.
- or apply the following instructions (best used for project-specific workflows)

  1. Keys i18n
  2. Class renaming
  3. Modification actions
  4. Synchronization action
  5. Action 22 workflows ODF
  6. Front-office modification of classified ads
  7. Front-office content modification

Keys i18n

This migration concerns all your overloaded workflow files

The i18n keys of the plugin "default-workflow" have been moved to CMS.

In your workflow files:

  • search and replace "plugin.default-workflow:" with "plugin.cms:"
  • search and replace "plugin.default-odf-workflow:WORKFLOW_ACTION_REPUBLISH"with "plugin.odf:WORKFLOW_ACTION_REPUBLISH"

Class renaming

This migration concerns all your overloaded workflow files

Some JAVA classes used in workflow files have been renamed and/or moved.

In your workflow files:

  • search and replace org.ametys.web.workflow.ValidateContentFunction by org.ametys.cms.workflow.ValidateContentFunction
  • search and replace org.ametys.odf.workflow.ValidateODFContentFunction by org.ametys.cms.workflow.ValidateContentFunction
  • search and replace org.ametys.plugins.contentio.synchronize.workflow.ValidationStepCondition by org.ametys.cms.workflow.ValidationStepCondition
  • search and replace org.ametys.web.workflow.ContentPublishedCondition by org.ametys.cms.workflow.HasLiveLabelCondition
  • search and replace org.ametys.odf.workflow.ODFContentPublishedCondition by org.ametys.cms.workflow.HasLiveLabelCondition
  • search and replace org.ametys.web.workflow.UnpublishContentFunction by org.ametys.cms.workflow.RemoveLiveLabelFunction
  • search and replace org.ametys.odf.workflow.UnpublishODFContentFunction by org.ametys.cms.workflow.RemoveLiveLabelFunction

Modification actions

This migration concerns the following workflow files:
- CMS : content.xml, reference-table.xml
- Plugins : user.xml, udorgunit.xml, extraction-description.xml, newsletter.xml, ugc-classified-ads-postvalidation.xml, ugc-classified-ads-prevalidation.xml
- ODF : container.xml, course.xml, course-part.xml, course-list.xml, program.xml, subprogram.xml, orgunit.xml, person.xml

If you have an overload for one of the workflow files listed, you need to modify actions 1, 11, 111, 2, 220 and 6 (if they exist), adding the following post-function:

<function type="avalon"> 
    <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>   
  <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>
</function>

Example with action 1 of training (program.xml):

<action id="1" name="plugin.default-odf-workflow:WORKFLOW_ACTION_CREATE">    
    <pre-functions>     
        <function type="avalon">     
            <arg name="role">org.ametys.odf.workflow.CreateProgramFunction</arg>     
        </function>   
    </pre-functions>   
    <results>     
        <unconditional-result old-status=" " status=" " step="1" />   
    </results>   
    <post-functions>                 
        <function type="avalon">                     
            <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>                     
            <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>  
        </function>     
        <function type="avalon">     
            <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>     
        </function>                 
        <function type="avalon">                     
            <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</arg>                 
        </function>   
    </post-functions>   
</action>

Synchronization action

This migration concerns the following workflow files:
- UD : user.xml, udorgunit.xml
- ODF : container.xml, course.xml, course-part.xml, course-list.xml, program.xml, subprogram.xml, orgunit.xml, person.xml

If you have an overload for one of the workflow files listed, synchronization action 800 must be modified:

  • addition of the EditSynchronizedContentFunction to pre-functions
  • addition of the ExtensibleFunction in the post-function of each result (important for this function to come before the SetCurrentStepIdAndNotifyFunction)
  • deletion of ExtractOutgoingReferencesFunction post-functions
  • deletion of SetCurrentStepIdAndNotifyFunction post-functions of results
  • Add the CreateSynchronizedVersionFunction as a post-function to each result (after the ExtensibleFunction, but before the ValidateSynchronizedContentFunction if present).

Example with action 800 training courses (program.xml)

<action id="800" name="plugin.contentio:WORKFLOW_ACTION_SYNCHRONIZE">
    <restrict-to>
        <conditions type="AND">
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>
                <arg name="right">ODF_Rights_Program_Synchro</arg>
            </condition>
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.LockCondition</arg>
            </condition>
            <condition type="avalon">
                <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.ValidationStepCondition</arg>
                <arg name="validation-step">3</arg>
            </condition>
        </conditions>
    </restrict-to>
    <pre-functions>
        <function type="avalon">
            <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.EditSynchronizedContentFunction</arg>
        </function>
    </pre-functions>
    <results>
        <result old-status=" " status=" " step="1">
            <conditions type="AND">
                <condition type="avalon">
                    <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>
                    <arg name="step">1</arg>
                </condition>
            </conditions>
           <post-functions>
                <function type="avalon">
                    <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>
                    <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>
                </function>
                <function type="avalon">
                   <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.CreateSynchronizedVersionFunction</arg>
                </function>
            </post-functions>
        </result>
        <result old-status=" " status=" " step="2">
            <conditions type="AND">
                <condition type="avalon">
                    <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>
                    <arg name="step">2</arg>
                </condition>
            </conditions>
            <post-functions>
                <function type="avalon">
                    <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>
                    <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>
                </function>
                <function type="avalon">
                   <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.CreateSynchronizedVersionFunction</arg>
                </function>
            </post-functions>
        </result>
        <result old-status=" " status=" " step="3">
            <conditions type="AND">
                <condition type="avalon">
                    <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>
                    <arg name="step">3</arg>
                </condition>
            </conditions>
            <post-functions>
                <function type="avalon">
                    <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>
                    <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>
                </function>
                <function type="avalon">
                   <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.CreateSynchronizedVersionFunction</arg>
                </function>
                <function type="avalon">
                    <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.ValidateSynchronizedContentFunction</arg>
                </function>
                <function type="avalon">
                    <arg name="role">org.ametys.cms.workflow.ValidationStepFunction</arg>
                </function>
            </post-functions>
        </result>
        <unconditional-result old-status=" " status=" " step="1"/>
   </results>
</action>

Action 22 workflows ODF

This migration concerns content workflow files ODF:
container.xml, course.xml, course-part.xml, course-list.xml, program.xml, subprogram.xml and orgunit.xml

Action 22 is to be amended to add the org.ametys.cms.workflow.EditContentFunction in pre-function.

<action id="22" name="plugin.cms:WORKFLOW_ACTION_EDIT">
    <restrict-to>
        <conditions type="AND">
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.LockCondition</arg>
            </condition>
        </conditions>
    </restrict-to>
    <pre-functions>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.EditContentFunction</arg>
        </function>
    </pre-functions>
    <results>
        <unconditional-result old-status=" " status=" " step="1" />
    </results>
    <post-functions>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>
        </function>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</arg>
        </function>
    </post-functions>
</action>

Front-office modification of classified ads

This migration concerns the classified ad workflow files: ugc-classified-ads-postvalidation.xml et ugc-classified-ads-prevalidation.xml.

In order to allow the author to modify the classified ad after publication on the front-office side (if front-office modification is active), action 42 must be added to the workflow ugc-classified-ads-postvalidation.xml and ugc-classified-ads-prevalidation.xml.

This migration is optional.

<action id="42" name="plugin.front-edition:WORKFLOW_ACTION_EDIT_FO">
    <restrict-to>
        <conditions type="AND">
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>
                <arg name="right">Workflow_Rights_Edition_Online</arg>
            </condition>
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>
                <arg name="right">Workflow_Rights_Validate</arg>
            </condition>
            <condition type="avalon">
                <arg name="role">org.ametys.cms.workflow.LockCondition</arg>
            </condition>
        </conditions>
    </restrict-to>
    <pre-functions>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.EditContentFunction</arg>
        </function>
    </pre-functions>
    <results>
        <unconditional-result old-status=" " status=" " step="3" />
    </results>
    <post-functions>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.extensions.ExtensibleFunction</arg>
            <arg name="extension-point">org.ametys.cms.workflow.extensions.PostContentEditionFunctionsExtensionPoint</arg>
        </function>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>
        </function>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</arg>
        </function>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.ValidateContentFunction</arg>
        </function>
        <function type="avalon">
            <arg name="role">org.ametys.cms.workflow.ValidationStepFunction</arg>
        </function>
    </post-functions>
</action>

Front-office content modification

This migration concerns the workflow file content.xml

An unnecessary condition (and source of error with a reference to plugin user-directory) has crept into the restrictions of action 42 (used for front-office modification) in the content file.xml

Remplacer la partie <restrict-to> par:

<restrict-to>
    <conditions type="AND">
        <condition type="avalon">
            <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>
            <arg name="right">Workflow_Rights_Edition_Online</arg>
        </condition>
        <condition type="avalon">
            <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>
            <arg name="right">Workflow_Rights_Validate</arg>
        </condition>
        <condition type="avalon">
            <arg name="role">org.ametys.cms.workflow.LockCondition</arg>
        </condition>
    </conditions>
</restrict-to>
Back to top