From 15650695848a3c9f9138ea2414c21ea1e2bf936e Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Thu, 18 Sep 2014 17:13:54 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 83759: Merge WAT2 to HEADBUGFIX: r83494 When package items are added/removed it dispatches an Activiti VARIABLE_UPDATED event git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84576 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/public-rest-context.xml | 1 + .../rest/workflow/api/impl/WorkflowRestImpl.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/config/alfresco/public-rest-context.xml b/config/alfresco/public-rest-context.xml index 268f26364f..46defecd79 100644 --- a/config/alfresco/public-rest-context.xml +++ b/config/alfresco/public-rest-context.xml @@ -822,6 +822,7 @@ + diff --git a/source/java/org/alfresco/rest/workflow/api/impl/WorkflowRestImpl.java b/source/java/org/alfresco/rest/workflow/api/impl/WorkflowRestImpl.java index 1379f323fb..90eca637eb 100644 --- a/source/java/org/alfresco/rest/workflow/api/impl/WorkflowRestImpl.java +++ b/source/java/org/alfresco/rest/workflow/api/impl/WorkflowRestImpl.java @@ -26,6 +26,7 @@ import org.alfresco.repo.workflow.WorkflowConstants; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.repo.workflow.activiti.ActivitiConstants; import org.alfresco.repo.workflow.activiti.ActivitiScriptNode; +import org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine; import org.alfresco.rest.framework.core.exceptions.ApiException; import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException; import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException; @@ -72,6 +73,7 @@ public class WorkflowRestImpl protected ProcessEngine activitiProcessEngine; protected boolean deployWorkflowsInTenant; protected List excludeModelTypes = new ArrayList(Arrays.asList("bpm_priority", "bpm_description", "bpm_dueDate")); + private ActivitiWorkflowEngine activitiWorkflowEngine; static { @@ -269,6 +271,7 @@ public class WorkflowRestImpl } Item responseItem = createItemForNodeRef(nodeRef); + activitiWorkflowEngine.dispatchPackageUpdatedEvent(packageScriptNode, null, null, processId, null); return responseItem; } @@ -312,6 +315,7 @@ public class WorkflowRestImpl try { nodeService.removeChild(packageScriptNode.getNodeRef(), nodeRef); + activitiWorkflowEngine.dispatchPackageUpdatedEvent(packageScriptNode, null, null, processId, null); } catch (InvalidNodeRefException e) { @@ -541,4 +545,9 @@ public class WorkflowRestImpl } return item; } + + public void setActivitiWorkflowEngine(ActivitiWorkflowEngine activitiWorkflowEngine) + { + this.activitiWorkflowEngine = activitiWorkflowEngine; + } }