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:
Jan Vonka
2007-09-13 16:05:55 +00:00
parent 75213e84ee
commit c872cb5bc5

View File

@@ -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
}
}
}
}
}