[jbpm-commits] JBoss JBPM SVN: r3481 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def.
do-not-reply at jboss.org
do-not-reply at jboss.org
Sat Dec 20 08:12:41 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-12-20 08:12:41 -0500 (Sat, 20 Dec 2008)
New Revision: 3481
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
Log:
Prevent NPE when jbpmContext is not there. Is this a valid condition?
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 12:56:31 UTC (rev 3480)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/GraphElement.java 2008-12-20 13:12:41 UTC (rev 3481)
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.RuntimeAction;
@@ -194,11 +195,15 @@
{
executionContext.setEventSource(this);
- Services services = executionContext.getJbpmContext().getServices();
- EventService evService = (EventService)services.getService(EventService.SERVICE_NAME);
- if (evService != null)
+ // TODO: Is is a valid condition that the jbpmContext is not there?
+ JbpmContext jbpmContext = executionContext.getJbpmContext();
+ if (jbpmContext != null)
{
- evService.fireEvent(eventType, this, executionContext);
+ EventService evService = (EventService)jbpmContext.getServices().getService(EventService.SERVICE_NAME);
+ if (evService != null)
+ {
+ evService.fireEvent(eventType, this, executionContext);
+ }
}
fireAndPropagateEvent(eventType, executionContext);
More information about the jbpm-commits
mailing list