mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix to WorkflowDefinitionType - ignore working copy
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6778 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -167,15 +167,17 @@ public class WorkflowDefinitionType implements ContentServicePolicies.OnContentU
|
||||
}
|
||||
|
||||
public void beforeDeleteNode(NodeRef nodeRef)
|
||||
{
|
||||
// Ignore if the node is a working copy
|
||||
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) == false)
|
||||
{
|
||||
undeploy(nodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
private void deploy(NodeRef nodeRef)
|
||||
{
|
||||
// Ignore if the node is a working copy
|
||||
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) == false)
|
||||
{
|
||||
Boolean value = (Boolean)nodeService.getProperty(nodeRef, WorkflowModel.PROP_WORKFLOW_DEF_DEPLOYED);
|
||||
if ((value != null) && (value.booleanValue() == true))
|
||||
{
|
||||
// deploy / re-deploy
|
||||
WorkflowDeployment deployment = workflowService.deployDefinition(nodeRef);
|
||||
@@ -201,8 +203,13 @@ public class WorkflowDefinitionType implements ContentServicePolicies.OnContentU
|
||||
nodeService.setProperties(nodeRef, props);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void undeploy(NodeRef nodeRef)
|
||||
{
|
||||
// Ignore if the node is a working copy
|
||||
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY) == false)
|
||||
{
|
||||
String defName = (String)nodeService.getProperty(nodeRef, WorkflowModel.PROP_WORKFLOW_DEF_NAME);
|
||||
if (defName != null)
|
||||
@@ -217,4 +224,5 @@ public class WorkflowDefinitionType implements ContentServicePolicies.OnContentU
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user