[jboss-svn-commits] JBL Code SVN: r14272 - in labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions: impl and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Aug 15 19:30:14 EDT 2007


Author: kurt.stam at jboss.com
Date: 2007-08-15 19:30:14 -0400 (Wed, 15 Aug 2007)
New Revision: 14272

Modified:
   labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
   labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/DefaultCommandExecutorFactoryImpl.java
Log:
JBESB-709 throwing an exception to make the pipeline stop processing.

Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java	2007-08-15 23:03:25 UTC (rev 14271)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/CommandInterpreter.java	2007-08-15 23:30:14 UTC (rev 14272)
@@ -40,6 +40,7 @@
 import org.jboss.soa.esb.services.jbpm.Constants;
 import org.jboss.soa.esb.services.jbpm.util.Helper;
 import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmException;
 import org.jbpm.command.Command;
 import org.jbpm.command.CommandService;
 import org.jbpm.command.impl.CommandServiceImpl;
@@ -73,15 +74,15 @@
 	public Message process(Message message)
 		throws MalformedEPRException, CourierException, ActionProcessingException
 	{
-		Message 	response = null;
+		Message response = null;
 		try
 		{
 			response = CommandExecutorFactory.getInstance().getExecutor(message).execute(message);
 		}
 		catch (Exception e)
 		{
-			e.printStackTrace();
-			throw new ActionProcessingException(e);
+			_logger.error(e.getMessage(), e);
+			throw new ActionProcessingException(e.getMessage(), e);
 		}
 	
 		return replyMessage(message,response);
@@ -128,7 +129,7 @@
 		return (null==replyTo)? output : defaultReply(output);
 	} //________________________________
 		
-	public static Message doTheJob(Command command)
+	public static Message doTheJob(Command command) throws JbpmException
 	{
 		Message response = Helper.commandMessageTemplate();
 		Body	body	= response.getBody();
@@ -140,10 +141,11 @@
 			if (null!=obj)
 				body.add(Constants.JBPM_RETURN_OBJECT, obj);
 		}
-		catch (Exception e)
+		catch (JbpmException e)
 		{
 			body.add(Constants.RETURN_CODE, Constants.RETCODE_EXCEPTION);
 			body.add(Constants.EXCEPTION, e);
+            throw e;
 		}
 		
 		return response;

Modified: labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/DefaultCommandExecutorFactoryImpl.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/DefaultCommandExecutorFactoryImpl.java	2007-08-15 23:03:25 UTC (rev 14271)
+++ labs/jbossesb/trunk/product/services/jbpm/src/main/java/org/jboss/soa/esb/services/jbpm/actions/impl/DefaultCommandExecutorFactoryImpl.java	2007-08-15 23:30:14 UTC (rev 14272)
@@ -34,6 +34,7 @@
 import org.jboss.soa.esb.services.jbpm.actions.CommandInterpreter.CommandExecutor;
 import org.jboss.soa.esb.services.jbpm.util.Helper;
 import org.jbpm.JbpmContext;
+import org.jbpm.JbpmException;
 import org.jbpm.command.CancelProcessInstanceCommand;
 import org.jbpm.command.CancelTokenCommand;
 import org.jbpm.command.CancelWorkOnTaskCommand;
@@ -76,7 +77,7 @@
 
 	protected static final CommandExecutor DEPLOY_PROCESS_DEF_EXECUTOR = new CommandExecutor() 
 	{
-		public Message execute(Message request) throws Exception
+		public Message execute(Message request) throws JbpmException
 		{
 			Object obj = Helper.getObjectValue(request, Constants.PROCESS_DEFINITION);
 			if (null==obj)




More information about the jboss-svn-commits mailing list