Our team has developed the first and second version of a third party plugin for one of our clients.
The workflows in phase 1 were categorized in various subfolders. For phase 2 workflows, the sub folder structure was changed, and is different from phase 1 structure. THe workflows also have been moved to different folders in phase 2 from where they were in phase 1.
And this works fine when the phase 2 of plugin is installed afresh, we are able to see the new folder structure for all workflows. However, it was observed that when the plugin is upgraded from phase 1 to phase 2, the folder structure does not change. It stays the same as was in phase 1 and workflows too remain in the phase 1 structure.
How can we ensure that the new folder structure gets applied when the plugin version is upgraded (without uninstalling the previous version of plugin) ?
Thanks in advance.
I guess that when you changed the folder structure, you haven't increased the versions of the workflows, is that correct?
When the workflows are stored inside the plug-in package, the folders a given workflow belongs to is represented as plain string. When you upgrade the plug-in, it compares all content elements (workflows, actions, etc.) to determine if they should be upgraded. If the new plug-in package contains a workflow with a version equal to the version of the same workflow already deployed on the server (from the previous plug-in package), it is considered that the workflow does not need to be upgraded. So the criterion for the upgrade of a given element is only its version, not its folder location or any content changes. This means that if you want some element to be considered for 'upgrade', you need to increment its version.
In your case, you need to increment versions of all workflows part of the phase 2 plug-in package.
Also note that even if you increment a workflow version and it gets upgraded to the newer version and moved to the new folder location, the older folders from phase 1 may still be there after the upgrade; of course, if the workflows have moved to the new structure during the upgrade, the old folders will be empty. In this case, you can manually delete the old empty folders using the vRO Java client.
Thanks for the inputs. this does resolve our issue.
Just one more thing - there is one workflow in phase 1 which is now deleted in phase 2. How do we ensure it stays deleted after plugin version upgrade? Currently it still shows up in the phase 2 plugin after the plugin is upgraded from phase 1 to phase 2.
Thanks again in advance.
Plug-in upgrade does not provide a way to remove content that has been part of the previous version but is removed in the current version.
There is one less known feature you can try. In plug-in metadata file vso.xml you can specify action(s) to be executed during plug-in installation. By default, the plug-ins specify an action to install the content package bundled in the plug-in, but there is also an option to execute workflow/script. So the option here is to write your own custom workflow/script to find the existing package by name and delete it before the new package is installed. Not sure if this approach is worth the efforts, though. Also, I haven't seen a plug-in using it, so it may not work at all.