ACE-2171 - EOL: WCM and related JBPM workflow definition removal

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@87752 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Stefan Kopf
2014-10-10 14:33:33 +00:00
parent 37309f11d7
commit 36c3cb3a04
6 changed files with 94 additions and 10 deletions

View File

@@ -452,6 +452,35 @@ public class WorkflowDeployer extends AbstractLifecycleBean
}
}
public int undeploy(List<String> workflowNames)
{
int undeployed = 0;
for(String workflowName : workflowNames)
{
// Undeploy the workflow definition - all versions in JBPM
List<WorkflowDefinition> defs = workflowService.getAllDefinitionsByName(workflowName);
if(defs.size() > 0)
{
undeployed++;
}
for (WorkflowDefinition def: defs)
{
if (logger.isDebugEnabled())
{
logger.debug("Undeploying workflow '" + workflowName + "' ...");
}
workflowService.undeployDefinition(def.getId());
if (logger.isDebugEnabled())
{
logger.debug("... undeployed '" + def.getId() + "' v" + def.getVersion());
}
}
}
return undeployed;
}
@Override
protected void onBootstrap(ApplicationEvent event)
{