1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.workflowtasks.action;
16  
17  import com.liferay.portal.kernel.workflow.WorkflowThreadLocal;
18  
19  import javax.portlet.ActionRequest;
20  import javax.portlet.ActionResponse;
21  import javax.portlet.PortletConfig;
22  
23  import org.apache.struts.action.ActionForm;
24  import org.apache.struts.action.ActionMapping;
25  
26  /**
27   * <a href="EditDiscussionAction.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Jorge Ferrer
30   */
31  public class EditDiscussionAction extends
32      com.liferay.portlet.messageboards.action.EditDiscussionAction {
33  
34      public void processAction(
35              ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
36              ActionRequest actionRequest, ActionResponse actionResponse)
37          throws Exception {
38  
39          boolean workflowEnabled = WorkflowThreadLocal.isEnabled();
40  
41          WorkflowThreadLocal.setEnabled(false);
42  
43          try {
44              super.processAction(
45                  mapping, form, portletConfig, actionRequest, actionResponse);
46          }
47          finally {
48              WorkflowThreadLocal.setEnabled(workflowEnabled);
49          }
50      }
51  
52  }