diff --git a/source/java/org/alfresco/repo/publishing/PublishEventActionTest.java b/source/java/org/alfresco/repo/publishing/PublishEventActionTest.java index 52db9fdc25..0f11fe150f 100644 --- a/source/java/org/alfresco/repo/publishing/PublishEventActionTest.java +++ b/source/java/org/alfresco/repo/publishing/PublishEventActionTest.java @@ -48,6 +48,7 @@ import javax.annotation.Resource; import org.alfresco.model.ContentModel; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.service.cmr.publishing.MutablePublishingPackage; +import org.alfresco.service.cmr.publishing.PublishingEvent; import org.alfresco.service.cmr.publishing.PublishingPackage; import org.alfresco.service.cmr.publishing.PublishingService; import org.alfresco.service.cmr.publishing.StatusUpdate; @@ -355,8 +356,15 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest assertNotNull(eventId); NodeRef eventNode = new NodeRef(eventId); assertTrue(nodeService.exists(eventNode)); - + Serializable eventStatus = nodeService.getProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS); + assertEquals(PublishingEvent.Status.SCHEDULED.name(), eventStatus); + action.executeImpl(null, eventNode); + + // Check Status has changed to COMPLETE + eventStatus = nodeService.getProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS); + assertEquals(PublishingEvent.Status.COMPLETE.name(), eventStatus); + return eventNode; } diff --git a/source/java/org/alfresco/repo/publishing/PublishingEventProcessor.java b/source/java/org/alfresco/repo/publishing/PublishingEventProcessor.java index 43c745bc97..fd62e073f8 100644 --- a/source/java/org/alfresco/repo/publishing/PublishingEventProcessor.java +++ b/source/java/org/alfresco/repo/publishing/PublishingEventProcessor.java @@ -65,10 +65,12 @@ public class PublishingEventProcessor public void processEventNode(NodeRef eventNode) { - ParameterCheck.mandatory("actionedUponNodeRef", eventNode); + ParameterCheck.mandatory("eventNode", eventNode); try { behaviourFilter.disableAllBehaviours(); + String inProgressStatus = PublishingEvent.Status.IN_PROGRESS.name(); + nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, inProgressStatus); PublishingEvent event = eventHelper.getPublishingEvent(eventNode); NodeRef environment = eventHelper.getEnvironmentNodeForPublishingEvent(eventNode); String channelName = event.getChannelName(); @@ -81,6 +83,8 @@ public class PublishingEventProcessor { publishEvent(channel, event); updateStatus(channel, environment, event.getStatusUpdate()); + String completedStatus = PublishingEvent.Status.COMPLETE.name(); + nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, completedStatus); } } finally