Merged 5.0.N (5.0.3) to HEAD (5.1)

110341: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3)
      110159: MNT-14392 - Adding debug log to ActivitiWorkflowEngine,
      110160: MNT-14392 more debug logging.,
      110199: MNT-14392 - Missed check in.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@110631 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tatyana Valkevych
2015-08-21 17:07:44 +00:00
parent b0ce68cac4
commit 10e4c81087

View File

@@ -118,6 +118,8 @@ import org.alfresco.util.GUID;
import org.alfresco.util.collections.Function;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
@@ -132,6 +134,8 @@ import org.xml.sax.InputSource;
*/
public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
{
private static Log logger = LogFactory.getLog(ActivitiWorkflowEngine.class);
// Workflow Component Messages
private static final String ERR_DEPLOY_WORKFLOW = "activiti.engine.deploy.workflow.error";
private static final String ERR_IS_WORKFLOW_DEPLOYED = "activiti.engine.is.workflow.deployed.error";
@@ -260,6 +264,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String msg = messageService.getMessage(ERR_CANCEL_WORKFLOW);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -298,6 +306,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String msg = messageService.getMessage(ERR_DELETE_WORKFLOW);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -350,6 +362,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(Exception ae)
{
String msg = messageService.getMessage(ERR_DEPLOY_WORKFLOW);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -375,6 +391,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_ACTIVE_WORKFLOW_INSTS, "");
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -392,6 +412,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_COMPLETED_WORKFLOW_INSTS, "");
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -409,6 +433,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_WORKFLOW_INSTS, "");
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -425,6 +453,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_ACTIVE_WORKFLOW_INSTS, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -446,6 +478,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -466,6 +502,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_ALL_DEFS_BY_NAME, workflowName);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -482,6 +522,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_COMPLETED_WORKFLOW_INSTS, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -508,6 +552,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF_BY_ID, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -530,6 +578,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF_BY_NAME, workflowName);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -566,11 +618,19 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(IOException ioe)
{
String msg = messageService.getMessage(ERR_GET_DEF_IMAGE, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ioe);
}
throw new WorkflowException(msg, ioe);
}
catch(ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_DEF_IMAGE, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -592,6 +652,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -731,7 +795,12 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
}
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_TASKS_FOR_PATH, pathId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -781,6 +850,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_TIMERS, workflowId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -846,6 +919,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -869,7 +946,11 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_WORKFLOW_PATHS);
throw new WorkflowException(msg, ae);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -885,6 +966,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch(ActivitiException ae)
{
String message = messageService.getMessage(ERR_GET_WORKFLOW_INSTS, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(message, ae);
}
throw new WorkflowException(message, ae);
}
}
@@ -902,6 +987,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (Exception ae)
{
String msg = messageService.getMessage(ERR_IS_WORKFLOW_DEPLOYED);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -1026,6 +1115,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_START_WORKFLOW, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -1069,6 +1162,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_UNDEPLOY_WORKFLOW, workflowDefinitionId);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -1442,6 +1539,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_ASSIGNED_TASKS);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -1523,6 +1624,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
authorityString = StringUtils.join(authorities.iterator(), ", ");
}
String msg = messageService.getMessage(ERR_GET_POOLED_TASKS, authorityString);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}
@@ -1589,6 +1694,10 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
catch (ActivitiException ae)
{
String msg = messageService.getMessage(ERR_GET_TASK_BY_ID);
if(logger.isDebugEnabled())
{
logger.debug(msg, ae);
}
throw new WorkflowException(msg, ae);
}
}