Ejemplo n.º 1
0
        public void DoActionOnStateChanged(StateTransaction stateTransaction)
        {
            // TODO:  Do soemthing when the workflow has started

            // If this is a direct publish workflow, there should be only one state in the workflow
            // Automatically complete the workflow or else it stays in limbo

            ContentController contentController = new ContentController();

            ContentItem content = contentController.GetContentItem(stateTransaction.ContentItemId);

            Workflow workflow = WorkflowManager.Instance.GetWorkflow(content);

            if (workflow.FirstState == workflow.LastState)
            {
                WorkflowController workflowController = new WorkflowController();

                workflowController.CompleteState(content, "Completing direct publish workflow.");
            }
        }